Commit a9cc0a0e authored by Rafael Monnerat's avatar Rafael Monnerat

slapos_jio: Fix Site/Project/Network view when invoke Computer Status Gadget

The initial "news" information is passed as parameter
parent 1aabfe3f
...@@ -25,16 +25,17 @@ ...@@ -25,16 +25,17 @@
var gadget = this; var gadget = this;
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, value_jio_key, 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("Computer_getNewsDict"))) {
value = result.data.rows[i].id; value_jio_key = result.data.rows[i].id;
result.data.rows[i].value.computer_monitoring_status = { value = result.data.rows[i].value.Computer_getNewsDict;
result.data.rows[i].value.Computer_getNewsDict = {
field_gadget_param : { field_gadget_param : {
css_class: "", css_class: "",
description: "The Status", description: "The Status",
hidden: 0, hidden: 0,
"default": {jio_key: value}, "default": {jio_key: value, result: value},
key: "status", key: "status",
url: "gadget_slapos_computer_status.html", url: "gadget_slapos_computer_status.html",
title: "Status", title: "Status",
...@@ -92,7 +93,7 @@ ...@@ -92,7 +93,7 @@
['title', 'Title'], ['title', 'Title'],
['reference', 'Reference'], ['reference', 'Reference'],
['allocation_scope_translated_title', 'Allocation Scope'], ['allocation_scope_translated_title', 'Allocation Scope'],
['computer_monitoring_status', 'Status'] ['Computer_getNewsDict', 'Status']
]; ];
return form_gadget.render({ return form_gadget.render({
erp5_document: { erp5_document: {
......
...@@ -230,7 +230,7 @@ ...@@ -230,7 +230,7 @@
</item> </item>
<item> <item>
<key> <string>serial</string> </key> <key> <string>serial</string> </key>
<value> <string>972.34309.59418.7099</string> </value> <value> <string>974.29154.30429.60091</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>1552959507.85</float> <float>1554310335.73</float>
<string>UTC</string> <string>UTC</string>
</tuple> </tuple>
</state> </state>
......
...@@ -257,7 +257,7 @@ ...@@ -257,7 +257,7 @@
</item> </item>
<item> <item>
<key> <string>serial</string> </key> <key> <string>serial</string> </key>
<value> <string>972.38762.9625.45482</string> </value> <value> <string>974.50679.18778.20650</string> </value>
</item> </item>
<item> <item>
<key> <string>state</string> </key> <key> <string>state</string> </key>
...@@ -275,7 +275,7 @@ ...@@ -275,7 +275,7 @@
</tuple> </tuple>
<state> <state>
<tuple> <tuple>
<float>1545932477.94</float> <float>1554258070.92</float>
<string>UTC</string> <string>UTC</string>
</tuple> </tuple>
</state> </state>
......
...@@ -26,16 +26,17 @@ ...@@ -26,16 +26,17 @@
var gadget = this; var gadget = this;
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, value_jio_key, 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("Computer_getNewsDict"))) {
value = result.data.rows[i].id; value_jio_key = result.data.rows[i].id;
result.data.rows[i].value.computer_monitoring_status = { value = result.data.rows[i].value.Computer_getNewsDict;
result.data.rows[i].value.Computer_getNewsDict = {
field_gadget_param : { field_gadget_param : {
css_class: "", css_class: "",
description: "The Status", description: "The Status",
hidden: 0, hidden: 0,
"default": {jio_key: value}, "default": {jio_key: value, result: value},
key: "status", key: "status",
url: "gadget_slapos_computer_status.html", url: "gadget_slapos_computer_status.html",
title: "Status", title: "Status",
...@@ -95,7 +96,7 @@ ...@@ -95,7 +96,7 @@
var column_list = [ var column_list = [
['title', 'Title'], ['title', 'Title'],
['reference', 'Reference'], ['reference', 'Reference'],
['computer_monitoring_status', 'Status'] ['Computer_getNewsDict', 'Status']
]; ];
return result[0].render({ return result[0].render({
erp5_document: { erp5_document: {
......
...@@ -230,7 +230,7 @@ ...@@ -230,7 +230,7 @@
</item> </item>
<item> <item>
<key> <string>serial</string> </key> <key> <string>serial</string> </key>
<value> <string>972.34312.53410.25173</string> </value> <value> <string>974.29134.59085.11229</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>1552958334.09</float> <float>1554310309.89</float>
<string>UTC</string> <string>UTC</string>
</tuple> </tuple>
</state> </state>
......
...@@ -26,16 +26,17 @@ ...@@ -26,16 +26,17 @@
var gadget = this; var gadget = this;
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, value_jio_key, 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("Computer_getNewsDict"))) {
value = result.data.rows[i].id; value_jio_key = result.data.rows[i].id;
result.data.rows[i].value.computer_monitoring_status = { value = result.data.rows[i].value.Computer_getNewsDict;
result.data.rows[i].value.Computer_getNewsDict = {
field_gadget_param : { field_gadget_param : {
css_class: "", css_class: "",
description: "The Status", description: "The Status",
hidden: 0, hidden: 0,
"default": {jio_key: value}, "default": {jio_key: value, result: value},
key: "status", key: "status",
url: "gadget_slapos_computer_status.html", url: "gadget_slapos_computer_status.html",
title: "Status", title: "Status",
...@@ -95,7 +96,7 @@ ...@@ -95,7 +96,7 @@
var column_list = [ var column_list = [
['title', 'Title'], ['title', 'Title'],
['reference', 'Reference'], ['reference', 'Reference'],
['computer_monitoring_status', 'Status'] ['Computer_getNewsDict', 'Status']
]; ];
return result[0].render({ return result[0].render({
erp5_document: { erp5_document: {
......
...@@ -241,7 +241,7 @@ ...@@ -241,7 +241,7 @@
</item> </item>
<item> <item>
<key> <string>serial</string> </key> <key> <string>serial</string> </key>
<value> <string>972.34312.19568.358</string> </value> <value> <string>974.29152.50153.14045</string> </value>
</item> </item>
<item> <item>
<key> <string>state</string> </key> <key> <string>state</string> </key>
...@@ -259,7 +259,7 @@ ...@@ -259,7 +259,7 @@
</tuple> </tuple>
<state> <state>
<tuple> <tuple>
<float>1552959405.91</float> <float>1554310275.02</float>
<string>UTC</string> <string>UTC</string>
</tuple> </tuple>
</state> </state>
......
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