From 0135c6f733c72d5f0cd94f05033442b239d5ec53 Mon Sep 17 00:00:00 2001 From: Jannik Schönartz Date: Thu, 30 Nov 2017 13:56:08 +0100 Subject: [locationinfo] Added standby to the summary panel --- .../locationinfo/templates/frontend-summary.html | 28 +++++++++++++--------- 1 file changed, 17 insertions(+), 11 deletions(-) (limited to 'modules-available/locationinfo/templates/frontend-summary.html') diff --git a/modules-available/locationinfo/templates/frontend-summary.html b/modules-available/locationinfo/templates/frontend-summary.html index e117cbcb..e8406de4 100644 --- a/modules-available/locationinfo/templates/frontend-summary.html +++ b/modules-available/locationinfo/templates/frontend-summary.html @@ -60,7 +60,7 @@ border-style: solid; } - .pc-idle, .pc-occupied, .pc-off, .pc-broken { + .pc-idle, .pc-occupied, .pc-offline, .pc-broken, .pc-standby { padding: 2px 1px; text-align: center; font-size: 90%; @@ -79,10 +79,15 @@ border-radius: 3px 0px 0px 3px; } - .pc-off { + .pc-offline { background-color: darkgrey; } + .pc-standby { + background-color: darkgreen; + } + + .pc-broken { background-color: black; color: white; @@ -294,7 +299,7 @@ function updatePcStates(json) { var l = json.length; for (var i = 0; i < l; i++) { - updateRoomUsage(json[i].id, json[i].idle, json[i].occupied, json[i].off, json[i].broken) + updateRoomUsage(json[i].id, json[i].idle, json[i].occupied, json[i].offline, json[i].broken, json[i].standby) } } @@ -534,20 +539,21 @@ * @param id of the child * @param idle PC's on * @param occupied PC's used - * @param off PC's that are off + * @param offline PC's that are off * @param broken PC's that are broken */ - function updateRoomUsage(id, idle, occupied, off, broken) { - if (idle == 0 && occupied == 0 && off == 0 && broken == 0) { + function updateRoomUsage(id, idle, occupied, offline, broken, standby) { + if (idle == 0 && occupied == 0 && offline == 0 && broken == 0 && standby == 0) { $('#parent_' + id).parent().hide(); return; } $('#parent_' + id).parent().show(); - var total = parseInt(idle) + parseInt(occupied) + parseInt(off) + parseInt(broken); + var total = parseInt(idle) + parseInt(occupied) + parseInt(offline) + parseInt(broken) + parseInt(standby); $("#pc_Idle_" + id).text(idle).width((idle / total) * 100 + '%'); $("#pc_Occupied_" + id).text(occupied).width((occupied / total) * 100 + '%'); - $("#pc_Off_" + id).text(off).width((off / total) * 100 + '%'); + $("#pc_Offline_" + id).text(offline).width((offline / total) * 100 + '%'); $("#pc_Broken_" + id).text(broken).width((broken / total) * 100 + '%'); + $("#pc_Standby_" + id).text(standby).width((standby / total) * 100 + '%'); } /** @@ -589,7 +595,8 @@ "
" + "
?
" + "
?
" + - "
?
" + + "
?
" + + "
?
" + "
?
" + "
" + "
" + @@ -597,8 +604,7 @@ "
"; var obj = $(target).append(text); addRoom(id, name); - return obj - + return obj; } /** -- cgit v1.2.3-55-g7522