Commit 4ab3d134 authored by Alain Takoudjou's avatar Alain Takoudjou

[erp5_web_monitoring] minors fix

parent 7f618b56
......@@ -45,11 +45,13 @@
if (state) {
return gadget.notifySubmitting()
.push(function () {
var verify_opml = doc.title === "" || doc.title === undefined ||
doc.verify_password === 1;
if (gadget.state.active === false && doc.active === 1) {
verify_opml = true;
}
doc.title = gadget.state.opml_title;
return opml_gadget.saveOPML(
doc,
doc.title === "" || doc.title === undefined || doc.verify_password === 1
);
return opml_gadget.saveOPML(doc, verify_opml);
})
.push(function (status) {
var msg = {message: 'Document Updated', status: 'success'};
......@@ -84,7 +86,8 @@
return gadget.changeState({
"opml_title": doc.title || "",
"opml_key": options.jio_key,
"password": doc.password
"password": doc.password,
"active": doc.active
});
})
.push(function () {
......
......@@ -250,7 +250,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>965.41380.57960.56268</string> </value>
<value> <string>965.42338.34743.44339</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -268,7 +268,7 @@
</tuple>
<state>
<tuple>
<float>1519168458.29</float>
<float>1519225208.75</float>
<string>UTC</string>
</tuple>
</state>
......
......@@ -147,7 +147,8 @@
username: doc.username,
password: doc.password,
active: (doc.active === 1) ? true : false,
has_monitor: true
has_monitor: true,
state: doc.state || (doc.active ? "Started" : "Stopped")
},
update_password_list = [];
gadget.state.message.textContent = "";
......@@ -299,7 +300,6 @@
opml_dict.basic_login =
btoa(doc.username + ':' + doc.new_password);
opml_dict.password = doc.new_password;
opml_dict.state = "Started";
return true;
});
});
......@@ -308,6 +308,8 @@
return new RSVP.Queue()
.push(function () {
if (verify_password) {
// if verification pass -> instance is started
opml_dict.state = "Started";
return validateOPML();
}
return true;
......
......@@ -242,7 +242,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>965.41362.25057.37034</string> </value>
<value> <string>965.42325.2049.64307</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -260,7 +260,7 @@
</tuple>
<state>
<tuple>
<float>1519166629.53</float>
<float>1519224835.75</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