summaryrefslogtreecommitdiffstats
path: root/modules-available/systemstatus/templates/systeminfo.html
diff options
context:
space:
mode:
Diffstat (limited to 'modules-available/systemstatus/templates/systeminfo.html')
-rw-r--r--modules-available/systemstatus/templates/systeminfo.html161
1 files changed, 91 insertions, 70 deletions
diff --git a/modules-available/systemstatus/templates/systeminfo.html b/modules-available/systemstatus/templates/systeminfo.html
index cf3f0cc2..2489bcaa 100644
--- a/modules-available/systemstatus/templates/systeminfo.html
+++ b/modules-available/systemstatus/templates/systeminfo.html
@@ -1,6 +1,6 @@
-<div>
- {{lang_uptimeOS}}: {{uptime}}
-</div>
+<div>{{lang_uptimeOS}}: <b>{{uptime}}</b></div>
+<div>{{lang_distribution}}: <b>{{distribution}}</b></div>
+<div>{{lang_kernel}}: <b>{{kernel}}</b></div>
<div class="slx-storechart">
<b>{{lang_cpuLoad}}</b>
@@ -48,73 +48,94 @@
{{/swapWarning}}
<script type="text/javascript">
- {{#cpuLoadOk}}
- var cpuCircle = Circles.create({
- id: 'circles-cpuload',
- radius: 60,
- value: {{{cpuLoad}}},
- maxValue: 100,
- width: 10,
- text: function(value){return value + '%'; },
- colors: ['#dbc', '#33f'],
- duration: 400,
- wrpClass: 'circles-wrp',
- textClass: 'circles-text'
- });
- var $cpu = $(cpuCircle._el);
- var lastCpuTotal = {{CpuTotal}};
- var lastCpuIdle = {{CpuIdle}};
- var lastCpuPercent = {{cpuLoad}};
- {{/cpuLoadOk}}
- {{#memTotal}}
- var memCircle = Circles.create({
- id: 'circles-mem',
- radius: 60,
- value: {{{memPercent}}},
- maxValue: 100,
- width: 10,
- text: function(value){return value + '%'; },
- colors: ['#dbc', '#33f'],
- duration: 400,
- wrpClass: 'circles-wrp',
- textClass: 'circles-text'
- });
- var swapCircle = Circles.create({
- id: 'circles-swap',
- radius: 60,
- value: {{{swapPercent}}},
- maxValue: 100,
- width: 10,
- text: function(value){return value + '%'; },
- colors: ['#dbc', '#f33'],
- duration: 400,
- wrpClass: 'circles-wrp',
- textClass: 'circles-text'
- });
- {{/memTotal}}
- function updateSystem() {
- if (!cpuCircle && !memCircle) return;
- if (!$cpu.is(':visible')) {
- setTimeout(updateSystem, 1200);
- return;
+ (function () {
+ var hiddenProp;
+ if (typeof document.hidden !== "undefined") { // Opera 12.10 and Firefox 18 and later support
+ hiddenProp = "hidden";
+ } else if (typeof document.msHidden !== "undefined") {
+ hiddenProp = "msHidden";
+ } else if (typeof document.webkitHidden !== "undefined") {
+ hiddenProp = "webkitHidden";
+ } else {
+ hiddenProp = null;
}
- $.post('?do=SystemStatus&action=SysPoll', { token: TOKEN }, function(data) {
- if (memCircle && data.MemPercent) memCircle.update(data.MemPercent);
- if (swapCircle && data.SwapPercent) swapCircle.update(data.SwapPercent);
- if (cpuCircle && data.CpuIdle) {
- var total = data.CpuTotal - lastCpuTotal;
- var load = total - (data.CpuIdle - lastCpuIdle);
- var percent = Math.round(100 * load / total);
- cpuCircle.update(percent, Math.abs(percent - lastCpuPercent) < 5 ? 0 : 250);
- lastCpuTotal = data.CpuTotal;
- lastCpuIdle = data.CpuIdle;
- lastCpuPercent = percent;
+
+ {{#cpuLoadOk}}
+ var cpuCircle = Circles.create({
+ id: 'circles-cpuload',
+ radius: 60,
+ value: {{{cpuLoad}}},
+ maxValue: 100,
+ width: 10,
+ text: function (value) {
+ return value + '%';
+ },
+ colors: ['#dbc', '#33f'],
+ duration: 400,
+ wrpClass: 'circles-wrp',
+ textClass: 'circles-text'
+ });
+ var $cpu = $(cpuCircle._el);
+ var lastCpuTotal = {{CpuTotal}};
+ var lastCpuIdle = {{CpuIdle}};
+ var lastCpuPercent = {{cpuLoad}};
+ {{/cpuLoadOk}}
+ {{#memTotal}}
+ var memCircle = Circles.create({
+ id: 'circles-mem',
+ radius: 60,
+ value: {{{memPercent}}},
+ maxValue: 100,
+ width: 10,
+ text: function (value) {
+ return value + '%';
+ },
+ colors: ['#dbc', '#33f'],
+ duration: 400,
+ wrpClass: 'circles-wrp',
+ textClass: 'circles-text'
+ });
+ var swapCircle = Circles.create({
+ id: 'circles-swap',
+ radius: 60,
+ value: {{{swapPercent}}},
+ maxValue: 100,
+ width: 10,
+ text: function (value) {
+ return value + '%';
+ },
+ colors: ['#dbc', '#f33'],
+ duration: 400,
+ wrpClass: 'circles-wrp',
+ textClass: 'circles-text'
+ });
+ {{/memTotal}}
+
+ function updateSystem() {
+ if (!cpuCircle && !memCircle) return;
+ if (!$cpu.is(':visible') || (hiddenProp && document[hiddenProp])) {
+ setTimeout(updateSystem, 2500);
+ return;
}
- }, 'json').fail(function(data) {
- console.log(data);
- }).always(function() {
- setTimeout(updateSystem, 1200);
- });
- }
- setTimeout(updateSystem, 1000);
+ $.post('?do=SystemStatus&action=SysPoll', {token: TOKEN}, function (data) {
+ if (memCircle && data.MemPercent) memCircle.update(data.MemPercent);
+ if (swapCircle && data.SwapPercent) swapCircle.update(data.SwapPercent);
+ if (cpuCircle && data.CpuIdle) {
+ var total = data.CpuTotal - lastCpuTotal;
+ var load = total - (data.CpuIdle - lastCpuIdle);
+ var percent = Math.round(100 * load / total);
+ cpuCircle.update(percent, Math.abs(percent - lastCpuPercent) < 5 ? 0 : 250);
+ lastCpuTotal = data.CpuTotal;
+ lastCpuIdle = data.CpuIdle;
+ lastCpuPercent = percent;
+ }
+ }, 'json').fail(function (data) {
+ console.log(data);
+ }).always(function () {
+ setTimeout(updateSystem, 1200);
+ });
+ }
+
+ setTimeout(updateSystem, 1000);
+ })();
</script>