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 @@ ...@@ -463,7 +463,7 @@
return getMonitorSetting(gadget); return getMonitorSetting(gadget);
}) })
.push(function (configuration_dict) { .push(function (configuration_dict) {
return gadget.changeState({ return gadget.deferChangeState({
options: options, options: options,
is_exporter: is_exporter, is_exporter: is_exporter,
config: JSON.stringify(configuration_dict), config: JSON.stringify(configuration_dict),
...@@ -473,7 +473,7 @@ ...@@ -473,7 +473,7 @@
}); });
} }
return gadget.changeState({ return gadget.deferChangeState({
options: options, options: options,
is_exporter: is_exporter, is_exporter: is_exporter,
config: "", config: "",
...@@ -482,6 +482,12 @@ ...@@ -482,6 +482,12 @@
storage_url: options.url 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 () { .onStateChange(function () {
var gadget = this; var gadget = this;
if (gadget.state.options === "") { if (gadget.state.options === "") {
......
...@@ -79,7 +79,9 @@ ...@@ -79,7 +79,9 @@
</item> </item>
<item> <item>
<key> <string>content_type</string> </key> <key> <string>content_type</string> </key>
<value> <string>text/javascript</string> </value> <value>
<none/>
</value>
</item> </item>
<item> <item>
<key> <string>default_reference</string> </key> <key> <string>default_reference</string> </key>
...@@ -256,7 +258,7 @@ ...@@ -256,7 +258,7 @@
</item> </item>
<item> <item>
<key> <string>serial</string> </key> <key> <string>serial</string> </key>
<value> <string>967.60730.33169.16435</string> </value> <value> <string>994.35342.36450.46984</string> </value>
</item> </item>
<item> <item>
<key> <string>state</string> </key> <key> <string>state</string> </key>
...@@ -274,7 +276,7 @@ ...@@ -274,7 +276,7 @@
</tuple> </tuple>
<state> <state>
<tuple> <tuple>
<float>1530700819.45</float> <float>1630678427.22</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