Commit ed8e1471 authored by Rafael Monnerat's avatar Rafael Monnerat

slapos_jio: Consistenly display partition state in case computer is down or unreacheable

If computer all computers is down (red/no data), there is no meaning in calculate partition state, as all should be broken.

There are cases where you 'just' stop cron, so machines are acually reacheable, but I prefer consider it "broken" as the updates are not occuring on the machine.
parent c05fc1c9
......@@ -75,12 +75,15 @@
right_style = '';
status_class = checkComputerStatus({news: result.news.computer});
right_class = checkComputerPartitionStatus({computer_partition_news: result.news.partition});
if ((status_class === 'ui-btn-error') ||
(status_class === 'ui-btn-no-data')) {
right_class = status_class;
} else {
right_class = checkComputerPartitionStatus(
{computer_partition_news: result.news.partition});
}
monitor_url = 'https://monitor.app.officejs.com/#/?page=ojsm_dispatch&query=portal_type%3A%22Software%20Instance%22%20AND%20aggregate_reference%3A%22' + result.reference + '%22';
if (status_class === 'ui-btn-no-data') {
status_style = "color: transparent !important;";
}
gadget.element.innerHTML = inline_status_template({
monitor_url: monitor_url,
......
......@@ -269,7 +269,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>972.38770.30010.49920</string> </value>
<value> <string>974.62049.17150.785</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -287,7 +287,7 @@
</tuple>
<state>
<tuple>
<float>1545932459.6</float>
<float>1555352356.62</float>
<string>UTC</string>
</tuple>
</state>
......
......@@ -124,7 +124,12 @@
right_class = 'ui-btn-no-data';
status_class = checkNetworkStatus(result);
right_class = checkNetworkPartitionStatus(result);
if ((status_class === 'ui-btn-error') ||
(status_class === 'ui-btn-no-data')) {
right_class = status_class;
} else {
right_class = checkNetworkPartitionStatus(result);
}
gadget.element.innerHTML = inline_status_template({
status_class: status_class,
......
......@@ -243,7 +243,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 +257,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>974.51836.28846.24849</string> </value>
<value> <string>974.62049.17150.785</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -275,7 +275,7 @@
</tuple>
<state>
<tuple>
<float>1554320626.62</float>
<float>1555352227.27</float>
<string>UTC</string>
</tuple>
</state>
......
......@@ -128,7 +128,12 @@
right_style = '';
status_class = checkProjectStatus(result);
right_class = checkProjectPartitionStatus(result);
if ((status_class === 'ui-btn-error') ||
(status_class === 'ui-btn-no-data')) {
right_class = status_class;
} else {
right_class = checkProjectPartitionStatus(result);
}
monitor_url = gadget.props.hateoas_url + gadget.options.value.jio_key + '/Base_redirectToMonitor';
gadget.element.innerHTML = inline_status_template({
......
......@@ -243,7 +243,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 +257,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>974.51745.60684.16657</string> </value>
<value> <string>975.3495.41986.50397</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -275,7 +275,7 @@
</tuple>
<state>
<tuple>
<float>1554315362.25</float>
<float>1555352158.81</float>
<string>UTC</string>
</tuple>
</state>
......
......@@ -127,7 +127,12 @@
right_style = '';
status_class = checkSiteStatus(result);
right_class = checkSitePartitionStatus(result);
if ((status_class === 'ui-btn-error') ||
(status_class === 'ui-btn-no-data')) {
right_class = status_class;
} else {
right_class = checkSitePartitionStatus(result);
}
monitor_url = gadget.props.hateoas_url + gadget.options.value.jio_key + '/Base_redirectToMonitor';
gadget.element.innerHTML = inline_status_template({
......
......@@ -254,7 +254,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>
......@@ -268,7 +268,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>969.37904.40841.53947</string> </value>
<value> <string>974.62049.17150.785</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -286,7 +286,7 @@
</tuple>
<state>
<tuple>
<float>1554317692.05</float>
<float>1555352069.34</float>
<string>UTC</string>
</tuple>
</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