Commit 7d62c0f6 authored by Romain Courteaud's avatar Romain Courteaud 🐙

slapos_jio: disable gadget status onLoop

Instead of jio.get, the paramers must provide the url to query,
otherwise, it is not possible to use this gadget in the full ERP5JS
parent 5183e63e
......@@ -128,7 +128,6 @@
}
function getStatus(gadget, result) {
var status_class = 'ui-btn-no-data',
right_class = 'ui-btn-no-data',
main_status_div = gadget.element.querySelector(".main-status"),
......@@ -241,17 +240,19 @@
return {};
})
<<<<<<< HEAD
<<<<<<< HEAD
=======
=======
/* XXX disabled for now. Gadget parameters must provide
the url to query again to fetch updated data
>>>>>>> 9d616e9df (slapos_jio: disable gadget status onLoop)
.onLoop(function () {
console.log('status onloop');
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) {
console.log('status after get', result);
var state_dict = result.news || {};
state_dict.jio_key = gadget.state.jio_key;
return gadget.changeState(state_dict);
......@@ -262,14 +263,15 @@
JSON.stringify(gadget.state.jio_key)
);
}, 300000)
*/
>>>>>>> 671d73395 (slapos_jio/panel: restore status gadget first rendering)
.onStateChange(function () {
console.log('status getStatus');
return getStatus(this, this.state);
})
.declareMethod("render", function (options) {
<<<<<<< HEAD
<<<<<<< HEAD
// crash as soon as possible to detect wrong configuration
if (!(options.hasOwnProperty('jio_key') &&
......@@ -280,6 +282,8 @@
}
=======
console.log('status render', options);
=======
>>>>>>> 9d616e9df (slapos_jio: disable gadget status onLoop)
// crash as soon as possible to detect wrong configuration
if (!(options.hasOwnProperty('jio_key') &&
......@@ -297,5 +301,8 @@
return this.changeState(state_dict);
});
<<<<<<< HEAD
=======
>>>>>>> 9d616e9df (slapos_jio: disable gadget status onLoop)
}(window, rJS, domsugar));
\ No newline at end of file
......@@ -278,7 +278,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>1010.24757.23775.49783</string> </value>
<value> <string>1010.24775.45627.23261</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -298,7 +298,7 @@
</tuple>
<state>
<tuple>
<float>1691747920.75</float>
<float>1691748972.83</float>
<string>UTC</string>
</tuple>
</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