Commit c9630e9f authored by Romain Courteaud's avatar Romain Courteaud

erp5_web_monitoring: break a rendering infinite loop

The real issue is probably in the launcher.js file, but it is more tricky to fix
parent 5f4bf97c
......@@ -463,7 +463,7 @@
return getMonitorSetting(gadget);
})
.push(function (configuration_dict) {
return gadget.changeState({
return gadget.deferChangeState({
options: options,
is_exporter: is_exporter,
config: JSON.stringify(configuration_dict),
......@@ -473,7 +473,7 @@
});
}
return gadget.changeState({
return gadget.deferChangeState({
options: options,
is_exporter: is_exporter,
config: "",
......@@ -482,6 +482,12 @@
storage_url: options.url
});
})
.declareJob('deferChangeState', function deferStateChange(state) {
// onStateChange does too many things (notification, ajax, redirect)
// which leads to infinite rendering loop currently
// Break this by decoupling all those things from render
return this.changeState(state);
})
.onStateChange(function () {
var gadget = this;
if (gadget.state.options === "") {
......
......@@ -79,7 +79,9 @@
</item>
<item>
<key> <string>content_type</string> </key>
<value> <string>text/javascript</string> </value>
<value>
<none/>
</value>
</item>
<item>
<key> <string>default_reference</string> </key>
......@@ -256,7 +258,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>967.60730.33169.16435</string> </value>
<value> <string>994.35342.36450.46984</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -274,7 +276,7 @@
</tuple>
<state>
<tuple>
<float>1530700819.45</float>
<float>1630678427.22</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