Permalink
Browse files

Arena status display

  • Loading branch information...
Manuel-777 committed Oct 7, 2018
1 parent 24bb76e commit 8444b7086267dd5e982f09d4cb688a3409d556b2
Binary file not shown.
BIN +3.16 KB images/status_red.png
Binary file not shown.
Binary file not shown.
@@ -14,7 +14,7 @@ const {autoUpdater} = require("electron-updater");
require('electron-debug')({showDevTools: false});
console.log(process.platform);
const debugBack = false;
const debugBack = true;
var mainWindow;
var background;
@@ -2,6 +2,45 @@ span i {
margin-left: 4px;
}
.top_status {
width: 24px;
height: 24px;
align-self: center;
}
.status_item {
display: flex;
color: #fae5d2;
}
.top_status_pop {
display: grid;
padding: 12px;
color: #fae5d2;
width: 240px;
opacity: 0;
background-color: rgba(0, 0, 0, 0.5);
border-radius: 4px;
height: 120px;
position: absolute;
top: 48px;
margin-left: -120px;
-webkit-transition: all .5s ease-in-out;
box-shadow: 0 8px 16px 0px rgba(0, 0, 0, 0.2);
}
.status_green {
background-image: url(../images/status_green.png);
}
.status_yellow {
background-image: url(../images/status_yellow.png);
}
.status_red {
background-image: url(../images/status_red.png);
}
.top_logo_about {
cursor: pointer;
align-self: center;
@@ -40,6 +40,8 @@
<div class="top_nav_item it3">ECONOMY</div>
<div class="top_nav_item it4">COLLECTION</div>
<div class="flex_item" style="margin-left: auto;">
<div class="top_status"></div>
<div class="top_status_pop"></div>
<div class="top_rank" ></div>
<div class="top_username"></div>
<div class="top_username_id"></div>
@@ -156,7 +156,57 @@ ipc.on('set_cards', function (event, _cards, _cardsnew) {
//
ipc.on('set_status', function (event, arg) {
serverStatus = arg;
if (arg.status.description == 'All Systems Operational') {
$('.top_status').addClass('status_green');
}
else {
$('.top_status').addClass('status_red');
}
var sp = $('<span>'+arg.status.description+'</span>');
sp.css('text-align', 'center');
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>');
div.append('<span>'+comp.name+':</span>');
var sp = $('<span></span>');
if (comp.status == 'operational') {
st.addClass('status_green');
sp.html('Operational');
}
else if (comp.status == 'degraded_performance') {
st.addClass('status_yellow');
sp.html('Degraded performance');
}
else if (comp.status == 'major_outage') {
st.addClass('status_red');
sp.html('Major outage');
}
else if (comp.status == 'partial_outage') {
st.addClass('status_yellow');
sp.html('Partial outage');
}
else if (comp.status == 'under_maintenance') {
st.addClass('status_yellow');
sp.html('Under maintenance');
}
else {
st.addClass('status_yellow');
sp.html(comp.status);
}
sp.css('margin-left', 'auto');
sp.appendTo(div);
st.appendTo(div);
div.appendTo($('.top_status_pop'));
});
$('.top_status').on('mouseenter', function(e) {
$('.top_status_pop').css("opacity", 1);
});
$('.top_status').on('mouseleave', function(e) {
$('.top_status_pop').css("opacity", 0);
});
});
//

0 comments on commit 8444b70

Please sign in to comment.