Commit 7f618b56 authored by Alain Takoudjou's avatar Alain Takoudjou

[erp5_web_monitoring] minor fixes, sort status on hosting subscription is not working well yet

parent 638fa47f
...@@ -9,7 +9,6 @@ ...@@ -9,7 +9,6 @@
// optimized way to fetch hosting subscription list // optimized way to fetch hosting subscription list
var hosting_dict = {}, var hosting_dict = {},
instance_dict = {}, instance_dict = {},
sort_status_dict = {},
compare_function, compare_function,
total_rows = 0; total_rows = 0;
return gadget.jio_allDocs(filter) return gadget.jio_allDocs(filter)
...@@ -81,16 +80,21 @@ ...@@ -81,16 +80,21 @@
} }
} }
if (status_sort !== undefined) { if (status_sort !== undefined) {
if (status_sort === "ascending") { compare_function = function (first, second) {
compare_function = function (first, second) { first = first.toUpperCase();
return first > second; second = second.toUpperCase();
}; if (first > second) {
} else { return 1;
compare_function = function (first, second) { }
return first <= second; if (first < second) {
}; return -1;
} }
return 0;
};
row_list.sort(function (a, b) { row_list.sort(function (a, b) {
if (status_sort === "ascending") {
return compare_function(b.value.status, a.value.status);
}
return compare_function(a.value.status, b.value.status); return compare_function(a.value.status, b.value.status);
}); });
} }
...@@ -119,10 +123,10 @@ ...@@ -119,10 +123,10 @@
.allowPublicAcquisition("jio_allDocs", function (param_list) { .allowPublicAcquisition("jio_allDocs", function (param_list) {
var gadget = this, var gadget = this,
status_sort, status_sort,
i; j;
for (i = 0; i < param_list[0].sort_on.length; i += 1) { for (j = 0; j < param_list[0].sort_on.length; j += 1) {
if (param_list[0].sort_on[i][0] === 'status') { if (param_list[0].sort_on[j][0] === 'status') {
status_sort = param_list[0].sort_on[i][1]; status_sort = param_list[0].sort_on[j][1];
} }
} }
return getHostingData(gadget, param_list[0], status_sort) return getHostingData(gadget, param_list[0], status_sort)
...@@ -223,11 +227,12 @@ ...@@ -223,11 +227,12 @@
"list_method": "portal_catalog", "list_method": "portal_catalog",
"query": "urn:jio:allDocs?query=%28portal_type%3A%22" + "query": "urn:jio:allDocs?query=%28portal_type%3A%22" +
"opml" + "%22%29AND%28active%3A%22" + "opml" + "%22%29AND%28active%3A%22" +
"true" + "%22%29", "true" + "%22%29AND%28url%3A%22" +
"https://%25%22%29",
"portal_type": [], "portal_type": [],
"search_column_list": [['status', 'Status'], ['title', 'Hosting Subscription']], "search_column_list": [['status', 'Status'], ['title', 'Hosting Subscription']],
"sort_column_list": [['status', 'Status'], ['title', 'Hosting Subscription']], "sort_column_list": [['title', 'Hosting Subscription']],
"sort": [['status', 'ascending']], "sort": [['title', 'ascending']],
"title": "Hosting Subscriptions", "title": "Hosting Subscriptions",
"command": "index", "command": "index",
"type": "ListBox" "type": "ListBox"
......
...@@ -239,7 +239,7 @@ ...@@ -239,7 +239,7 @@
</item> </item>
<item> <item>
<key> <string>serial</string> </key> <key> <string>serial</string> </key>
<value> <string>964.27055.25870.4130</string> </value> <value> <string>965.42290.3299.27938</string> </value>
</item> </item>
<item> <item>
<key> <string>state</string> </key> <key> <string>state</string> </key>
...@@ -257,7 +257,7 @@ ...@@ -257,7 +257,7 @@
</tuple> </tuple>
<state> <state>
<tuple> <tuple>
<float>1514376211.14</float> <float>1519222382.45</float>
<string>UTC</string> <string>UTC</string>
</tuple> </tuple>
</state> </state>
......
...@@ -347,7 +347,7 @@ ...@@ -347,7 +347,7 @@
.title, .title,
relative_url: hosting_subscription_list[uid_dict[tmp_uid]] relative_url: hosting_subscription_list[uid_dict[tmp_uid]]
.relative_url, .relative_url,
url: tmp_parameter.opml_url || String(tmp_uid), url: tmp_parameter.opml_url || String(tmp_uid) + " NO MONITOR",
has_monitor: tmp_parameter.opml_url !== undefined, has_monitor: tmp_parameter.opml_url !== undefined,
username: tmp_parameter.username, username: tmp_parameter.username,
password: tmp_parameter.password, password: tmp_parameter.password,
...@@ -550,7 +550,7 @@ ...@@ -550,7 +550,7 @@
return gadget.state.erp5_gadget.createJio(); return gadget.state.erp5_gadget.createJio();
}) })
.push(function () { .push(function () {
return gadget.getSetting('opml_import_limit', 100); return gadget.getSetting('opml_import_limit', 300);
}) })
.push(function (select_limit) { .push(function (select_limit) {
return getInstanceOPMLListFromMaster(gadget, select_limit); return getInstanceOPMLListFromMaster(gadget, select_limit);
......
...@@ -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.40786.41275.23108</string> </value> <value> <string>965.42096.47763.27016</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>1519166104.03</float> <float>1519210888.89</float>
<string>UTC</string> <string>UTC</string>
</tuple> </tuple>
</state> </state>
......
...@@ -108,7 +108,7 @@ ...@@ -108,7 +108,7 @@
<item> <item>
<key> <string>text_content</string> </key> <key> <string>text_content</string> </key>
<value> <string>CACHE MANIFEST\n <value> <string>CACHE MANIFEST\n
# generated on Fri, 09 Jan 2018 10:26:43 +0000\n # generated on Fri, 21 Fev 2018 10:37:42 +0000\n
# XXX + fonts\n # XXX + fonts\n
# images/ajax-loader.gif\n # images/ajax-loader.gif\n
CACHE:\n CACHE:\n
...@@ -387,7 +387,7 @@ NETWORK:\n ...@@ -387,7 +387,7 @@ NETWORK:\n
</item> </item>
<item> <item>
<key> <string>serial</string> </key> <key> <string>serial</string> </key>
<value> <string>965.41395.56200.9676</string> </value> <value> <string>965.42293.15886.45994</string> </value>
</item> </item>
<item> <item>
<key> <string>state</string> </key> <key> <string>state</string> </key>
...@@ -405,7 +405,7 @@ NETWORK:\n ...@@ -405,7 +405,7 @@ NETWORK:\n
</tuple> </tuple>
<state> <state>
<tuple> <tuple>
<float>1519208317.97</float> <float>1519222522.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