From f72c4c4a6880a9a2879ea1c5d59a5ab2d85ff460 Mon Sep 17 00:00:00 2001 From: Simon Rettberg Date: Thu, 21 Feb 2019 13:55:04 +0100 Subject: [statistics] Improve display of non-client runmode machines --- modules-available/statistics/page.inc.php | 7 +++++-- modules-available/statistics/templates/machine-main.html | 2 +- 2 files changed, 6 insertions(+), 3 deletions(-) (limited to 'modules-available/statistics') 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}} {{lang_machineOccupied}} {{/username}} -
{{logintime_s}}
+
{{#logintime}}{{logintime_s}}{{/logintime}}
{{/state_OCCUPIED}} {{#state_STANDBY}} {{lang_machineStandby}} -- cgit v1.2.3-55-g7522