Commit 5de0c9e7 authored by Alain Takoudjou's avatar Alain Takoudjou

erp5_web_mynij_search: When index is building it appear disabled in search page

parent c278016f
...@@ -67,24 +67,41 @@ ...@@ -67,24 +67,41 @@
}); });
}) })
.push(function () { .push(function () {
//return gadget.state.model_gadget.get_available_indices(); return RSVP.all([gadget.getSetting('index_list', []),
return gadget.getSetting('index_list', []); gadget.getSetting('build_dict', {})]);
}) })
.push(function (results) { .push(function (result_list) {
var add_item = document.createElement("option"), var add_item = document.createElement("option"),
elt,
elt_dict,
option,
has_item,
empty_item; empty_item;
index_list = results; index_list = result_list[0];
while (drop_list.firstChild) { while (drop_list.firstChild) {
drop_list.removeChild(drop_list.firstChild); drop_list.removeChild(drop_list.firstChild);
} }
results.forEach((item, i) => { index_list.forEach((item, i) => {
var option_item = document.createElement("option"); var option_item = document.createElement("option");
option_item.value = item; option_item.value = item;
option_item.appendChild(document.createTextNode(item)); option_item.appendChild(document.createTextNode(item));
drop_list.appendChild(option_item); drop_list.appendChild(option_item);
}); });
if (results.length === 0) { has_item = (index_list.length > 0);
for (elt in result_list[1]) {
elt_dict = result_list[1][elt];
if (!elt_dict.status || elt_dict.status === "not built") {
has_item = true;
option = document.createElement("option");
option.value = elt_dict.index_name;
option.appendChild(
document.createTextNode(elt_dict.index_name + " [Not built]"));
option.disabled = true;
drop_list.appendChild(option);
}
}
if (!has_item) {
empty_item = document.createElement("option"); empty_item = document.createElement("option");
empty_item.style.display = "none"; empty_item.style.display = "none";
drop_list.appendChild(empty_item); drop_list.appendChild(empty_item);
......
...@@ -242,7 +242,7 @@ ...@@ -242,7 +242,7 @@
</item> </item>
<item> <item>
<key> <string>serial</string> </key> <key> <string>serial</string> </key>
<value> <string>994.60872.15715.26112</string> </value> <value> <string>994.61392.62575.19643</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>1632209810.69</float> <float>1632241192.69</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