From 4bbf74461048d50805b2512535781f18b4661b22 Mon Sep 17 00:00:00 2001 From: Simon Rettberg Date: Mon, 14 Nov 2016 15:51:04 +0100 Subject: [statistics] Show red hdd icon in client list when filtering by ID44 == 0 and machine has no HDD installed at all --- modules-available/statistics/page.inc.php | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'modules-available/statistics/page.inc.php') 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( -- cgit v1.2.3-55-g7522