summaryrefslogtreecommitdiffstats
path: root/modules-available/statistics/inc/hardwareparser.inc.php
diff options
context:
space:
mode:
authorSimon Rettberg2022-05-10 15:49:58 +0200
committerSimon Rettberg2022-05-10 15:49:58 +0200
commit988ff2ca8229662615c13a9bc4cca0d9263ba5ec (patch)
tree04ad652acc49558866971ea9076ae49c404a9653 /modules-available/statistics/inc/hardwareparser.inc.php
parent[statistics] Don't try to check MBR partition IDs for non-MBR drives (diff)
downloadslx-admin-988ff2ca8229662615c13a9bc4cca0d9263ba5ec.tar.gz
slx-admin-988ff2ca8229662615c13a9bc4cca0d9263ba5ec.tar.xz
slx-admin-988ff2ca8229662615c13a9bc4cca0d9263ba5ec.zip
[statistics] Show HDD count in list view
Diffstat (limited to 'modules-available/statistics/inc/hardwareparser.inc.php')
-rw-r--r--modules-available/statistics/inc/hardwareparser.inc.php2
1 files changed, 2 insertions, 0 deletions
diff --git a/modules-available/statistics/inc/hardwareparser.inc.php b/modules-available/statistics/inc/hardwareparser.inc.php
index 16710a9f..95b8e31e 100644
--- a/modules-available/statistics/inc/hardwareparser.inc.php
+++ b/modules-available/statistics/inc/hardwareparser.inc.php
@@ -438,6 +438,8 @@ class HardwareParser
// Sum of all ID44/45 partitions in bytes
$id44 = $id45 = 0;
foreach (($data['drives'] ?? []) as $dev) {
+ if (($dev['type'] ?? 'drive') !== 'drive')
+ continue; // TODO: Handle CD/DVD drives? Still relevant?
if (empty($dev['readlink'])) // This is the canonical entry name directly under /dev/, e.g. /dev/sda
continue;
// Use smartctl as the source of truth, lsblk as fallback if data is missing