summaryrefslogtreecommitdiffstats
path: root/modules-available/statistics
diff options
context:
space:
mode:
authorSimon Rettberg2019-02-21 13:55:04 +0100
committerSimon Rettberg2019-02-21 13:55:04 +0100
commitf72c4c4a6880a9a2879ea1c5d59a5ab2d85ff460 (patch)
tree2c198ca6fa687d41988f463acc51d51237c38524 /modules-available/statistics
parentFix UUID handling; refactor constraints for machineuuid (diff)
downloadslx-admin-f72c4c4a6880a9a2879ea1c5d59a5ab2d85ff460.tar.gz
slx-admin-f72c4c4a6880a9a2879ea1c5d59a5ab2d85ff460.tar.xz
slx-admin-f72c4c4a6880a9a2879ea1c5d59a5ab2d85ff460.zip
[statistics] Improve display of non-client runmode machines
Diffstat (limited to 'modules-available/statistics')
-rw-r--r--modules-available/statistics/page.inc.php7
-rw-r--r--modules-available/statistics/templates/machine-main.html2
2 files changed, 6 insertions, 3 deletions
diff --git a/modules-available/statistics/page.inc.php b/modules-available/statistics/page.inc.php
index a9cde6fb..aaaa4618 100644
--- a/modules-available/statistics/page.inc.php
+++ b/modules-available/statistics/page.inc.php
@@ -632,7 +632,7 @@ class Page_Statistics extends Page
$xtra .= ', data';
}
if (Module::isAvailable('runmode')) {
- $xtra .= ', runmode.module AS rmmodule';
+ $xtra .= ', runmode.module AS rmmodule, runmode.isclient';
if (strpos($join, 'runmode') === false) {
$join .= ' LEFT JOIN runmode USING (machineuuid) ';
}
@@ -654,7 +654,6 @@ class Page_Statistics extends Page
// TODO: This only makes sense as long as there is only one action to perform on selected clients; reboot/shutdown is planned
$row['delete_disabled'] = in_array($row['locationid'], $deleteAllowedLocations) ? '' : 'disabled';
$row['link_details'] = in_array($row['locationid'], $detailsAllowedLocations);
- $row['state_' . $row['state']] = true;
//$row['firstseen'] = Util::prettyTime($row['firstseen']);
$row['lastseen_int'] = $row['lastseen'];
$row['lastseen'] = Util::prettyTime($row['lastseen']);
@@ -684,7 +683,11 @@ class Page_Statistics extends Page
$row['moduleName'] = $data['moduleName'];
$row['modeName'] = $data['modeName'];
}
+ if (!$row['isclient']) {
+ $row['state'] = 'OCCUPIED';
+ }
}
+ $row['state_' . $row['state']] = true;
$row['locationname'] = Location::getName($row['locationid']);
$rows[] = $row;
}
diff --git a/modules-available/statistics/templates/machine-main.html b/modules-available/statistics/templates/machine-main.html
index 44f03a99..b859b79a 100644
--- a/modules-available/statistics/templates/machine-main.html
+++ b/modules-available/statistics/templates/machine-main.html
@@ -63,7 +63,7 @@
{{^username}}
<span class="glyphicon glyphicon-user red"></span> {{lang_machineOccupied}}
{{/username}}
- <div>{{logintime_s}}</div>
+ <div>{{#logintime}}{{logintime_s}}{{/logintime}}</div>
{{/state_OCCUPIED}}
{{#state_STANDBY}}
<span class="glyphicon glyphicon-off green"></span> {{lang_machineStandby}}