Commit 369e8d56 authored by Rafael Monnerat's avatar Rafael Monnerat

Update status and parameter gadget to rely on renderjs_extra

See merge request nexedi/slapos.core!569
parents df2138b9 28dbb885
......@@ -16,13 +16,13 @@
<key> <string>categories</string> </key>
<value>
<tuple>
<string>action_type/object_view</string>
<string>action_type/object_action</string>
</tuple>
</value>
</item>
<item>
<key> <string>category</string> </key>
<value> <string>object_view</string> </value>
<value> <string>object_action</string> </value>
</item>
<item>
<key> <string>condition</string> </key>
......@@ -60,7 +60,7 @@
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Parameter Editor</string> </value>
<value> <string>Edit Parameters</string> </value>
</item>
<item>
<key> <string>visible</string> </key>
......
import base64
text_content = context.getTextContent()
if context.getTextContent() is None:
text_content = '<?xml version="1.0" encoding="utf-8" ?><instance></instance>'
parameter_dict = {
'parameter' : {
'json_url': ".".join([context.getUrlString(), "json"]),
'softwaretype': context.getSourceReference(),
'shared': context.getRootSlave(),
'parameter_hash': base64.b64encode(text_content)
}
}
import json
return json.dumps(parameter_dict)
......@@ -114,9 +114,7 @@
</item>
<item>
<key> <string>default</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
<value> <string></string> </value>
</item>
<item>
<key> <string>description</string> </key>
......@@ -152,7 +150,9 @@
</item>
<item>
<key> <string>renderjs_extra</string> </key>
<value> <string></string> </value>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
<item>
<key> <string>title</string> </key>
......@@ -253,7 +253,7 @@
<dictionary>
<item>
<key> <string>_text</string> </key>
<value> <string>python: {"result": cell.getAggregateRelatedValue(portal_type="Software Instance").getAccessStatus()}</string> </value>
<value> <string>python: [(\'jio_key\', cell.getAggregateRelated(portal_type="Software Instance")), (\'result\', cell.getAggregateRelatedValue(portal_type="Software Instance").getAccessStatus())]</string> </value>
</item>
</dictionary>
</pickle>
......
......@@ -50,11 +50,11 @@
</item>
<item>
<key> <string>_params</string> </key>
<value> <string></string> </value>
<value> <string>text_content, **kw</string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>Base_getParameterEditorDict</string> </value>
<value> <string>InstanceTree_requestParameterChange</string> </value>
</item>
</dictionary>
</pickle>
......
......@@ -39,11 +39,11 @@
</item>
<item>
<key> <string>action</string> </key>
<value> <string></string> </value>
<value> <string>InstanceTree_requestParameterChange</string> </value>
</item>
<item>
<key> <string>action_title</string> </key>
<value> <string></string> </value>
<value> <string>Save</string> </value>
</item>
<item>
<key> <string>description</string> </key>
......@@ -83,7 +83,7 @@
<key> <string>bottom</string> </key>
<value>
<list>
<string>my_text_content</string>
<string>your_instance_xml</string>
</list>
</value>
</item>
......@@ -140,7 +140,7 @@
</item>
<item>
<key> <string>pt</string> </key>
<value> <string>form_view</string> </value>
<value> <string>form_dialog</string> </value>
</item>
<item>
<key> <string>row_length</string> </key>
......
......@@ -8,7 +8,7 @@
<dictionary>
<item>
<key> <string>id</string> </key>
<value> <string>my_text_content</string> </value>
<value> <string>your_instance_xml</string> </value>
</item>
<item>
<key> <string>message_values</string> </key>
......@@ -114,9 +114,7 @@
</item>
<item>
<key> <string>default</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
<value> <string></string> </value>
</item>
<item>
<key> <string>description</string> </key>
......@@ -152,7 +150,9 @@
</item>
<item>
<key> <string>renderjs_extra</string> </key>
<value> <string></string> </value>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
<item>
<key> <string>title</string> </key>
......@@ -195,7 +195,7 @@
</item>
<item>
<key> <string>editable</string> </key>
<value> <int>0</int> </value>
<value> <int>1</int> </value>
</item>
<item>
<key> <string>enabled</string> </key>
......@@ -229,7 +229,7 @@
</item>
<item>
<key> <string>title</string> </key>
<value> <string>my_text_content</string> </value>
<value> <string>Parameter</string> </value>
</item>
<item>
<key> <string>validator_field_id</string> </key>
......@@ -253,7 +253,11 @@
<dictionary>
<item>
<key> <string>_text</string> </key>
<value> <string>here/Base_getParameterEditorDict</string> </value>
<value> <string encoding="cdata"><![CDATA[
python: [(\'json_url\', context.getUrlString().split("?")[0] + ".json"), (\'softwaretype\', context.getSourceReference("")), (\'shared\', context.getRootSlave()), (\'parameter_xml\', context.getTextContent(\'<?xml version="1.0" encoding="utf-8" ?><instance></instance>\'))]
]]></string> </value>
</item>
</dictionary>
</pickle>
......
......@@ -504,35 +504,24 @@
.declareMethod('render', function (options) {
var restricted_softwaretype = false,
software_type_list = [],
parameter_dict,
parameter_hash,
parameter_xml;
if ((options.value !== undefined) && (typeof options.value === "string")) {
parameter_dict = JSON.parse(options.value).parameter
} else {
parameter_dict = options.value.parameter;
}
parameter_hash = options.parameter_hash,
// XXX Do we directly get parameter_xml parameter?
parameter_xml = options.parameter_xml;
parameter_hash = parameter_dict.parameter_hash,
// XXX Do we directly get parameter_xml parameter?
parameter_xml = parameter_dict.parameter_xml;
if (parameter_hash !== undefined) {
// A JSON where provided via gadgetfield
parameter_xml = atob(parameter_hash);
}
if (parameter_dict.software_type_list !== undefined) {
software_type_list = parameter_dict.software_type_list;
if (options.software_type_list !== undefined) {
software_type_list = options.software_type_list;
}
if (parameter_dict.softwaretype !== undefined) {
if (options.softwaretype !== undefined) {
restricted_softwaretype = true;
// exceptional situation where the default item must be in
// the list.
software_type_list.push(parameter_dict.softwaretype);
software_type_list.push(options.softwaretype);
}
return this.changeState({
......@@ -540,13 +529,13 @@
// hidden: options.hidden,
// key: options.key,
serialisation: options.serialisation,
json_url: parameter_dict.json_url,
json_url: options.json_url,
parameter_xml: parameter_xml,
restricted_softwaretype: restricted_softwaretype,
shared: parameter_dict.shared,
softwaretype: parameter_dict.softwaretype,
software_type_list: software_type_list,
softwareindex: parameter_dict.softwareindex,
shared: options.shared,
softwaretype: options.softwaretype,
softwareindex: options.softwareindex,
editable: options.editable,
// Force refresh in any case
render_timestamp: new Date().getTime()
......@@ -654,4 +643,4 @@
}, {mutex: 'statechange'});
}(window, rJS, XMLSerializer, DOMParser, vkbeautify,
domsugar, Boolean, URI));
\ No newline at end of file
domsugar, Boolean, URI));
......@@ -41,7 +41,6 @@
.ui-btn-ok:hover a {
color: white !important;
background: green !important;
cursor: default;
text-align: center;
}
......@@ -53,7 +52,6 @@
.ui-btn-warning:hover a {
color: white !important;
background: #f0ad4e !important;
cursor: default;
text-align: center;
}
......@@ -65,7 +63,6 @@
.ui-btn-error:hover a {
color: white !important;
background: red !important;
cursor: default;
text-align: center;
}
......@@ -77,7 +74,6 @@
.ui-btn-no-data:hover a {
color: grey !important;
background: grey !important;
cursor: default;
text-align: center;
}
......@@ -89,7 +85,6 @@
.ui-btn-color-white:hover a {
color: white !important;
background: grey !important;
cursor: default;
text-align: center;
}
......@@ -101,7 +96,6 @@
.ui-btn-white:active a,
.ui-btn-white:hover a {
background: white !important;
cursor: default;
text-align: center;
}
......
/*globals console, window, rJS, domsugar, JSON */
/*globals console, window, rJS, domsugar */
/*jslint indent: 2, nomen: true, maxlen: 80 */
(function (window, rJS, domsugar, JSON) {
(function (window, rJS, domsugar) {
"use strict";
var gadget_klass = rJS(window);
......@@ -210,7 +210,8 @@
{
"class": "ui-bar ui-corner-all first-child " + status_class
}, [
domsugar("a", main_link_configuration_dict)
domsugar(main_link_configuration_dict.href ? "a" : "span",
main_link_configuration_dict)
]);
return gadget;
}
......@@ -221,33 +222,22 @@
return {};
})
.onLoop(function () {
var gadget = this;
if (typeof gadget.state.jio_key === 'string' &&
gadget.state.jio_key !== '') {
return gadget.jio_get(gadget.state.jio_key)
.push(function (result) {
var state_dict = result.news || {};
state_dict.jio_key = gadget.state.jio_key;
return gadget.changeState(state_dict);
});
}
throw new Error(
'jio_key dont contains a proper value: ' +
JSON.stringify(gadget.state.jio_key)
);
}, 300000)
.onStateChange(function () {
return getStatus(this, this.state);
})
.declareMethod("render", function (options) {
// Save will force the gadget to be updated so
// result is empty.
var state_dict = options.value.result || {};
state_dict.jio_key = options.value.jio_key;
// crash as soon as possible to detect wrong configuration
if (!(options.hasOwnProperty('jio_key') &&
options.hasOwnProperty('result'))) {
throw new Error(
'status gadget did not receive jio_key and result values'
);
}
var state_dict = options.result || {};
state_dict.jio_key = options.jio_key;
return this.changeState(state_dict);
});
}(window, rJS, domsugar, JSON));
\ No newline at end of file
}(window, rJS, domsugar));
\ No newline at end of file
......@@ -114,9 +114,7 @@
</item>
<item>
<key> <string>default</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
<value> <string></string> </value>
</item>
<item>
<key> <string>description</string> </key>
......@@ -152,7 +150,9 @@
</item>
<item>
<key> <string>renderjs_extra</string> </key>
<value> <string></string> </value>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
<item>
<key> <string>title</string> </key>
......@@ -253,7 +253,7 @@
<dictionary>
<item>
<key> <string>_text</string> </key>
<value> <string>python: {"result": cell.getAccessStatus()}</string> </value>
<value> <string>python: [(\'jio_key\', cell.getRelativeUrl()), (\'result\', cell.getAccessStatus())]</string> </value>
</item>
</dictionary>
</pickle>
......
......@@ -102,6 +102,7 @@ def makeTestSlapOSCodingStyleTestCase(tested_business_template):
'slapos_cloud/InstanceTree_requestDestroy',
'slapos_cloud/InstanceTree_requestStart',
'slapos_cloud/InstanceTree_requestStop',
'slapos_cloud/InstanceTree_requestParameterChange',
'slapos_cloud/Organisation_afterClone',
'slapos_cloud/Organisation_init',
'slapos_cloud/Person_findPartition',
......@@ -124,7 +125,6 @@ def makeTestSlapOSCodingStyleTestCase(tested_business_template):
'slapos_cloud/SoftwareInstance_viewRenameAndRequestDestroyAction',
'slapos_cloud/Base_getSupportRequestInProgress',
'slapos_cloud/SoftwareInstance_checkDuplicationOnInstanceTreeConsistency',
'slapos_cloud/Base_getParameterEditorDict',
'slapos_cloud/ComputerNetwork_getRelatedSoftwareReleaseList',
'slapos_crm_monitoring/ComputeNode_checkInstanceOnCloseAllocation',
'slapos_crm_monitoring/SiteMessage_setSlapOSUserSourceAndDestinatationList',
......
.sensor-status {
min-width: 210px;
}
/* --------------------- CUSTOM MAP ----------------------- */
.custom-map-wrap {
position: relative;
......
......@@ -71,7 +71,9 @@
</item>
<item>
<key> <string>content_type</string> </key>
<value> <string>text/css</string> </value>
<value>
<none/>
</value>
</item>
<item>
<key> <string>default_reference</string> </key>
......@@ -246,7 +248,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>964.17264.3291.60876</string> </value>
<value> <string>1006.58340.40727.23620</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -266,7 +268,7 @@
</tuple>
<state>
<tuple>
<float>1513789742.97</float>
<float>1693252894.23</float>
<string>UTC</string>
</tuple>
</state>
......
......@@ -12,6 +12,8 @@
<!-- renderjs -->
<script src="rsvp.js" type="text/javascript"></script>
<script src="renderjs.js" type="text/javascript"></script>
<script src="domsugar.js" type="text/javascript"></script>
<!-- custom script -->
<script src="leaflet.js" type="text/javascript"></script>
......
......@@ -242,7 +242,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>961.22055.19881.8430</string> </value>
<value> <string>1009.49086.48551.49459</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -262,7 +262,7 @@
</tuple>
<state>
<tuple>
<float>1502452463.01</float>
<float>1693252925.17</float>
<string>UTC</string>
</tuple>
</state>
......
/*jslint nomen: true, maxlen:200, indent:2*/
/*global window, document, rJS, console, RSVP, L, $, Image */
(function (window, document, rJS, RSVP) {
/*global window, rJS, console, RSVP, L, Image, domsugar */
(function (window, rJS, RSVP, L, domsugar) {
"use strict";
rJS(window)
.ready(function (g) {
g.props = {};
})
.ready(function (g) {
g.props.deferred = new RSVP.defer();
})
.ready(function (g) {
return g.getElement()
.push(function (element) {
g.props.element = element;
});
})
.declareAcquiredMethod("notifyChange", "notifyChange")
.declareAcquiredMethod("getUrlFor", "getUrlFor")
.declareAcquiredMethod("getSetting", "getSetting")
......@@ -57,31 +49,12 @@
return gadget.props.deferred.resolve();
});
})
.declareMethod('getContent', function (options) {
var gadget = this,
result = [],
tmp,
i;
for (i = 0; i < gadget.props.new_marker_list.length; i += 1) {
tmp = gadget.props.new_marker_list[i].getLatLng();
result.push({latitude: tmp.lat, longitude: tmp.lng});
}
return result;
})
.declareService(function () {
var gadget = this,
map_element,
latitude,
longitude,
zoom,
marker_list,
new_marker_list = [],
marker_link,
marker_label,
marker_space,
marker_monitor_link,
group,
redIcon,
map,
osmUrl = 'https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png',
osm,
......@@ -91,7 +64,6 @@
'Imagery © <a href="http://mapbox.com">Mapbox</a>',
marker,
marker_options = {},
queue,
m,
i,
bounds,
......@@ -109,24 +81,21 @@
return gadget.props.deferred.promise;
})
.push(function () {
var l = [],
marker_list = gadget.options.marker_list || [];
var l = [];
marker_list = gadget.options.marker_list || [];
for (i = 0; i < marker_list.length; i += 1) {
l.push(gadget.getUrlFor({command: "change",
options: {jio_key: marker_list[i].jio_key,
page: "slap_controller"}}));
}
l.push(gadget.getSetting("hateoas_url"));
return RSVP.all(l);
})
.push(function (url_list) {
var hateoas_url = url_list.pop();
map_element = gadget.props.element.querySelector(".map"),
latitude = gadget.options.doc.latitude || 0,
longitude = gadget.options.doc.longitude || 0,
zoom = gadget.options.zoom || 0,
marker_list = gadget.options.marker_list || [];
redIcon = L.icon({iconUrl: "hateoas/marker-icon-mod-100-70-10.png",
var map_element = gadget.element.querySelector(".map"),
latitude = gadget.options.doc.latitude || 0,
longitude = gadget.options.doc.longitude || 0,
zoom = gadget.options.zoom || 0,
redIcon = L.icon({iconUrl: "hateoas/marker-icon-mod-100-70-10.png",
shadowUrl: "hateoas/marker-shadow.png",
iconSize: [25, 41],
iconAnchor: [12, 41],
......@@ -152,27 +121,9 @@
for (i = 0; i < marker_list.length; i += 1) {
m = marker_list[i];
marker_link = document.createElement("a");
marker_link.href = url_list[i];
marker_link.text = m.doc.title;
marker_link.className = "ui-btn-map";
marker_label = document.createElement("div");
marker_label.appendChild(marker_link);
marker_space = document.createElement("span");
marker_space.innerHTML = " &nbsp; &nbsp; | &nbsp; ";
marker_space.className = "ui-btn-map";
marker_label.appendChild(marker_space);
marker_monitor_link = document.createElement("a");
marker_monitor_link.target = "_blank";
// Please update me, and compose the actuall url.
marker_monitor_link.href = hateoas_url + marker_list[i].jio_key + "/Base_redirectToMonitor";
marker_monitor_link.text = " > ";
marker_monitor_link.className = "ui-btn-map ui-btn ui-btn-icon-left ui-icon-desktop";
marker_label.appendChild(marker_monitor_link);
marker_label = domsugar("div", {}, [
domsugar("a", {href: url_list[i], text: m.doc.title, 'class': "ui-btn-map"})
]);
marker = new L.marker(
[m.doc.latitude || 0, m.doc.longitude || 0],
marker_options
......@@ -209,23 +160,18 @@
container = e.popup._container.querySelector('.leaflet-popup-content-wrapper');
tmp = container.querySelector('.sensor-status');
if (!tmp) {
tmp = document.createElement('div');
tmp.className = 'sensor-status';
tmp.style['min-width'] = '210px';
tmp = domsugar('div', {'class': 'sensor-status'});
container.appendChild(tmp);
e.target._queue.push(function () {
return gadget.declareGadget('gadget_slapos_status.html', {
element: tmp
});
})
.push(function (compute_node) {
}).push(function (compute_node) {
//xxxx repopup to resize popup
new_marker_list[index].openPopup();
return compute_node.render({value: {
return compute_node.render({
jio_key : gadget.options.marker_list ? gadget.options.marker_list[index].jio_key : "",
doc: gadget.options.marker_list ? gadget.options.marker_list[index].doc : "",
result: gadget.options.marker_list ? gadget.options.marker_list[index].doc.result : ""
}
});
});
}
......@@ -236,4 +182,4 @@
return RSVP.all(list);
});
});
}(window, document, rJS, RSVP));
\ No newline at end of file
}(window, rJS, RSVP, L, domsugar));
\ No newline at end of file
......@@ -238,7 +238,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>1001.24988.19785.29030</string> </value>
<value> <string>1010.50117.59231.38434</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -258,7 +258,7 @@
</tuple>
<state>
<tuple>
<float>1656977110.45</float>
<float>1693270216.86</float>
<string>UTC</string>
</tuple>
</state>
......
......@@ -115,16 +115,14 @@
page_title_translation = result[2][9];
var doc = result[1],
parameter_dict = {
'parameter' : {
'json_url': doc.url_string.split('?')[0] + ".json",
'parameter_hash': btoa('<?xml version="1.0" encoding="utf-8" ?><instance/>')
}
'json_url': doc.url_string.split('?')[0] + ".json",
'parameter_hash': btoa('<?xml version="1.0" encoding="utf-8" ?><instance/>')
};
if (options.software_type) {
parameter_dict["parameter"]['softwaretype'] = options.software_type;
parameter_dict['softwaretype'] = options.software_type;
}
if (options.shared) {
parameter_dict["parameter"]['shared'] = true;
parameter_dict['shared'] = true;
}
return result[0].render({
......@@ -155,7 +153,7 @@
"your_text_content": {
"description": "",
"title": result[2][5],
"default": parameter_dict,
"default": "",
"css_class": "",
"required": 1,
"editable": 1,
......@@ -163,7 +161,8 @@
"sandbox": "",
"key": "text_content",
"hidden": 0,
"type": "GadgetField"
"type": "GadgetField",
"renderjs_extra": JSON.stringify(parameter_dict)
},
"your_computer_guid": {
"description": result[2][2],
......
......@@ -283,7 +283,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>1008.22803.51783.61098</string> </value>
<value> <string>1010.44014.55766.17408</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -303,7 +303,7 @@
</tuple>
<state>
<tuple>
<float>1683853456.43</float>
<float>1692989933.58</float>
<string>UTC</string>
</tuple>
</state>
......
/*global window, rJS, RSVP */
/*global window, rJS, RSVP, JSON */
/*jslint nomen: true, indent: 2, maxerr: 3*/
(function (window, rJS, RSVP) {
(function (window, rJS, RSVP, JSON) {
"use strict";
rJS(window)
......@@ -19,19 +19,21 @@
var gadget = this;
return gadget.jio_allDocs(param_list[0])
.push(function (result) {
var i, value, news, len = result.data.total_rows;
var i, value, value_jio_key, len = result.data.total_rows;
for (i = 0; i < len; i += 1) {
if ((result.data.rows[i].value.hasOwnProperty("ComputeNode_getNewsDict"))) {
value = result.data.rows[i].id;
news = result.data.rows[i].value.ComputeNode_getNewsDict;
result.data.rows[i].value.ComputeNode_getNewsDict = {
if ((result.data.rows[i].value.hasOwnProperty("getAccessStatus"))) {
value_jio_key = result.data.rows[i].id;
value = result.data.rows[i].value.getAccessStatus;
result.data.rows[i].value.getAccessStatus = {
field_gadget_param : {
css_class: "",
description: "The Status",
hidden: 0,
"default": {jio_key: value,
result: news,
portal_type: "Compute Node"},
default: "",
renderjs_extra: JSON.stringify({
jio_key: value_jio_key,
result: value
}),
key: "status",
url: "gadget_slapos_status.html",
title: "Status",
......@@ -86,7 +88,7 @@
['title', result[3][0]],
['reference', result[3][1]],
['allocation_scope_title', result[3][2]],
['ComputeNode_getNewsDict', result[3][3]]
['getAccessStatus', result[3][3]]
],
form_list = result[0];
lines_limit = result[1];
......@@ -151,4 +153,4 @@
});
});
});
}(window, rJS, RSVP));
\ No newline at end of file
}(window, rJS, RSVP, JSON));
\ No newline at end of file
......@@ -238,7 +238,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>1001.59387.30502.30993</string> </value>
<value> <string>1010.39712.21917.33587</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -258,7 +258,7 @@
</tuple>
<state>
<tuple>
<float>1659068807.75</float>
<float>1692646587.64</float>
<string>UTC</string>
</tuple>
</state>
......
/*global window, rJS, RSVP */
/*global window, rJS, RSVP, JSON */
/*jslint nomen: true, indent: 2, maxerr: 3 */
(function (window, rJS, RSVP) {
(function (window, rJS, RSVP, JSON) {
"use strict";
rJS(window)
......@@ -28,18 +28,19 @@
.push(function (result) {
var i, value, value_jio_key, len = result.data.total_rows;
for (i = 0; i < len; i += 1) {
if (1 || (result.data.rows[i].value.SoftwareInstallation_getNewsDict)) {
value = result.data.rows[i].value.SoftwareInstallation_getNewsDict;
if (1 || (result.data.rows[i].value.getAccessStatus)) {
value = result.data.rows[i].value.getAccessStatus;
value_jio_key = result.data.rows[i].id;
result.data.rows[i].value.SoftwareInstallation_getNewsDict = {
result.data.rows[i].value.getAccessStatus = {
field_gadget_param : {
css_class: "",
description: "The Status",
hidden: 0,
"default": {
"default": "",
renderjs_extra: JSON.stringify({
jio_key: value_jio_key,
result: value,
portal_type: "Software Installation"},
result: value
}),
key: "status",
url: "gadget_slapos_status.html",
title: "Status",
......@@ -67,20 +68,14 @@
return form_gadget.getContent();
})
.push(function (content) {
return gadget.updateDocument(content)
.push(function (ndoc) {
ndoc.allocation_scope = content.allocation_scope;
return gadget.render({
jio_key: gadget.state.jio_key,
doc: ndoc
});
});
return gadget.updateDocument(content);
})
.push(function () {
return gadget.notifySubmitted({message: gadget.message_translation, status: 'success'});
});
})
.declareMethod("triggerSubmit", function () {
return this.element.querySelector('button[type="submit"]').click();
})
......@@ -153,7 +148,7 @@
column_list = [
['SoftwareInstallation_getSoftwareReleaseInformation', results[2][1]],
['url_string', results[2][2]],
['SoftwareInstallation_getNewsDict', results[2][3]]
['getAccessStatus', results[2][3]]
],
ticket_column_list = [
['title', results[2][4]],
......@@ -304,9 +299,11 @@
"my_monitoring_status": {
"description": "",
"title": results[2][29],
"default": {jio_key: gadget.state.jio_key,
result: gadget.state.doc.news,
portal_type: "Compute Node"},
"default": "",
"renderjs_extra": JSON.stringify({
jio_key: gadget.state.jio_key,
result: gadget.state.doc.news
}),
"css_class": "",
"required": 0,
"editable": 0,
......@@ -416,4 +413,4 @@
return gadget.updateHeader(header_dict);
});
});
}(window, rJS, RSVP));
\ No newline at end of file
}(window, rJS, RSVP, JSON));
\ No newline at end of file
......@@ -267,7 +267,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>1009.49086.48551.49459</string> </value>
<value> <string>1010.39674.54022.30344</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -287,7 +287,7 @@
</tuple>
<state>
<tuple>
<float>1690911267.44</float>
<float>1692648139.06</float>
<string>UTC</string>
</tuple>
</state>
......
......@@ -28,31 +28,28 @@
var gadget = this;
return gadget.jio_allDocs(param_list[0])
.push(function (result) {
var i, value, news, len = result.data.total_rows;
var i, value, value_jio_key, len = result.data.total_rows;
for (i = 0; i < len; i += 1) {
if (1 || (result.data.rows[i].value.hasOwnProperty("ComputeNode_getNewsDict"))) {
value = result.data.rows[i].id;
news = result.data.rows[i].value.ComputeNode_getNewsDict;
result.data.rows[i].value.ComputeNode_getNewsDict = {
if (result.data.rows[i].value.hasOwnProperty("getAccessStatus")) {
value_jio_key = result.data.rows[i].id;
value = result.data.rows[i].value.getAccessStatus;
result.data.rows[i].value.getAccessStatus = {
field_gadget_param : {
css_class: "",
description: "The Status",
hidden: 0,
"default": {
jio_key: value,
result: news,
portal_type: "Compute Node"
},
"default": "",
renderjs_extra: JSON.stringify({
jio_key: value_jio_key,
result: value
}),
key: "status",
url: "gadget_slapos_status.html",
title: gadget.title_translation,
type: "GadgetField"
}
};
result.data.rows[i].value["listbox_uid:list"] = {
//key: "listbox_uid:list",
//value: 2713
};
result.data.rows[i].value["listbox_uid:list"] = {};
}
}
return result;
......@@ -121,7 +118,7 @@
['title', result[1][1]],
['reference', result[1][2]],
['allocation_scope_translated_title', result[1][3]],
['ComputeNode_getNewsDict', result[1][4]]
['getAccessStatus', result[1][4]]
];
return result[0].render({
erp5_document: {
......@@ -151,8 +148,11 @@
"my_monitoring_status": {
"description": "",
"title": result[1][5],
"default": {jio_key: gadget.state.jio_key,
result: gadget.state.doc.news},
"default": "",
"renderjs_extra": JSON.stringify({
jio_key: gadget.state.jio_key,
result: gadget.state.doc.news
}),
"css_class": "",
"required": 0,
"editable": 0,
......
......@@ -238,7 +238,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>1009.17464.55631.39321</string> </value>
<value> <string>1010.39734.62596.14779</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -258,7 +258,7 @@
</tuple>
<state>
<tuple>
<float>1687465625.96</float>
<float>1692672489.88</float>
<string>UTC</string>
</tuple>
</state>
......
/*global window, rJS, RSVP, jIO, Blob, btoa */
/*global window, rJS, RSVP, jIO, btoa, JSON */
/*jslint nomen: true, indent: 2, maxerr: 3 */
(function (window, rJS, RSVP, btoa) {
(function (window, rJS, RSVP, jIO, btoa, JSON) {
"use strict";
rJS(window)
......@@ -27,17 +27,21 @@
var gadget = this;
return gadget.jio_allDocs(param_list[0])
.push(function (result) {
var i, value, jio_key_value, len = result.data.total_rows;
var i, value, value_jio_key, len = result.data.total_rows;
for (i = 0; i < len; i += 1) {
if (1 || (result.data.rows[i].value.SoftwareInstance_getNewsDict)) {
value = result.data.rows[i].value.SoftwareInstance_getNewsDict;
jio_key_value = result.data.rows[i].id;
value_jio_key = result.data.rows[i].id;
result.data.rows[i].value.SoftwareInstance_getNewsDict = {
field_gadget_param : {
css_class: "",
description: gadget.description_translation,
hidden: 0,
"default": {jio_key: jio_key_value, result: value},
"default": "",
renderjs_extra: JSON.stringify({
jio_key: value_jio_key,
result: value
}),
key: "status",
url: "gadget_slapos_status.html",
title: gadget.title_translation,
......@@ -49,7 +53,7 @@
value: 2713
};
}
if (1 || (result.data.rows[i].value.hasOwnProperty("connection_key"))) {
if (result.data.rows[i].value.hasOwnProperty("connection_key")) {
value = result.data.rows[i].value.connection_key;
result.data.rows[i].value.connection_key = {
field_gadget_param : {
......@@ -224,15 +228,13 @@
['connection_value', result[1][14]]
],
parameter_dict = {
'parameter' : {
'json_url': gadget.state.doc.url_string.split('?')[0] + ".json",
'softwaretype': gadget.state.doc.source_reference,
'shared': gadget.state.doc.root_slave ? 1 : 0,
'parameter_hash': btoa('<?xml version="1.0" encoding="utf-8" ?><instance></instance>')
}
'json_url': gadget.state.doc.url_string.split('?')[0] + ".json",
'softwaretype': gadget.state.doc.source_reference,
'shared': gadget.state.doc.root_slave ? 1 : 0,
'parameter_hash': btoa('<?xml version="1.0" encoding="utf-8" ?><instance></instance>')
};
if (gadget.state.doc.text_content !== undefined) {
parameter_dict.parameter.parameter_hash = btoa(gadget.state.doc.text_content);
parameter_dict.parameter_hash = btoa(gadget.state.doc.text_content);
}
return gadget.getSetting("hateoas_url")
.push(function (url) {
......@@ -310,7 +312,7 @@
"my_text_content": {
"description": "",
"title": result[1][19],
"default": parameter_dict,
"default": "",
"css_class": "",
"required": 0,
"editable": 1,
......@@ -318,7 +320,9 @@
"sandbox": "",
"key": "text_content",
"hidden": 0,
"type": "GadgetField"
"type": "GadgetField",
"renderjs_extra": JSON.stringify(parameter_dict)
},
"my_source_project": {
"description": result[1][20],
......@@ -345,8 +349,11 @@
"my_monitoring_status": {
"description": "",
"title": result[1][23],
"default": {jio_key: gadget.state.jio_key,
result: gadget.state.doc.news},
"default": "",
"renderjs_extra": JSON.stringify({
jio_key: gadget.state.jio_key,
result: gadget.state.doc.news
}),
"css_class": "",
"required": 0,
"editable": 0,
......@@ -543,4 +550,4 @@
return gadget.updateHeader(header_dict);
});
});
}(window, rJS, RSVP, btoa));
}(window, rJS, RSVP, jIO, btoa, JSON));
......@@ -238,7 +238,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>1008.51163.7897.31249</string> </value>
<value> <string>1010.44015.51861.27016</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -258,7 +258,7 @@
</tuple>
<state>
<tuple>
<float>1687459175.1</float>
<float>1692924255.67</float>
<string>UTC</string>
</tuple>
</state>
......
/*global window, rJS, RSVP */
/*global window, rJS, RSVP, JSON */
/*jslint nomen: true, indent: 2, maxerr: 3*/
(function (window, rJS, RSVP) {
(function (window, rJS, RSVP, JSON) {
"use strict";
rJS(window)
......@@ -18,18 +18,21 @@
var gadget = this;
return gadget.jio_allDocs(param_list[0])
.push(function (result) {
var i, value, news, len = result.data.total_rows;
var i, value, value_jio_key, len = result.data.total_rows;
for (i = 0; i < len; i += 1) {
if (result.data.rows[i].value.hasOwnProperty("ComputerNetwork_getNewsDict")) {
value = result.data.rows[i].id;
news = result.data.rows[i].value.ComputerNetwork_getNewsDict;
value_jio_key = result.data.rows[i].id;
value = result.data.rows[i].value.ComputerNetwork_getNewsDict;
result.data.rows[i].value.ComputerNetwork_getNewsDict = {
field_gadget_param : {
css_class: "",
description: "The Status",
hidden: 0,
"default": {jio_key: value,
result: news},
default: "",
renderjs_extra: JSON.stringify({
jio_key: value_jio_key,
result: value
}),
key: "status",
url: "gadget_slapos_status.html",
title: "Status",
......@@ -141,4 +144,4 @@
});
});
});
}(window, rJS, RSVP));
\ No newline at end of file
}(window, rJS, RSVP, JSON));
\ No newline at end of file
......@@ -249,7 +249,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>1001.59379.40192.59272</string> </value>
<value> <string>1010.39717.23460.37051</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -269,7 +269,7 @@
</tuple>
<state>
<tuple>
<float>1659068921.68</float>
<float>1692646374.56</float>
<string>UTC</string>
</tuple>
</state>
......
/*global window, rJS, RSVP */
/*global window, rJS, RSVP, JSON */
/*jslint nomen: true, indent: 2, maxerr: 3*/
(function (window, rJS, RSVP) {
(function (window, rJS, RSVP, JSON) {
"use strict";
rJS(window)
......@@ -9,7 +9,6 @@
.declareAcquiredMethod("redirect", "redirect")
.declareAcquiredMethod("reload", "reload")
.declareAcquiredMethod("getSetting", "getSetting")
.declareAcquiredMethod("setSetting", "setSetting")
.declareAcquiredMethod("getUrlFor", "getUrlFor")
.declareAcquiredMethod("jio_allDocs", "jio_allDocs")
.declareAcquiredMethod("jio_getAttachment", "jio_getAttachment")
......@@ -19,16 +18,20 @@
var gadget = this;
return gadget.jio_allDocs(param_list[0])
.push(function (result) {
var i, value, news, len = result.data.total_rows;
var i, value, value_jio_key, len = result.data.total_rows;
for (i = 0; i < len; i += 1) {
if (1 || (result.data.rows[i].value.hasOwnProperty("InstanceTree_getNewsDict"))) {
value = result.data.rows[i].id;
news = result.data.rows[i].value.InstanceTree_getNewsDict;
if (result.data.rows[i].value.hasOwnProperty("InstanceTree_getNewsDict")) {
value_jio_key = result.data.rows[i].id;
value = result.data.rows[i].value.InstanceTree_getNewsDict;
result.data.rows[i].value.InstanceTree_getNewsDict = {
field_gadget_param : {
css_class: "",
hidden: 0,
default: {jio_key: value, result: news},
default: "",
renderjs_extra: JSON.stringify({
jio_key: value_jio_key,
result: value
}),
key: "status",
url: "gadget_slapos_status.html",
type: "GadgetField"
......@@ -105,4 +108,4 @@
});
});
});
}(window, rJS, RSVP));
\ No newline at end of file
}(window, rJS, RSVP, JSON));
\ No newline at end of file
......@@ -238,7 +238,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>1001.59388.52713.22408</string> </value>
<value> <string>1010.39704.42949.15616</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -258,7 +258,7 @@
</tuple>
<state>
<tuple>
<float>1659068879.32</float>
<float>1692646558.09</float>
<string>UTC</string>
</tuple>
</state>
......
/*global window, rJS, RSVP */
/*global window, rJS, RSVP, JSON */
/*jslint nomen: true, indent: 2, maxerr: 3*/
(function (window, rJS, RSVP) {
(function (window, rJS, RSVP, JSON) {
'use strict';
rJS(window)
......@@ -24,10 +24,7 @@
value_jio_key,
len = result.data.total_rows;
for (i = 0; i < len; i += 1) {
if (
1 ||
result.data.rows[i].value.hasOwnProperty('Organisation_getNewsDict')
) {
if (result.data.rows[i].value.hasOwnProperty('Organisation_getNewsDict')) {
value_jio_key = result.data.rows[i].id;
value = result.data.rows[i].value.Organisation_getNewsDict;
result.data.rows[i].value.Organisation_getNewsDict = {
......@@ -35,7 +32,11 @@
css_class: '',
description: 'The Status',
hidden: 0,
default: { jio_key: value_jio_key, result: value },
default: "",
renderjs_extra: JSON.stringify({
jio_key: value_jio_key,
result: value
}),
key: 'status',
url: 'gadget_slapos_status.html',
title: 'Status',
......@@ -94,7 +95,6 @@
column_list = [
['title', result[2][0]],
['reference', result[2][1]],
//['default_address_region_title', result[2][2]],
['Organisation_getNewsDict', result[2][3]]
];
destination_list = '%22NULL%22%2C';
......@@ -168,4 +168,4 @@
});
});
});
}(window, rJS, RSVP));
}(window, rJS, RSVP, JSON));
......@@ -238,7 +238,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>1001.59386.28929.32102</string> </value>
<value> <string>1010.39714.20170.25019</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -258,7 +258,7 @@
</tuple>
<state>
<tuple>
<float>1659068860.66</float>
<float>1692645285.36</float>
<string>UTC</string>
</tuple>
</state>
......
/*global window, rJS, RSVP, jIO, Blob */
/*global window, rJS, RSVP, JSON */
/*jslint nomen: true, indent: 2, maxerr: 3 */
(function (window, rJS, RSVP) {
(function (window, rJS, RSVP, JSON) {
"use strict";
rJS(window)
......@@ -30,17 +30,21 @@
.push(function (result) {
var i, value, value_jio_key, len = result.data.total_rows;
for (i = 0; i < len; i += 1) {
if (1 || (result.data.rows[i].value.hasOwnProperty("ComputeNode_getNewsDict"))) {
if (result.data.rows[i].value.hasOwnProperty("getAccessStatus")) {
value_jio_key = result.data.rows[i].id;
value = result.data.rows[i].value.ComputeNode_getNewsDict;
result.data.rows[i].value.ComputeNode_getNewsDict = {
value = result.data.rows[i].value.getAccessStatus;
result.data.rows[i].value.getAccessStatus = {
field_gadget_param : {
css_class: "",
description: gadget.description_translation,
hidden: 0,
"default": {jio_key: value_jio_key, result: value, portal_type: "Compute Node"},
default: "",
key: "status",
url: "gadget_slapos_status.html",
renderjs_extra: JSON.stringify({
jio_key: value_jio_key,
result: value
}),
title: gadget.title_translation,
type: "GadgetField"
}
......@@ -117,7 +121,7 @@
column_list = [
['title', result[2][0]],
['reference', result[2][1]],
['ComputeNode_getNewsDict', result[2][9]]
['getAccessStatus', result[2][9]]
];
return result[0].render({
erp5_document: {
......@@ -169,8 +173,11 @@
"my_monitoring_status": {
"description": "",
"title": result[2][4],
"default": {jio_key: gadget.state.jio_key,
result: gadget.state.doc.news},
"default": "",
"renderjs_extra": JSON.stringify({
jio_key: gadget.state.jio_key,
result: gadget.state.doc.news
}),
"css_class": "",
"required": 1,
"editable": 0,
......@@ -270,4 +277,4 @@
return gadget.updateHeader(header_dict);
});
});
}(window, rJS, RSVP));
\ No newline at end of file
}(window, rJS, RSVP, JSON));
\ No newline at end of file
......@@ -236,7 +236,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>999.2068.62564.17</string> </value>
<value> <string>1010.39676.63129.16622</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -256,7 +256,7 @@
</tuple>
<state>
<tuple>
<float>1654874891.91</float>
<float>1692673382.31</float>
<string>UTC</string>
</tuple>
</state>
......
/*global window, rJS, RSVP, jIO, Blob */
/*global window, rJS, RSVP, JSON */
/*jslint nomen: true, indent: 2, maxerr: 3 */
(function (window, rJS, RSVP) {
(function (window, rJS, RSVP, JSON) {
"use strict";
rJS(window)
......@@ -153,10 +153,11 @@
"my_monitoring_status": {
"description": "",
"title": result[2][8],
"default": {
"default": "",
"renderjs_extra": JSON.stringify({
jio_key: gadget.state.jio_key,
result: gadget.state.doc.news
},
}),
"css_class": "",
"required": 1,
"editable": 0,
......@@ -210,4 +211,4 @@
return gadget.updateHeader(header_dict);
});
});
}(window, rJS, RSVP));
\ No newline at end of file
}(window, rJS, RSVP, JSON));
\ No newline at end of file
......@@ -238,7 +238,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>1001.26171.19762.42854</string> </value>
<value> <string>1006.58340.40727.23620</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -258,7 +258,7 @@
</tuple>
<state>
<tuple>
<float>1657906193.21</float>
<float>1692645366.58</float>
<string>UTC</string>
</tuple>
</state>
......
/*global window, rJS, RSVP, jIO, Blob */
/*global window, rJS, RSVP, JSON */
/*jslint nomen: true, indent: 2, maxerr: 3 */
(function (window, rJS, RSVP) {
(function (window, rJS, JSON) {
"use strict";
rJS(window)
......@@ -30,7 +30,7 @@
.push(function (result) {
var i, value, len = result.data.total_rows;
for (i = 0; i < len; i += 1) {
if (1 || (result.data.rows[i].value.hasOwnProperty("connection_key"))) {
if (result.data.rows[i].value.hasOwnProperty("connection_key")) {
value = result.data.rows[i].value.connection_key;
result.data.rows[i].value.connection_key = {
field_gadget_param : {
......@@ -164,11 +164,11 @@
"my_monitoring_status": {
"description": "",
"title": result[2][2],
"default": {
"default": "",
"renderjs_extra": JSON.stringify({
jio_key: gadget.state.jio_key,
result: gadget.state.doc.news,
portal_type: gadget.state.doc.portal_type
},
result: gadget.state.doc.news
}),
"css_class": "",
"required": 1,
"editable": 0,
......@@ -307,4 +307,4 @@
return gadget.updateHeader(header_dict);
});
});
}(window, rJS, RSVP));
\ No newline at end of file
}(window, rJS, RSVP, JSON));
\ No newline at end of file
......@@ -238,7 +238,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>1008.13874.12169.28194</string> </value>
<value> <string>1010.39695.33171.41693</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -258,7 +258,7 @@
</tuple>
<state>
<tuple>
<float>1684250249.63</float>
<float>1692644162.31</float>
<string>UTC</string>
</tuple>
</state>
......
/*global window, rJS, RSVP, btoa */
/*global window, rJS, RSVP, btoa, JSON */
/*jslint nomen: true, indent: 2, maxerr: 3, sub:true */
(function (window, rJS, RSVP) {
(function (window, rJS, RSVP, btoa, JSON) {
"use strict";
rJS(window)
......@@ -106,13 +106,11 @@
parameter_hash = btoa(gadget.state.parameter_output);
}
parameter_dict = {
'parameter' : {
'json_url': gadget.state.url_string.split('?')[0] + ".json",
'parameter_hash': parameter_hash
}
'json_url': gadget.state.url_string.split('?')[0] + ".json",
'parameter_hash': parameter_hash
};
if (gadget.state.software_type_list) {
parameter_dict.parameter.software_type_list = gadget.state.software_type_list.split(',');
parameter_dict.software_type_list = gadget.state.software_type_list.split(',');
}
return result[0].render({
erp5_document: {
......@@ -131,7 +129,7 @@
"your_text_content": {
"description": "",
"title": "Parameters",
"default": parameter_dict,
"default": "",
"css_class": "",
"required": 1,
"editable": gadget.state.url_string !== "",
......@@ -139,7 +137,8 @@
"sandbox": "",
"key": "text_content",
"hidden": gadget.state.url_string === "",
"type": "GadgetField"
"type": "GadgetField",
"renderjs_extra": JSON.stringify(parameter_dict)
},
"your_software_type": {
"description": "",
......@@ -207,4 +206,4 @@
});
});
});
}(window, rJS, RSVP));
\ No newline at end of file
}(window, rJS, RSVP, btoa, JSON));
\ No newline at end of file
......@@ -281,7 +281,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>1004.41258.43166.28757</string> </value>
<value> <string>1010.42602.14389.54903</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -301,7 +301,7 @@
</tuple>
<state>
<tuple>
<float>1669664533.48</float>
<float>1692903464.84</float>
<string>UTC</string>
</tuple>
</state>
......
/*global window, rJS, RSVP, btoa */
/*global window, rJS, RSVP, btoa, JSON */
/*jslint nomen: true, indent: 2, maxerr: 3, sub:true */
(function (window, rJS, RSVP) {
(function (window, rJS, RSVP, btoa, JSON) {
"use strict";
rJS(window)
......@@ -112,15 +112,13 @@
parameter_hash = btoa(gadget.state.parameter_output);
}
parameter_dict = {
'parameter' : {
'json_url': gadget.state.url_string.split('?')[0] + ".json",
'parameter_hash': parameter_hash,
'softwaretype': gadget.state.software_type,
'restricted_softwaretype': false
}
'json_url': gadget.state.url_string.split('?')[0] + ".json",
'parameter_hash': parameter_hash,
'softwaretype': gadget.state.software_type,
'restricted_softwaretype': false
};
if (gadget.state.shared === 'yes') {
parameter_dict['parameter']['shared'] = true;
parameter_dict['shared'] = true;
}
return result[0].render({
erp5_document: {
......@@ -139,7 +137,7 @@
"your_text_content": {
"description": "",
"title": "Parameters",
"default": parameter_dict,
"default": "",
"css_class": "",
"required": 1,
"editable": 0,
......@@ -147,7 +145,8 @@
"sandbox": "",
"key": "text_content",
"hidden": gadget.state.url_string === "",
"type": "GadgetField"
"type": "GadgetField",
"renderjs_extra": JSON.stringify(parameter_dict)
},
"your_software_type": {
"description": "Software Type",
......@@ -216,4 +215,4 @@
});
});
});
}(window, rJS, RSVP));
\ No newline at end of file
}(window, rJS, RSVP, btoa, JSON));
\ No newline at end of file
......@@ -281,7 +281,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>1004.32728.24062.25344</string> </value>
<value> <string>1010.44012.38164.19575</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -301,7 +301,7 @@
</tuple>
<state>
<tuple>
<float>1669152031.46</float>
<float>1692982452.93</float>
<string>UTC</string>
</tuple>
</state>
......
/*global document, window, Option, rJS, RSVP, Chart, UriTemplate, domsugar */
/*global document, window, rJS, RSVP, Chart, domsugar, JSON */
/*jslint nomen: true, indent: 2, maxerr: 3 */
(function (window, rJS, RSVP, domsugar) {
(function (window, rJS, RSVP, domsugar, JSON) {
"use strict";
var gadget_klass = rJS(window);
gadget_klass
......@@ -20,7 +20,6 @@
.declareAcquiredMethod("getTranslationList", "getTranslationList")
.declareAcquiredMethod("redirect", "redirect")
.declareAcquiredMethod("updateHeader", "updateHeader")
.declareAcquiredMethod("updateConfiguration", "updateConfiguration")
.declareAcquiredMethod("getSetting", "getSetting")
.declareAcquiredMethod("getUrlFor", "getUrlFor")
.declareAcquiredMethod("jio_allDocs", "jio_allDocs")
......@@ -41,7 +40,11 @@
css_class: "",
description: "The Status",
hidden: 0,
"default": {jio_key: value_jio_key, result: value},
default: "",
renderjs_extra: JSON.stringify({
jio_key: value_jio_key,
result: value
}),
key: "status",
url: "gadget_slapos_status.html",
title: "Status",
......@@ -393,4 +396,4 @@
});
});
});
}(window, rJS, RSVP, domsugar));
\ No newline at end of file
}(window, rJS, RSVP, domsugar, JSON));
\ No newline at end of file
......@@ -249,7 +249,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>1004.6436.36702.26948</string> </value>
<value> <string>1010.39708.44914.39287</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -269,7 +269,7 @@
</tuple>
<state>
<tuple>
<float>1668205150.06</float>
<float>1692644993.84</float>
<string>UTC</string>
</tuple>
</state>
......
from zExceptions import Unauthorized
if REQUEST is not None:
raise Unauthorized
return context.getAccessStatus()
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="PythonScript" module="Products.PythonScripts.PythonScript"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_bind_names</string> </key>
<value>
<object>
<klass>
<global name="_reconstructor" module="copy_reg"/>
</klass>
<tuple>
<global name="NameAssignments" module="Shared.DC.Scripts.Bindings"/>
<global name="object" module="__builtin__"/>
<none/>
</tuple>
<state>
<dictionary>
<item>
<key> <string>_asgns</string> </key>
<value>
<dictionary>
<item>
<key> <string>name_container</string> </key>
<value> <string>container</string> </value>
</item>
<item>
<key> <string>name_context</string> </key>
<value> <string>context</string> </value>
</item>
<item>
<key> <string>name_m_self</string> </key>
<value> <string>script</string> </value>
</item>
<item>
<key> <string>name_subpath</string> </key>
<value> <string>traverse_subpath</string> </value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key> <string>_params</string> </key>
<value> <string>REQUEST=None</string> </value>
</item>
<item>
<key> <string>_proxy_roles</string> </key>
<value>
<tuple>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>ComputeNode_getNewsDict</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
......@@ -126,7 +126,7 @@
<dictionary>
<item>
<key> <string>_text</string> </key>
<value> <string>here/ComputeNode_getNewsDict</string> </value>
<value> <string>here/getAccessStatus</string> </value>
</item>
</dictionary>
</pickle>
......
portal_type = context.getPortalType()
if portal_type == "Compute Node":
return context.ComputeNode_getNewsDict(**kw)
return context.getAccessStatus(**kw)
if portal_type == "Instance Tree":
return context.InstanceTree_getNewsDict(**kw)
......
from zExceptions import Unauthorized
if REQUEST is not None:
raise Unauthorized
return context.getAccessStatus()
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="PythonScript" module="Products.PythonScripts.PythonScript"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_bind_names</string> </key>
<value>
<object>
<klass>
<global name="_reconstructor" module="copy_reg"/>
</klass>
<tuple>
<global name="NameAssignments" module="Shared.DC.Scripts.Bindings"/>
<global name="object" module="__builtin__"/>
<none/>
</tuple>
<state>
<dictionary>
<item>
<key> <string>_asgns</string> </key>
<value>
<dictionary>
<item>
<key> <string>name_container</string> </key>
<value> <string>container</string> </value>
</item>
<item>
<key> <string>name_context</string> </key>
<value> <string>context</string> </value>
</item>
<item>
<key> <string>name_m_self</string> </key>
<value> <string>script</string> </value>
</item>
<item>
<key> <string>name_subpath</string> </key>
<value> <string>traverse_subpath</string> </value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key> <string>_params</string> </key>
<value> <string>REQUEST=None</string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>SoftwareInstallation_getNewsDict</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
......@@ -126,7 +126,7 @@
<dictionary>
<item>
<key> <string>_text</string> </key>
<value> <string>here/SoftwareInstallation_getNewsDict</string> </value>
<value> <string>here/getAccessStatus</string> </value>
</item>
</dictionary>
</pickle>
......
......@@ -389,201 +389,6 @@ class TestSoftwareInstance_getNewsDict(TestSlapOSHalJsonStyleMixin):
self.assertEqual(_decode_with_json(news_dict),
_decode_with_json(expected_news_dict))
class TestSoftwareInstallation_getNewsDict(TestSlapOSHalJsonStyleMixin):
def test(self):
installation = self._makeSoftwareInstallation()
self._logFakeAccess(installation)
news_dict = installation.SoftwareInstallation_getNewsDict()
expected_news_dict = {'created_at': self.created_at,
'no_data_since_15_minutes': 0,
'no_data_since_5_minutes': 0,
'portal_type': installation.getPortalType(),
'reference': installation.getReference(),
'since': self.created_at,
'state': 'start_requested',
'text': '#access OK',
'user': 'SlapOS Master'}
self.assertEqual(_decode_with_json(news_dict),
_decode_with_json(expected_news_dict))
def test_stopped(self):
installation = self._makeSoftwareInstallation()
self._logFakeAccess(installation,
state='stop_requested')
news_dict = installation.SoftwareInstallation_getNewsDict()
installation.getSlapState = fakeStopRequestedSlapState
expected_news_dict = {'created_at': self.created_at,
'no_data_since_15_minutes': 0,
'no_data_since_5_minutes': 0,
'portal_type': installation.getPortalType(),
'reference': installation.getReference(),
'since': self.created_at,
'state': 'stop_requested',
'text': '#access OK',
'user': 'SlapOS Master'}
self.assertEqual(_decode_with_json(news_dict),
_decode_with_json(expected_news_dict))
def test_destroyed(self):
installation = self._makeSoftwareInstallation()
self._logFakeAccess(installation,
state='destroy_requested')
news_dict = installation.SoftwareInstallation_getNewsDict()
installation.getSlapState = fakeDestroyRequestedSlapState
expected_news_dict = {'created_at': self.created_at,
'no_data_since_15_minutes': 0,
'no_data_since_5_minutes': 0,
'portal_type': installation.getPortalType(),
'reference': installation.getReference(),
'since': self.created_at,
'state': 'destroy_requested',
'text': '#access OK',
'user': 'SlapOS Master'}
self.assertEqual(_decode_with_json(news_dict),
_decode_with_json(expected_news_dict))
def test_no_data(self):
installation = self._makeSoftwareInstallation()
news_dict = installation.SoftwareInstallation_getNewsDict()
expected_news_dict = {'created_at': self.created_at,
'no_data': 1,
'portal_type': installation.getPortalType(),
'reference': installation.getReference(),
'since': self.created_at,
'state': '',
'text': '#error no data found for %s' % installation.getReference(),
'user': 'SlapOS Master'
}
self.assertEqual(_decode_with_json(news_dict),
_decode_with_json(expected_news_dict))
class TestComputeNode_getNewsDict(TestSlapOSHalJsonStyleMixin):
def test(self):
compute_node = self._makeComputeNode()
self._logFakeAccess(compute_node)
news_dict = compute_node.ComputeNode_getNewsDict()
expected_news_dict = {'created_at': self.created_at,
'no_data_since_15_minutes': 0,
'no_data_since_5_minutes': 0,
'portal_type': compute_node.getPortalType(),
'reference': compute_node.getReference(),
'since': self.created_at,
'state': 'start_requested',
'text': '#access OK',
'user': 'SlapOS Master'}
self.assertEqual(_decode_with_json(news_dict),
_decode_with_json(expected_news_dict))
self.tic()
# Retest so cache is evaludated
news_dict = compute_node.ComputeNode_getNewsDict()
self.assertEqual(_decode_with_json(news_dict),
_decode_with_json(expected_news_dict))
def test_stopped(self):
compute_node = self._makeComputeNode()
self._logFakeAccess(compute_node,
state='stop_requested')
news_dict = compute_node.ComputeNode_getNewsDict()
compute_node.getSlapState = fakeStopRequestedSlapState
expected_news_dict = {'created_at': self.created_at,
'no_data_since_15_minutes': 0,
'no_data_since_5_minutes': 0,
'portal_type': compute_node.getPortalType(),
'reference': compute_node.getReference(),
'since': self.created_at,
'state': 'stop_requested',
'text': '#access OK',
'user': 'SlapOS Master'
}
self.assertEqual(_decode_with_json(news_dict),
_decode_with_json(expected_news_dict))
self.tic()
# Retest so cache is evaludated
news_dict = compute_node.ComputeNode_getNewsDict()
self.assertEqual(_decode_with_json(news_dict),
_decode_with_json(expected_news_dict))
def test_destroyed(self):
compute_node = self._makeComputeNode()
self._logFakeAccess(compute_node,
state='destroy_requested')
news_dict = compute_node.ComputeNode_getNewsDict()
compute_node.getSlapState = fakeDestroyRequestedSlapState
expected_news_dict = {'created_at': self.created_at,
'no_data_since_15_minutes': 0,
'no_data_since_5_minutes': 0,
'portal_type': compute_node.getPortalType(),
'reference': compute_node.getReference(),
'since': self.created_at,
'state': 'destroy_requested',
'text': '#access OK',
'user': 'SlapOS Master'
}
self.assertEqual(_decode_with_json(news_dict),
_decode_with_json(expected_news_dict))
self.tic()
# Retest so cache is evaludated
news_dict = compute_node.ComputeNode_getNewsDict()
self.assertEqual(_decode_with_json(news_dict),
_decode_with_json(expected_news_dict))
def test_no_data(self):
compute_node = self._makeComputeNode()
news_dict = compute_node.ComputeNode_getNewsDict()
expected_news_dict = {'created_at': self.created_at,
'no_data': 1,
'portal_type': compute_node.getPortalType(),
'reference': compute_node.getReference(),
'since': self.created_at,
'state': '',
'text': '#error no data found for %s' % compute_node.getReference(),
'user': 'SlapOS Master'
}
self.assertEqual(_decode_with_json(news_dict),
_decode_with_json(expected_news_dict))
self.tic()
# Retest so cache is evaludated
news_dict = compute_node.ComputeNode_getNewsDict()
self.assertEqual(_decode_with_json(news_dict),
_decode_with_json(expected_news_dict))
def test_with_instance(self):
compute_node = self._makeComputeNode()
instance = self._makeInstance()
instance.setAggregateValue(self.partition0)
self.tic()
self._logFakeAccess(compute_node)
news_dict = compute_node.ComputeNode_getNewsDict()
expected_news_dict = {u'created_at': u'%s' % self.created_at,
'no_data_since_15_minutes': 0,
'no_data_since_5_minutes': 0,
'portal_type': compute_node.getPortalType(),
'reference': compute_node.getReference(),
u'since': u'%s' % self.created_at,
u'state': u'start_requested',
u'text': u'#access OK',
u'user': u'SlapOS Master'
}
self.assertEqual(_decode_with_json(news_dict),
_decode_with_json(expected_news_dict))
self.tic()
# Retest so cache is evaludated
news_dict = compute_node.ComputeNode_getNewsDict()
self.assertEqual(_decode_with_json(news_dict),
_decode_with_json(expected_news_dict))
class TestComputerNetwork_getNewsDict(TestSlapOSHalJsonStyleMixin):
def test(self):
......
......@@ -154,12 +154,12 @@
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//div[contains(@class, 'main-status')]//div[contains(@class, 'ui-btn-ok')]//a[contains(text(), 'Node')]</td>
<td>//div[contains(@class, 'main-status')]//div[contains(@class, 'ui-btn-ok')]//span[contains(text(), 'Node')]</td>
<td></td>
</tr>
<tr>
<td>assertElementPresent</td>
<td>//div[contains(@class, 'main-status')]//div[contains(@class, 'ui-btn-ok')]//a[contains(text(), 'Node')]</td>
<td>//div[contains(@class, 'main-status')]//div[contains(@class, 'ui-btn-ok')]//span[contains(text(), 'Node')]</td>
<td></td>
</tr>
<tr>
......@@ -206,12 +206,12 @@
<tr>
<td>waitForElementPresent</td>
<td>//div[contains(@class, 'main-status')]//div[contains(@class, 'ui-btn-ok')]//a[contains(text(), 'Node')]</td>
<td>//div[contains(@class, 'main-status')]//div[contains(@class, 'ui-btn-ok')]//span[contains(text(), 'Node')]</td>
<td></td>
</tr>
<tr>
<td>assertElementPresent</td>
<td>//div[contains(@class, 'main-status')]//div[contains(@class, 'ui-btn-ok')]//a[contains(text(), 'Node')]</td>
<td>//div[contains(@class, 'main-status')]//div[contains(@class, 'ui-btn-ok')]//span[contains(text(), 'Node')]</td>
<td></td>
</tr>
......@@ -227,12 +227,12 @@
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//td//div[contains(@class, 'main-status')]//div[contains(@class, 'ui-btn-ok')]//a[contains(text(), 'Node')]</td>
<td>//td//div[contains(@class, 'main-status')]//div[contains(@class, 'ui-btn-ok')]//span[contains(text(), 'Node')]</td>
<td></td>
</tr>
<tr>
<td>assertElementPresent</td>
<td>//td//div[contains(@class, 'main-status')]//div[contains(@class, 'ui-btn-ok')]//a[contains(text(), 'Node')]</td>
<td>//td//div[contains(@class, 'main-status')]//div[contains(@class, 'ui-btn-ok')]//span[contains(text(), 'Node')]</td>
<td></td>
</tr>
......
......@@ -224,12 +224,12 @@
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//div[contains(@class, 'main-status')]//div[contains(@class, 'ui-btn-ok')]//a[contains(text(), 'Node')]</td>
<td>//div[contains(@class, 'main-status')]//div[contains(@class, 'ui-btn-ok')]//span[contains(text(), 'Node')]</td>
<td></td>
</tr>
<tr>
<td>assertElementPresent</td>
<td>//div[contains(@class, 'main-status')]//div[contains(@class, 'ui-btn-ok')]//a[contains(text(), 'Node')]</td>
<td>//div[contains(@class, 'main-status')]//div[contains(@class, 'ui-btn-ok')]//span[contains(text(), 'Node')]</td>
<td></td>
</tr>
<tr>
......@@ -245,22 +245,22 @@
<tr>
<td>waitForElementPresent</td>
<td>//div[contains(@class, 'main-status')]//div[contains(@class, 'ui-btn-ok')]//a[contains(text(), 'Node')]</td>
<td>//div[contains(@class, 'main-status')]//div[contains(@class, 'ui-btn-ok')]//span[contains(text(), 'Node')]</td>
<td></td>
</tr>
<tr>
<td>assertElementPresent</td>
<td>//div[contains(@class, 'main-status')]//div[contains(@class, 'ui-btn-ok')]//a[contains(text(), 'Node')]</td>
<td>//div[contains(@class, 'main-status')]//div[contains(@class, 'ui-btn-ok')]//span[contains(text(), 'Node')]</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//div[contains(@class, 'main-status')]//div[contains(@class, 'ui-btn-ok')]//a[contains(text(), 'Available')]</td>
<td>//div[contains(@class, 'main-status')]//div[contains(@class, 'ui-btn-ok')]//span[contains(text(), 'Available')]</td>
<td></td>
</tr>
<tr>
<td>assertElementPresent</td>
<td>//div[contains(@class, 'main-status')]//div[contains(@class, 'ui-btn-ok')]//a[contains(text(), 'Available')]</td>
<td>//div[contains(@class, 'main-status')]//div[contains(@class, 'ui-btn-ok')]//span[contains(text(), 'Available')]</td>
<td></td>
</tr>
<tr>
......@@ -290,12 +290,12 @@
<tr>
<td>waitForElementPresent</td>
<td>//div[contains(@class, 'main-status')]//div[contains(@class, 'ui-btn-ok')]//a[contains(text(), 'Available')]</td>
<td>//div[contains(@class, 'main-status')]//div[contains(@class, 'ui-btn-ok')]//span[contains(text(), 'Available')]</td>
<td></td>
</tr>
<tr>
<td>assertElementPresent</td>
<td>//div[contains(@class, 'main-status')]//div[contains(@class, 'ui-btn-ok')]//a[contains(text(), 'Available')]</td>
<td>//div[contains(@class, 'main-status')]//div[contains(@class, 'ui-btn-ok')]//span[contains(text(), 'Available')]</td>
<td></td>
</tr>
......
......@@ -408,12 +408,12 @@
<tr>
<td>waitForElementPresent</td>
<td>//div[contains(@class, 'main-status')]//div[contains(@class, 'ui-btn-ok')]//a[contains(text(), 'Available')]</td>
<td>//div[contains(@class, 'main-status')]//div[contains(@class, 'ui-btn-ok')]//span[contains(text(), 'Available')]</td>
<td></td>
</tr>
<tr>
<td>assertElementPresent</td>
<td>//div[contains(@class, 'main-status')]//div[contains(@class, 'ui-btn-ok')]//a[contains(text(), 'Available')]</td>
<td>//div[contains(@class, 'main-status')]//div[contains(@class, 'ui-btn-ok')]//span[contains(text(), 'Available')]</td>
<td></td>
</tr>
<tr>
......@@ -443,12 +443,12 @@
<tr>
<td>waitForElementPresent</td>
<td>//div[contains(@class, 'main-status')]//div[contains(@class, 'ui-btn-ok')]//a[contains(text(), 'Available')]</td>
<td>//div[contains(@class, 'main-status')]//div[contains(@class, 'ui-btn-ok')]//span[contains(text(), 'Available')]</td>
<td></td>
</tr>
<tr>
<td>assertElementPresent</td>
<td>//div[contains(@class, 'main-status')]//div[contains(@class, 'ui-btn-ok')]//a[contains(text(), 'Available')]</td>
<td>//div[contains(@class, 'main-status')]//div[contains(@class, 'ui-btn-ok')]//span[contains(text(), 'Available')]</td>
<td></td>
</tr>
......
......@@ -253,22 +253,22 @@
<tr>
<td>waitForElementPresent</td>
<td>//div[contains(@class, 'main-status')]//div[contains(@class, 'ui-btn-color-white')]//a[contains(text(), 'Stopped')]</td>
<td>//div[contains(@class, 'main-status')]//div[contains(@class, 'ui-btn-color-white')]//span[contains(text(), 'Stopped')]</td>
<td></td>
</tr>
<tr>
<td>assertElementPresent</td>
<td>//div[contains(@class, 'main-status')]//div[contains(@class, 'ui-btn-color-white')]//a[contains(text(), 'Stopped')]</td>
<td>//div[contains(@class, 'main-status')]//div[contains(@class, 'ui-btn-color-white')]//span[contains(text(), 'Stopped')]</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//td//div[contains(@class, 'main-status')]//div[contains(@class, 'ui-btn-color-white')]//a[contains(text(), 'Stopped')]</td>
<td>//td//div[contains(@class, 'main-status')]//div[contains(@class, 'ui-btn-color-white')]//span[contains(text(), 'Stopped')]</td>
<td></td>
</tr>
<tr>
<td>assertElementPresent</td>
<td>//td//div[contains(@class, 'main-status')]//div[contains(@class, 'ui-btn-color-white')]//a[contains(text(), 'Stopped')]</td>
<td>//td//div[contains(@class, 'main-status')]//div[contains(@class, 'ui-btn-color-white')]//span[contains(text(), 'Stopped')]</td>
<td></td>
</tr>
......@@ -328,22 +328,22 @@
<tr>
<td>waitForElementPresent</td>
<td>//div[contains(@class, 'main-status')]//div[contains(@class, 'ui-btn-color-white')]//a[contains(text(), 'Destroyed')]</td>
<td>//div[contains(@class, 'main-status')]//div[contains(@class, 'ui-btn-color-white')]//span[contains(text(), 'Destroyed')]</td>
<td></td>
</tr>
<tr>
<td>assertElementPresent</td>
<td>//div[contains(@class, 'main-status')]//div[contains(@class, 'ui-btn-color-white')]//a[contains(text(), 'Destroyed')]</td>
<td>//div[contains(@class, 'main-status')]//div[contains(@class, 'ui-btn-color-white')]//span[contains(text(), 'Destroyed')]</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//td//div[contains(@class, 'main-status')]//div[contains(@class, 'ui-btn-color-white')]//a[contains(text(), 'Destroyed')]</td>
<td>//td//div[contains(@class, 'main-status')]//div[contains(@class, 'ui-btn-color-white')]//span[contains(text(), 'Destroyed')]</td>
<td></td>
</tr>
<tr>
<td>assertElementPresent</td>
<td>//td//div[contains(@class, 'main-status')]//div[contains(@class, 'ui-btn-color-white')]//a[contains(text(), 'Destroyed')]</td>
<td>//td//div[contains(@class, 'main-status')]//div[contains(@class, 'ui-btn-color-white')]//span[contains(text(), 'Destroyed')]</td>
<td></td>
</tr>
......
......@@ -328,12 +328,12 @@
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//div[contains(@class, 'main-status')]//div[contains(@class, 'ui-btn-color-white')]//a[contains(text(), 'Slave Only')]</td>
<td>//div[contains(@class, 'main-status')]//div[contains(@class, 'ui-btn-color-white')]//span[contains(text(), 'Slave Only')]</td>
<td></td>
</tr>
<tr>
<td>assertElementPresent</td>
<td>//div[contains(@class, 'main-status')]//div[contains(@class, 'ui-btn-color-white')]//a[contains(text(), 'Slave Only')]</td>
<td>//div[contains(@class, 'main-status')]//div[contains(@class, 'ui-btn-color-white')]//span[contains(text(), 'Slave Only')]</td>
<td></td>
</tr>
<tr>
......@@ -354,23 +354,23 @@
<tr>
<td>waitForElementPresent</td>
<td>//div[contains(@class, 'main-status')]//div[contains(@class, 'ui-btn-color-white')]//a[contains(text(), 'Slave Only')]</td>
<td>//div[contains(@class, 'main-status')]//div[contains(@class, 'ui-btn-color-white')]//span[contains(text(), 'Slave Only')]</td>
<td></td>
</tr>
<tr>
<td>assertElementPresent</td>
<td>//div[contains(@class, 'main-status')]//div[contains(@class, 'ui-btn-color-white')]//a[contains(text(), 'Slave Only')]</td>
<td>//div[contains(@class, 'main-status')]//div[contains(@class, 'ui-btn-color-white')]//span[contains(text(), 'Slave Only')]</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//td//div[contains(@class, 'main-status')]//div[contains(@class, 'ui-btn-color-white')]//a[contains(text(), 'Slave')]</td>
<td>//td//div[contains(@class, 'main-status')]//div[contains(@class, 'ui-btn-color-white')]//span[contains(text(), 'Slave')]</td>
<td></td>
</tr>
<tr>
<td>assertElementPresent</td>
<td>//td//div[contains(@class, 'main-status')]//div[contains(@class, 'ui-btn-color-white')]//a[contains(text(), 'Slave')]</td>
<td>//td//div[contains(@class, 'main-status')]//div[contains(@class, 'ui-btn-color-white')]//span[contains(text(), 'Slave')]</td>
<td></td>
</tr>
......@@ -390,22 +390,22 @@
</tal:block>
<tr>
<td>waitForElementPresent</td>
<td>//div[contains(@class, 'main-status')]//div[contains(@class, 'ui-btn-color-white')]//a[contains(text(), 'Destroyed')]</td>
<td>//div[contains(@class, 'main-status')]//div[contains(@class, 'ui-btn-color-white')]//span[contains(text(), 'Destroyed')]</td>
<td></td>
</tr>
<tr>
<td>assertElementPresent</td>
<td>//div[contains(@class, 'main-status')]//div[contains(@class, 'ui-btn-color-white')]//a[contains(text(), 'Destroyed')]</td>
<td>//div[contains(@class, 'main-status')]//div[contains(@class, 'ui-btn-color-white')]//span[contains(text(), 'Destroyed')]</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//td//div[contains(@class, 'main-status')]//div[contains(@class, 'ui-btn-color-white')]//a[contains(text(), 'Slave')]</td>
<td>//td//div[contains(@class, 'main-status')]//div[contains(@class, 'ui-btn-color-white')]//span[contains(text(), 'Slave')]</td>
<td></td>
</tr>
<tr>
<td>assertElementPresent</td>
<td>//td//div[contains(@class, 'main-status')]//div[contains(@class, 'ui-btn-color-white')]//a[contains(text(), 'Slave')]</td>
<td>//td//div[contains(@class, 'main-status')]//div[contains(@class, 'ui-btn-color-white')]//span[contains(text(), 'Slave')]</td>
<td></td>
</tr>
......@@ -483,22 +483,22 @@
<tr>
<td>waitForElementPresent</td>
<td>//div[contains(@class, 'main-status')]//div[contains(@class, 'ui-btn-color-white')]//a[contains(text(), 'Destroyed')]</td>
<td>//div[contains(@class, 'main-status')]//div[contains(@class, 'ui-btn-color-white')]//span[contains(text(), 'Destroyed')]</td>
<td></td>
</tr>
<tr>
<td>assertElementPresent</td>
<td>//div[contains(@class, 'main-status')]//div[contains(@class, 'ui-btn-color-white')]//a[contains(text(), 'Destroyed')]</td>
<td>//div[contains(@class, 'main-status')]//div[contains(@class, 'ui-btn-color-white')]//span[contains(text(), 'Destroyed')]</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//td//div[contains(@class, 'main-status')]//div[contains(@class, 'ui-btn-color-white')]//a[contains(text(), 'Destroyed')]</td>
<td>//td//div[contains(@class, 'main-status')]//div[contains(@class, 'ui-btn-color-white')]//span[contains(text(), 'Destroyed')]</td>
<td></td>
</tr>
<tr>
<td>assertElementPresent</td>
<td>//td//div[contains(@class, 'main-status')]//div[contains(@class, 'ui-btn-color-white')]//a[contains(text(), 'Destroyed')]</td>
<td>//td//div[contains(@class, 'main-status')]//div[contains(@class, 'ui-btn-color-white')]//span[contains(text(), 'Destroyed')]</td>
<td></td>
</tr>
......
......@@ -144,12 +144,12 @@
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//div[contains(@class, 'main-status')]//div[contains(@class, 'ui-btn-color-white')]//a[contains(text(), 'Slave Only')]</td>
<td>//div[contains(@class, 'main-status')]//div[contains(@class, 'ui-btn-color-white')]//span[contains(text(), 'Slave Only')]</td>
<td></td>
</tr>
<tr>
<td>assertElementPresent</td>
<td>//div[contains(@class, 'main-status')]//div[contains(@class, 'ui-btn-color-white')]//a[contains(text(), 'Slave Only')]</td>
<td>//div[contains(@class, 'main-status')]//div[contains(@class, 'ui-btn-color-white')]//span[contains(text(), 'Slave Only')]</td>
<td></td>
</tr>
<tr>
......@@ -170,23 +170,23 @@
<tr>
<td>waitForElementPresent</td>
<td>//div[contains(@class, 'main-status')]//div[contains(@class, 'ui-btn-color-white')]//a[contains(text(), 'Slave Only')]</td>
<td>//div[contains(@class, 'main-status')]//div[contains(@class, 'ui-btn-color-white')]//span[contains(text(),'Slave Only')]</td>
<td></td>
</tr>
<tr>
<td>assertElementPresent</td>
<td>//div[contains(@class, 'main-status')]//div[contains(@class, 'ui-btn-color-white')]//a[contains(text(), 'Slave Only')]</td>
<td>//div[contains(@class, 'main-status')]//div[contains(@class, 'ui-btn-color-white')]//span[contains(text(),'Slave Only')]</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//td//div[contains(@class, 'main-status')]//div[contains(@class, 'ui-btn-color-white')]//a[contains(text(), 'Slave')]</td>
<td>//td//div[contains(@class, 'main-status')]//div[contains(@class, 'ui-btn-color-white')]//span[contains(text(),'Slave')]</td>
<td></td>
</tr>
<tr>
<td>assertElementPresent</td>
<td>//td//div[contains(@class, 'main-status')]//div[contains(@class, 'ui-btn-color-white')]//a[contains(text(), 'Slave')]</td>
<td>//td//div[contains(@class, 'main-status')]//div[contains(@class, 'ui-btn-color-white')]//span[contains(text(),'Slave')]</td>
<td></td>
</tr>
......@@ -210,22 +210,22 @@
<tr>
<td>waitForElementPresent</td>
<td>//div[contains(@class, 'main-status')]//div[contains(@class, 'ui-btn-color-white')]//a[contains(text(), 'Stopped')]</td>
<td>//div[contains(@class, 'main-status')]//div[contains(@class, 'ui-btn-color-white')]//span[contains(text(),'Stopped')]</td>
<td></td>
</tr>
<tr>
<td>assertElementPresent</td>
<td>//div[contains(@class, 'main-status')]//div[contains(@class, 'ui-btn-color-white')]//a[contains(text(), 'Stopped')]</td>
<td>//div[contains(@class, 'main-status')]//div[contains(@class, 'ui-btn-color-white')]//span[contains(text(),'Stopped')]</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//td//div[contains(@class, 'main-status')]//div[contains(@class, 'ui-btn-color-white')]//a[contains(text(), 'Slave')]</td>
<td>//td//div[contains(@class, 'main-status')]//div[contains(@class, 'ui-btn-color-white')]//span[contains(text(),'Slave')]</td>
<td></td>
</tr>
<tr>
<td>assertElementPresent</td>
<td>//td//div[contains(@class, 'main-status')]//div[contains(@class, 'ui-btn-color-white')]//a[contains(text(), 'Slave')]</td>
<td>//td//div[contains(@class, 'main-status')]//div[contains(@class, 'ui-btn-color-white')]//span[contains(text(),'Slave')]</td>
<td></td>
</tr>
......@@ -246,22 +246,22 @@
<tr>
<td>waitForElementPresent</td>
<td>//div[contains(@class, 'main-status')]//div[contains(@class, 'ui-btn-color-white')]//a[contains(text(), 'Slave Only')]</td>
<td>//div[contains(@class, 'main-status')]//div[contains(@class, 'ui-btn-color-white')]//span[contains(text(),'Slave Only')]</td>
<td></td>
</tr>
<tr>
<td>assertElementPresent</td>
<td>//div[contains(@class, 'main-status')]//div[contains(@class, 'ui-btn-color-white')]//a[contains(text(), 'Slave Only')]</td>
<td>//div[contains(@class, 'main-status')]//div[contains(@class, 'ui-btn-color-white')]//span[contains(text(),'Slave Only')]</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//td//div[contains(@class, 'main-status')]//div[contains(@class, 'ui-btn-color-white')]//a[contains(text(), 'Slave')]</td>
<td>//td//div[contains(@class, 'main-status')]//div[contains(@class, 'ui-btn-color-white')]//span[contains(text(),'Slave')]</td>
<td></td>
</tr>
<tr>
<td>assertElementPresent</td>
<td>//td//div[contains(@class, 'main-status')]//div[contains(@class, 'ui-btn-color-white')]//a[contains(text(), 'Slave')]</td>
<td>//td//div[contains(@class, 'main-status')]//div[contains(@class, 'ui-btn-color-white')]//span[contains(text(),'Slave')]</td>
<td></td>
</tr>
......@@ -281,22 +281,22 @@
</tal:block>
<tr>
<td>waitForElementPresent</td>
<td>//div[contains(@class, 'main-status')]//div[contains(@class, 'ui-btn-color-white')]//a[contains(text(), 'Destroyed')]</td>
<td>//div[contains(@class, 'main-status')]//div[contains(@class, 'ui-btn-color-white')]//span[contains(text(),'Destroyed')]</td>
<td></td>
</tr>
<tr>
<td>assertElementPresent</td>
<td>//div[contains(@class, 'main-status')]//div[contains(@class, 'ui-btn-color-white')]//a[contains(text(), 'Destroyed')]</td>
<td>//div[contains(@class, 'main-status')]//div[contains(@class, 'ui-btn-color-white')]//span[contains(text(),'Destroyed')]</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//td//div[contains(@class, 'main-status')]//div[contains(@class, 'ui-btn-color-white')]//a[contains(text(), 'Slave')]</td>
<td>//td//div[contains(@class, 'main-status')]//div[contains(@class, 'ui-btn-color-white')]//span[contains(text(),'Slave')]</td>
<td></td>
</tr>
<tr>
<td>assertElementPresent</td>
<td>//td//div[contains(@class, 'main-status')]//div[contains(@class, 'ui-btn-color-white')]//a[contains(text(), 'Slave')]</td>
<td>//td//div[contains(@class, 'main-status')]//div[contains(@class, 'ui-btn-color-white')]//span[contains(text(),'Slave')]</td>
<td></td>
</tr>
......
......@@ -179,23 +179,23 @@
<tr>
<td>waitForElementPresent</td>
<td>//div[contains(@class, 'main-status')]//div[contains(@class, 'ui-btn-ok')]//a[contains(text(), 'Node')]</td>
<td>//div[contains(@class, 'main-status')]//div[contains(@class, 'ui-btn-ok')]//span[contains(text(), 'Node')]</td>
<td></td>
</tr>
<tr>
<td>assertElementPresent</td>
<td>//div[contains(@class, 'main-status')]//div[contains(@class, 'ui-btn-ok')]//a[contains(text(), 'Node')]</td>
<td>//div[contains(@class, 'main-status')]//div[contains(@class, 'ui-btn-ok')]//span[contains(text(), 'Node')]</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//div[contains(@class, 'leaflet-pane')]//div[contains(@class, 'ui-btn-ok')]//a[contains(text(), 'Node')]</td>
<td>//div[contains(@class, 'leaflet-pane')]//div[contains(@class, 'ui-btn-ok')]//span[contains(text(), 'Node')]</td>
<td></td>
</tr>
<tr>
<td>assertElementPresent</td>
<td>//div[contains(@class, 'leaflet-pane')]//div[contains(@class, 'ui-btn-ok')]//a[contains(text(), 'Node')]</td>
<td>//div[contains(@class, 'leaflet-pane')]//div[contains(@class, 'ui-btn-ok')]//span[contains(text(), 'Node')]</td>
<td></td>
</tr>
......@@ -212,34 +212,34 @@
<tr>
<td>waitForElementPresent</td>
<td>//div[contains(@class, 'main-status')]//div[contains(@class, 'ui-btn-ok')]//a[contains(text(), 'Node')]</td>
<td>//div[contains(@class, 'main-status')]//div[contains(@class, 'ui-btn-ok')]//span[contains(text(), 'Node')]</td>
<td></td>
</tr>
<tr>
<td>assertElementPresent</td>
<td>//div[contains(@class, 'main-status')]//div[contains(@class, 'ui-btn-ok')]//a[contains(text(), 'Node')]</td>
<td>//div[contains(@class, 'main-status')]//div[contains(@class, 'ui-btn-ok')]//span[contains(text(), 'Node')]</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//div[contains(@class, 'leaflet-pane')]//div[contains(@class, 'ui-btn-ok')]//a[contains(text(), 'Node')]</td>
<td>//div[contains(@class, 'leaflet-pane')]//div[contains(@class, 'ui-btn-ok')]//span[contains(text(), 'Node')]</td>
<td></td>
</tr>
<tr>
<td>assertElementPresent</td>
<td>//div[contains(@class, 'leaflet-pane')]//div[contains(@class, 'ui-btn-ok')]//a[contains(text(), 'Node')]</td>
<td>//div[contains(@class, 'leaflet-pane')]//div[contains(@class, 'ui-btn-ok')]//span[contains(text(), 'Node')]</td>
<td></td>
</tr>
<!-- Check on listbox -->
<tr>
<td>waitForElementPresent</td>
<td>//td//div[contains(@class, 'main-status')]//div[contains(@class, 'ui-btn-ok')]//a[contains(text(), 'Node')]</td>
<td>//td//div[contains(@class, 'main-status')]//div[contains(@class, 'ui-btn-ok')]//span[contains(text(), 'Node')]</td>
<td></td>
</tr>
<tr>
<td>assertElementPresent</td>
<td>//td//div[contains(@class, 'main-status')]//div[contains(@class, 'ui-btn-ok')]//a[contains(text(), 'Node')]</td>
<td>//td//div[contains(@class, 'main-status')]//div[contains(@class, 'ui-btn-ok')]//span[contains(text(), 'Node')]</td>
<td></td>
</tr>
......
......@@ -65,7 +65,11 @@
<td>//textarea[@name="text_content"]</td>
<td>&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;&lt;instance&gt;&lt;parameter id=&quot;_&quot;&gt;{&quot;simple-string-in-json&quot;: &quot;1024&quot;}&lt;/parameter&gt;&lt;/instance&gt;</td>
</tr>
<tr>
<td>pause</td>
<td>500</td>
<td>500</td>
</tr>
<tal:block metal:use-macro="here/Zuite_SlapOSParameterCommonTemplate/macros/click_proceed_and_wait_for_hash" />
<tr>
......
......@@ -46,7 +46,18 @@
'gadget_erp5_page_slap_parameter_form.html')]//select[@name="software_type"]</td>
<td>Required Example</td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//div[contains(@data-gadget-url,
'gadget_erp5_page_slap_parameter_form.html')]//button[contains(@class, "ui-icon-spinner")]</td>
<td></td>
</tr>
<tr>
<td>waitForElementNotPresent</td>
<td>//div[contains(@data-gadget-url,
'gadget_erp5_page_slap_parameter_form.html')]//button[contains(@class, "ui-icon-spinner")]</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//input[@name="//simple-string" and @type="text"]</td>
......@@ -77,6 +88,12 @@
<td>//select[@name="//simple-string-with-enum"]</td>
<td>simple string B</td>
</tr>
<tr>
<td>fireEvent</td>
<td>//input[@name="//simple-string" and @type="text"]</td>
<td>change</td>
</tr>
<tr>
<td>type</td>
<td>//input[@name="//simple-string" and @type="text"]</td>
......@@ -87,6 +104,11 @@
<td>//select[@name="//simple-string-with-enum"]</td>
<td></td>
</tr>
<tr>
<td>fireEvent</td>
<td>//input[@name="//simple-string" and @type="text"]</td>
<td>change</td>
</tr>
<tr>
<td>fireEvent</td>
<td>//input[@name="//simple-string" and @type="text"]</td>
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment