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 @@
'json_url': gadget.state.doc.url_string + ".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>'),
'restricted_softwaretype': false
'restricted_softwaretype': true
}
};
if (gadget.state.doc.text_content !== undefined) {
......@@ -258,12 +258,12 @@
"title": "Monitoring Status",
"default": {jio_key: gadget.state.jio_key},
"css_class": "",
"required": 1,
"required": 0,
"editable": 0,
"url": "gadget_slapos_hosting_subscription_status.html",
"sandbox": "",
"key": "monitoring_status",
"hidden": 0,
"hidden": gadget.state.doc.root_slave === 1,
"type": "GadgetField"
},
"connection_listbox": {
......
......@@ -230,7 +230,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>965.44227.32901.2286</string> </value>
<value> <string>965.44973.60841.22613</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -248,7 +248,7 @@
</tuple>
<state>
<tuple>
<float>1519338633.06</float>
<float>1519383466.28</float>
<string>UTC</string>
</tuple>
</state>
......
......@@ -14,22 +14,26 @@
.allowPublicAcquisition("jio_allDocs", function (param_list) {
var gadget = this;
param_list[0].select_list = ["uid", "title", "short_title",
"root_slave"];
return gadget.jio_allDocs(param_list[0])
.push(function (result) {
var i, value, len = result.data.total_rows;
for (i = 0; i < len; i += 1) {
if (1 || (result.data.rows[i].hasOwnProperty("id"))) {
value = result.data.rows[i].id;
result.data.rows[i].value.monitoring_status = {
css_class: "",
description: "The Status",
hidden: 0,
"default": {jio_key: value},
key: "status",
url: "gadget_slapos_hosting_subscription_status.html",
title: "Status",
type: "GadgetField"
};
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;
result.data.rows[i].value.monitoring_status = {
css_class: "",
description: "The Status",
hidden: 0,
"default": {jio_key: value},
key: "status",
url: "gadget_slapos_hosting_subscription_status.html",
title: "Status",
type: "GadgetField"
};
}
result.data.rows[i].value["listbox_uid:list"] = {
key: "listbox_uid:list",
value: 2713
......
......@@ -230,7 +230,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>965.32073.59962.58726</string> </value>
<value> <string>965.44966.12689.42274</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -248,7 +248,7 @@
</tuple>
<state>
<tuple>
<float>1519374136.68</float>
<float>1519382877.31</float>
<string>UTC</string>
</tuple>
</state>
......
......@@ -103,6 +103,7 @@
<string>my_news</string>
<string>my_short_title</string>
<string>my_description</string>
<string>my_root_slave</string>
</list>
</value>
</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