Commit a2bccd78 authored by Alain Takoudjou's avatar Alain Takoudjou Committed by Rafael Monnerat

[erp5_web_monitoring] show desactivated instance in monitor opml list

parent 4164fc66
...@@ -19,7 +19,7 @@ ...@@ -19,7 +19,7 @@
function getMonitorSetting(gadget) { function getMonitorSetting(gadget) {
return gadget.jio_allDocs({ return gadget.jio_allDocs({
select_list: ["basic_login", "url", "title", "active"], select_list: ["basic_login", "url", "title", "active", "state"],
query: '(portal_type:"opml")' query: '(portal_type:"opml")'
}) })
.push(function (opml_result) { .push(function (opml_result) {
...@@ -61,6 +61,11 @@ ...@@ -61,6 +61,11 @@
"description": "OPML active state", "description": "OPML active state",
"type": "boolean", "type": "boolean",
"default": true "default": true
},
"state": {
"description": "OPML requested state",
"type": "string",
"default": "Started"
} }
}, },
"additionalProperties": false "additionalProperties": false
...@@ -188,8 +193,11 @@ ...@@ -188,8 +193,11 @@
item = { item = {
title: configuration_dict.opml_description[i].title, title: configuration_dict.opml_description[i].title,
url: configuration_dict.opml_description[i].href, url: configuration_dict.opml_description[i].href,
active: true, active: configuration_dict.opml_description[i].active,
portal_type: "opml" portal_type: "opml",
has_monitor: configuration_dict.opml_description[i]
.href.startsWith("https://"),
state: configuration_dict.opml_description[i].state || "Started"
}; };
for (j = 0; j < configuration_dict.monitor_url.length; j += 1) { for (j = 0; j < configuration_dict.monitor_url.length; j += 1) {
if (configuration_dict.monitor_url[j].parent_url === if (configuration_dict.monitor_url[j].parent_url ===
...@@ -216,6 +224,8 @@ ...@@ -216,6 +224,8 @@
cred_list = atob(item.basic_login).split(':'); cred_list = atob(item.basic_login).split(':');
item.username = cred_list[0]; item.username = cred_list[0];
item.password = cred_list[1]; item.password = cred_list[1];
item.has_monitor = item.url.startsWith("https://");
item.state = item.state || "Started";
pushSetting(item.url, item); pushSetting(item.url, item);
} }
} }
......
...@@ -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.42096.47763.27016</string> </value> <value> <string>965.42470.47064.30003</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>1519210888.89</float> <float>1519233144.55</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