summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSimon Rettberg2016-07-04 17:08:29 +0200
committerSimon Rettberg2016-07-04 17:08:29 +0200
commit1a3c9f848bc8b740e15a342486eaf648619e8e22 (patch)
treeb1c5d2d948385c1d83e05af6e97f8c14394153e3
parent[news/summernote] Make button selection match capabilities of Qt/vmchooser (diff)
downloadslx-admin-1a3c9f848bc8b740e15a342486eaf648619e8e22.tar.gz
slx-admin-1a3c9f848bc8b740e15a342486eaf648619e8e22.tar.xz
slx-admin-1a3c9f848bc8b740e15a342486eaf648619e8e22.zip
[statistics] Don't show uptime for offline clients; chart.js: highlight in bold
-rw-r--r--modules-available/statistics/page.inc.php5
-rw-r--r--modules-available/statistics/templates/cpumodels.html4
-rw-r--r--modules-available/statistics/templates/id44.html4
-rw-r--r--modules-available/statistics/templates/kvmstate.html4
-rw-r--r--modules-available/statistics/templates/memory.html4
5 files changed, 12 insertions, 9 deletions
diff --git a/modules-available/statistics/page.inc.php b/modules-available/statistics/page.inc.php
index 1e6f7400..de7f965b 100644
--- a/modules-available/statistics/page.inc.php
+++ b/modules-available/statistics/page.inc.php
@@ -452,7 +452,10 @@ class Page_Statistics extends Page
$client['firstseen_s'] = date('d.m.Y H:i', $client['firstseen']);
$client['lastseen_s'] = date('d.m.Y H:i', $client['lastseen']);
$uptime = $NOW - $client['lastboot'];
- $client['lastboot_s'] = date('d.m.Y H:i', $client['lastboot']) . ' (Up ' . floor($uptime / 86400) . 'd ' . gmdate('H:i', $uptime) . ')';
+ $client['lastboot_s'] = date('d.m.Y H:i', $client['lastboot']);
+ if (!isset($client['state_off']) || !$client['state_off']) {
+ $client['lastboot_s'] .= ' (Up ' . floor($uptime / 86400) . 'd ' . gmdate('H:i', $uptime) . ')';
+ }
$client['logintime_s'] = date('d.m.Y H:i', $client['logintime']);
$client['gbram'] = round(round($client['mbram'] / 500) / 2, 1);
$client['gbtmp'] = round($client['id44mb'] / 1024);
diff --git a/modules-available/statistics/templates/cpumodels.html b/modules-available/statistics/templates/cpumodels.html
index 2f24cd92..d87118ef 100644
--- a/modules-available/statistics/templates/cpumodels.html
+++ b/modules-available/statistics/templates/cpumodels.html
@@ -33,13 +33,13 @@
animation: false,
tooltipTemplate: "<%if (label){%><%=label%><%}%>",
customTooltips: function(tooltip) {
- if (sel !== false) sel.removeClass('info');
+ if (sel !== false) sel.removeClass('slx-bold');
if (!tooltip) {
sel = false;
return;
}
sel = $('#' + tooltip.text);
- sel.addClass('info');
+ sel.addClass('slx-bold');
}
});
}, false);
diff --git a/modules-available/statistics/templates/id44.html b/modules-available/statistics/templates/id44.html
index 730839b1..4eea9413 100644
--- a/modules-available/statistics/templates/id44.html
+++ b/modules-available/statistics/templates/id44.html
@@ -29,14 +29,14 @@
animation: false,
tooltipTemplate: "<%if (label){%><%=label%><%}%>",
customTooltips: function(tooltip) {
- if (sel !== false) sel.removeClass('info');
+ if (sel !== false) sel.removeClass('slx-bold');
if (!tooltip) {
sel = false;
return;
}
sel = $('#tmpid' + String(tooltip.text));
console.log('#tmpid' + String(tooltip.text));
- sel.addClass('info');
+ sel.addClass('slx-bold');
}
});
}, false);
diff --git a/modules-available/statistics/templates/kvmstate.html b/modules-available/statistics/templates/kvmstate.html
index 107a34f7..07ecd558 100644
--- a/modules-available/statistics/templates/kvmstate.html
+++ b/modules-available/statistics/templates/kvmstate.html
@@ -29,13 +29,13 @@
animation: false,
tooltipTemplate: "<%if (label){%><%=label%><%}%>",
customTooltips: function(tooltip) {
- if (sel !== false) sel.removeClass('info');
+ if (sel !== false) sel.removeClass('slx-bold');
if (!tooltip) {
sel = false;
return;
}
sel = $('#kvm' + tooltip.text);
- sel.addClass('info');
+ sel.addClass('slx-bold');
}
});
}, false);
diff --git a/modules-available/statistics/templates/memory.html b/modules-available/statistics/templates/memory.html
index f4d2ad24..537ee3bd 100644
--- a/modules-available/statistics/templates/memory.html
+++ b/modules-available/statistics/templates/memory.html
@@ -29,13 +29,13 @@
animation: false,
tooltipTemplate: "<%if (label){%><%=label%><%}%>",
customTooltips: function(tooltip) {
- if (sel !== false) sel.removeClass('info');
+ if (sel !== false) sel.removeClass('slx-bold');
if (!tooltip) {
sel = false;
return;
}
sel = $('#ramid' + tooltip.text);
- sel.addClass('info');
+ sel.addClass('slx-bold');
}
});
}, false);