summaryrefslogtreecommitdiffstats
path: root/modules-available/statistics/page.inc.php
diff options
context:
space:
mode:
authorSimon Rettberg2016-11-14 15:51:04 +0100
committerSimon Rettberg2016-11-14 15:51:04 +0100
commit4bbf74461048d50805b2512535781f18b4661b22 (patch)
tree13583abe9febbe5acb8d4a646f0bb9b7c189d145 /modules-available/statistics/page.inc.php
parent[locationinfo] Skeleton for new module (diff)
downloadslx-admin-4bbf74461048d50805b2512535781f18b4661b22.tar.gz
slx-admin-4bbf74461048d50805b2512535781f18b4661b22.tar.xz
slx-admin-4bbf74461048d50805b2512535781f18b4661b22.zip
[statistics] Show red hdd icon in client list when filtering by ID44 == 0 and machine has no HDD installed at all
Diffstat (limited to 'modules-available/statistics/page.inc.php')
-rw-r--r--modules-available/statistics/page.inc.php12
1 files changed, 11 insertions, 1 deletions
diff --git a/modules-available/statistics/page.inc.php b/modules-available/statistics/page.inc.php
index 512f7ead..cf33c8af 100644
--- a/modules-available/statistics/page.inc.php
+++ b/modules-available/statistics/page.inc.php
@@ -500,8 +500,13 @@ class Page_Statistics extends Page
{
$filterSet->makeFragments($where, $join, $sort, $args);
+ $xtra = '';
+ if ($filterSet->isNoId44Filter()) {
+ $xtra = ', data';
+ }
$res = Database::simpleQuery('SELECT machineuuid, macaddr, clientip, firstseen, lastseen,'
- . ' logintime, lastboot, realcores, mbram, kvmstate, cpumodel, id44mb, hostname, notes IS NOT NULL AS hasnotes, badsectors FROM machine'
+ . ' logintime, lastboot, realcores, mbram, kvmstate, cpumodel, id44mb, hostname, notes IS NOT NULL AS hasnotes,'
+ . ' badsectors ' . $xtra . ' FROM machine'
. " $join WHERE $where $sort", $args);
$rows = array();
$NOW = time();
@@ -529,6 +534,11 @@ class Page_Statistics extends Page
if (empty($row['hostname'])) {
$row['hostname'] = $row['clientip'];
}
+ if (isset($row['data'])) {
+ if (!preg_match('/^Disk.*bytes$/m', $row['data'])) {
+ $row['nohdd'] = true;
+ }
+ }
$rows[] = $row;
}
Render::addTemplate('clientlist', array(