Skip to content
Permalink
Browse files

Fix status icons

  • Loading branch information...
Manuel-777 committed Feb 20, 2019
1 parent ea90e02 commit b517f38531fa8aa0d3476676fb3cc7e1317d0744
Showing with 10 additions and 9 deletions.
  1. +1 −1 window_main/index.css
  2. +9 −8 window_main/renderer.js
@@ -2,7 +2,7 @@ span i {
margin-left: 4px;
}

.top_status {
.top_status, .top_status_span {
width: 24px;
height: 24px;
align-self: center;
@@ -347,37 +347,38 @@ ipc.on('set_status', function (event, arg) {
sp.css('margin-bottom', '4px');
$('.top_status_pop').append(sp);
arg.components.forEach(function(comp) {
var div = $('<div class="status_item"></div>');
var st = $('<div class="top_status"></div>');
let div = $('<div class="status_item"></div>');
let st = $('<div class="top_status_span"></div>');
div.append('<span>'+comp.name+':</span>');
var sp = $('<span></span>');
let sp = $('<span></span>');

if (comp.status == 'operational') {
st.addClass('status_green');
sp.html('Operational');
}
else if (comp.status == 'degraded_performance') {
st.addClass('status_yellow');
if (mainStatus > 1) mainStatus = 1;
if (mainStatus < 1) mainStatus = 1;
sp.html('Degraded performance');
}
else if (comp.status == 'major_outage') {
st.addClass('status_red');
if (mainStatus > 2) mainStatus = 2;
if (mainStatus < 2) mainStatus = 2;
sp.html('Major outage');
}
else if (comp.status == 'partial_outage') {
st.addClass('status_yellow');
if (mainStatus > 1) mainStatus = 1;
if (mainStatus < 1) mainStatus = 1;
sp.html('Partial outage');
}
else if (comp.status == 'under_maintenance') {
st.addClass('status_yellow');
if (mainStatus > 1) mainStatus = 1;
if (mainStatus < 1) mainStatus = 1;
sp.html('Under maintenance');
}
else {
st.addClass('status_yellow');
if (mainStatus > 1) mainStatus = 1;
if (mainStatus < 1) mainStatus = 1;
sp.html(comp.status);
}
sp.css('margin-left', 'auto');

0 comments on commit b517f38

Please sign in to comment.
You can’t perform that action at this time.