Commit a1d84489 authored by Boxiang Sun's avatar Boxiang Sun

slapos_jio: Display "Status Unknown" if get status failed

There has an  "onLoop" function in some gadgets which re-render every 5 minutes. In case this refresh fail, an error page is displayed. This commit prevent this gadget fail, by displays "Status Unknown" in the state.
parent d7bf6407
......@@ -112,6 +112,15 @@
})
.push(function (result) {
return getStatus(gadget, result);
})
.push(undefined, function (error) {
gadget.element.innerHTML = inline_status_template({
monitor_url: undefined,
status_class: 'ui-btn-error',
status_title: 'Status Unknown',
status_style: ""
});
return gadget;
});
}
......
......@@ -237,6 +237,7 @@
</item>
</dictionary>
</list>
<none/>
</tuple>
</pickle>
</record>
......@@ -269,7 +270,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>978.25610.31873.42666</string> </value>
<value> <string>980.6847.33689.14199</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -287,7 +288,7 @@
</tuple>
<state>
<tuple>
<float>1568302726.92</float>
<float>1577111849.12</float>
<string>UTC</string>
</tuple>
</state>
......@@ -296,6 +297,7 @@
</item>
</dictionary>
</list>
<none/>
</tuple>
</pickle>
</record>
......@@ -353,6 +355,7 @@
</item>
</dictionary>
</list>
<none/>
</tuple>
</pickle>
</record>
......
......@@ -130,6 +130,15 @@
})
.push(function (result) {
return getStatus(gadget, result);
})
.push(undefined, function (error) {
gadget.element.innerHTML = inline_status_template({
monitor_url: undefined,
status_class: 'ui-btn-error',
status_title: 'Status Unknown',
status_style: ""
});
return gadget;
});
}
......
......@@ -225,6 +225,7 @@
</item>
</dictionary>
</list>
<none/>
</tuple>
</pickle>
</record>
......@@ -243,7 +244,7 @@
</item>
<item>
<key> <string>actor</string> </key>
<value> <string>superrafael</string> </value>
<value> <string>zope</string> </value>
</item>
<item>
<key> <string>comment</string> </key>
......@@ -257,7 +258,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>974.50748.25599.3686</string> </value>
<value> <string>980.44209.10969.41267</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -275,7 +276,7 @@
</tuple>
<state>
<tuple>
<float>1554255778.44</float>
<float>1577114201.29</float>
<string>UTC</string>
</tuple>
</state>
......@@ -284,6 +285,7 @@
</item>
</dictionary>
</list>
<none/>
</tuple>
</pickle>
</record>
......@@ -341,6 +343,7 @@
</item>
</dictionary>
</list>
<none/>
</tuple>
</pickle>
</record>
......
......@@ -45,6 +45,15 @@
status_style: status_style
});
return gadget;
})
.push(undefined, function (error) {
gadget.element.innerHTML = inline_status_template({
monitor_url: undefined,
status_class: 'ui-btn-error',
status_title: 'Status Unknown',
status_style: ""
});
return gadget;
});
}
......
......@@ -225,6 +225,7 @@
</item>
</dictionary>
</list>
<none/>
</tuple>
</pickle>
</record>
......@@ -257,7 +258,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>972.38717.20279.51251</string> </value>
<value> <string>980.6847.33689.14199</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -275,7 +276,7 @@
</tuple>
<state>
<tuple>
<float>1545928626.78</float>
<float>1577111985.28</float>
<string>UTC</string>
</tuple>
</state>
......@@ -284,6 +285,7 @@
</item>
</dictionary>
</list>
<none/>
</tuple>
</pickle>
</record>
......@@ -341,6 +343,7 @@
</item>
</dictionary>
</list>
<none/>
</tuple>
</pickle>
</record>
......
......@@ -86,6 +86,15 @@
})
.push(function (result) {
return getStatus(gadget, result);
})
.push(undefined, function (error) {
gadget.element.innerHTML = inline_status_template({
monitor_url: undefined,
status_class: 'ui-btn-error',
status_title: 'Status Unknown',
status_style: ""
});
return gadget;
});
}
......
......@@ -225,6 +225,7 @@
</item>
</dictionary>
</list>
<none/>
</tuple>
</pickle>
</record>
......@@ -243,7 +244,7 @@
</item>
<item>
<key> <string>actor</string> </key>
<value> <string>superrafael</string> </value>
<value> <string>zope</string> </value>
</item>
<item>
<key> <string>comment</string> </key>
......@@ -257,7 +258,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>974.50363.35694.46455</string> </value>
<value> <string>980.6847.33689.14199</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -275,7 +276,7 @@
</tuple>
<state>
<tuple>
<float>1554236784.11</float>
<float>1577112018.19</float>
<string>UTC</string>
</tuple>
</state>
......@@ -284,6 +285,7 @@
</item>
</dictionary>
</list>
<none/>
</tuple>
</pickle>
</record>
......@@ -341,6 +343,7 @@
</item>
</dictionary>
</list>
<none/>
</tuple>
</pickle>
</record>
......
......@@ -147,6 +147,15 @@
})
.push(function (result) {
return getStatus(gadget, result);
})
.push(undefined, function (error) {
gadget.element.innerHTML = inline_status_template({
monitor_url: undefined,
status_class: 'ui-btn-error',
status_title: 'Status Unknown',
status_style: ""
});
return gadget;
});
}
......
......@@ -225,6 +225,7 @@
</item>
</dictionary>
</list>
<none/>
</tuple>
</pickle>
</record>
......@@ -257,7 +258,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>974.62049.17150.785</string> </value>
<value> <string>980.6847.33689.14199</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -275,7 +276,7 @@
</tuple>
<state>
<tuple>
<float>1555352227.27</float>
<float>1577112055.21</float>
<string>UTC</string>
</tuple>
</state>
......@@ -284,6 +285,7 @@
</item>
</dictionary>
</list>
<none/>
</tuple>
</pickle>
</record>
......@@ -341,6 +343,7 @@
</item>
</dictionary>
</list>
<none/>
</tuple>
</pickle>
</record>
......
......@@ -165,6 +165,15 @@
})
.push(function (result) {
return getStatus(gadget, result);
})
.push(undefined, function (error) {
gadget.element.innerHTML = inline_status_template({
monitor_url: undefined,
status_class: 'ui-btn-error',
status_title: 'Status Unknown',
status_style: ""
});
return gadget;
});
}
......
......@@ -225,6 +225,7 @@
</item>
</dictionary>
</list>
<none/>
</tuple>
</pickle>
</record>
......@@ -257,7 +258,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>978.25609.22500.25258</string> </value>
<value> <string>980.6847.33689.14199</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -275,7 +276,7 @@
</tuple>
<state>
<tuple>
<float>1568302679.29</float>
<float>1577112088.95</float>
<string>UTC</string>
</tuple>
</state>
......@@ -284,6 +285,7 @@
</item>
</dictionary>
</list>
<none/>
</tuple>
</pickle>
</record>
......@@ -341,6 +343,7 @@
</item>
</dictionary>
</list>
<none/>
</tuple>
</pickle>
</record>
......
......@@ -154,6 +154,15 @@
})
.push(function (result) {
return getStatus(gadget, result);
})
.push(undefined, function (error) {
gadget.element.innerHTML = inline_status_template({
monitor_url: undefined,
status_class: 'ui-btn-error',
status_title: 'Status Unknown',
status_style: ""
});
return gadget;
});
}
......
......@@ -236,6 +236,7 @@
</item>
</dictionary>
</list>
<none/>
</tuple>
</pickle>
</record>
......@@ -268,7 +269,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>974.62049.17150.785</string> </value>
<value> <string>980.6847.33689.14199</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -286,7 +287,7 @@
</tuple>
<state>
<tuple>
<float>1555352069.34</float>
<float>1577112140.01</float>
<string>UTC</string>
</tuple>
</state>
......@@ -295,6 +296,7 @@
</item>
</dictionary>
</list>
<none/>
</tuple>
</pickle>
</record>
......@@ -352,6 +354,7 @@
</item>
</dictionary>
</list>
<none/>
</tuple>
</pickle>
</record>
......
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