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

[erp5_web_monitoring] minors fix

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