Commit 86779556 authored by Rafael Monnerat's avatar Rafael Monnerat

slapos_jio: Hide monitor status for Slave Only Hosting Subscriptions

Current design don't allow us to know the precise status of a slave, part of another software instance.

This commit don't render the Monitor Gadget if the Hosting Subscriptions contains only Slaves.
parent 8f9fda6c
...@@ -150,7 +150,7 @@ ...@@ -150,7 +150,7 @@
'json_url': gadget.state.doc.url_string + ".json", 'json_url': gadget.state.doc.url_string + ".json",
//'json_url': "https://lab.node.vifib.com/nexedi/slapos/raw/master/software/kvm/software.cfg.json", //'json_url': "https://lab.node.vifib.com/nexedi/slapos/raw/master/software/kvm/software.cfg.json",
'parameter_hash': btoa('<?xml version="1.0" encoding="utf-8" ?><instance></instance>'), 'parameter_hash': btoa('<?xml version="1.0" encoding="utf-8" ?><instance></instance>'),
'restricted_softwaretype': false 'restricted_softwaretype': true
} }
}; };
if (gadget.state.doc.text_content !== undefined) { if (gadget.state.doc.text_content !== undefined) {
...@@ -258,12 +258,12 @@ ...@@ -258,12 +258,12 @@
"title": "Monitoring Status", "title": "Monitoring Status",
"default": {jio_key: gadget.state.jio_key}, "default": {jio_key: gadget.state.jio_key},
"css_class": "", "css_class": "",
"required": 1, "required": 0,
"editable": 0, "editable": 0,
"url": "gadget_slapos_hosting_subscription_status.html", "url": "gadget_slapos_hosting_subscription_status.html",
"sandbox": "", "sandbox": "",
"key": "monitoring_status", "key": "monitoring_status",
"hidden": 0, "hidden": gadget.state.doc.root_slave === 1,
"type": "GadgetField" "type": "GadgetField"
}, },
"connection_listbox": { "connection_listbox": {
......
...@@ -230,7 +230,7 @@ ...@@ -230,7 +230,7 @@
</item> </item>
<item> <item>
<key> <string>serial</string> </key> <key> <string>serial</string> </key>
<value> <string>965.44227.32901.2286</string> </value> <value> <string>965.44973.60841.22613</string> </value>
</item> </item>
<item> <item>
<key> <string>state</string> </key> <key> <string>state</string> </key>
...@@ -248,7 +248,7 @@ ...@@ -248,7 +248,7 @@
</tuple> </tuple>
<state> <state>
<tuple> <tuple>
<float>1519338633.06</float> <float>1519383466.28</float>
<string>UTC</string> <string>UTC</string>
</tuple> </tuple>
</state> </state>
......
...@@ -14,11 +14,14 @@ ...@@ -14,11 +14,14 @@
.allowPublicAcquisition("jio_allDocs", function (param_list) { .allowPublicAcquisition("jio_allDocs", function (param_list) {
var gadget = this; var gadget = this;
param_list[0].select_list = ["uid", "title", "short_title",
"root_slave"];
return gadget.jio_allDocs(param_list[0]) return gadget.jio_allDocs(param_list[0])
.push(function (result) { .push(function (result) {
var i, value, len = result.data.total_rows; var i, value, len = result.data.total_rows;
for (i = 0; i < len; i += 1) { for (i = 0; i < len; i += 1) {
if (1 || (result.data.rows[i].hasOwnProperty("id"))) { if (1 || (result.data.rows[i].value.hasOwnProperty("root_slave"))) {
if (result.data.rows[i].value.root_slave !== 1) {
value = result.data.rows[i].id; value = result.data.rows[i].id;
result.data.rows[i].value.monitoring_status = { result.data.rows[i].value.monitoring_status = {
css_class: "", css_class: "",
...@@ -30,6 +33,7 @@ ...@@ -30,6 +33,7 @@
title: "Status", title: "Status",
type: "GadgetField" type: "GadgetField"
}; };
}
result.data.rows[i].value["listbox_uid:list"] = { result.data.rows[i].value["listbox_uid:list"] = {
key: "listbox_uid:list", key: "listbox_uid:list",
value: 2713 value: 2713
......
...@@ -230,7 +230,7 @@ ...@@ -230,7 +230,7 @@
</item> </item>
<item> <item>
<key> <string>serial</string> </key> <key> <string>serial</string> </key>
<value> <string>965.32073.59962.58726</string> </value> <value> <string>965.44966.12689.42274</string> </value>
</item> </item>
<item> <item>
<key> <string>state</string> </key> <key> <string>state</string> </key>
...@@ -248,7 +248,7 @@ ...@@ -248,7 +248,7 @@
</tuple> </tuple>
<state> <state>
<tuple> <tuple>
<float>1519374136.68</float> <float>1519382877.31</float>
<string>UTC</string> <string>UTC</string>
</tuple> </tuple>
</state> </state>
......
...@@ -103,6 +103,7 @@ ...@@ -103,6 +103,7 @@
<string>my_news</string> <string>my_news</string>
<string>my_short_title</string> <string>my_short_title</string>
<string>my_description</string> <string>my_description</string>
<string>my_root_slave</string>
</list> </list>
</value> </value>
</item> </item>
......
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