feature: add get_disks function (#6058)

This commit is contained in:
VVelox
2017-03-03 08:27:33 -06:00
committed by Neil Lathwood
parent 57f27fbad2
commit 6844f29217
3 changed files with 8 additions and 2 deletions

View File

@@ -1472,3 +1472,9 @@ function get_oxidized_nodes_list()
</tr>";
}
}
// fetches disks for a system
function get_disks($device)
{
return dbFetchRows('SELECT * FROM `ucd_diskio` WHERE device_id = ? ORDER BY diskio_descr', array($device));
}

View File

@@ -1,7 +1,7 @@
<?php
$storage = dbFetchCell('select count(*) from storage WHERE device_id = ?', array($device['device_id']));
$diskio = dbFetchCell('select count(*) from ucd_diskio WHERE device_id = ?', array($device['device_id']));
$diskio = get_disks($device['device_id']);
$mempools = dbFetchCell('select count(*) from mempools WHERE device_id = ?', array($device['device_id'])) + count_mib_mempools($device);
$processor = dbFetchCell('select count(*) from processors WHERE device_id = ?', array($device['device_id'])) + count_mib_processors($device);

View File

@@ -2,7 +2,7 @@
$row = 1;
foreach (dbFetchRows('SELECT * FROM `ucd_diskio` WHERE device_id = ? ORDER BY diskio_descr', array($device['device_id'])) as $drive) {
foreach (get_disk($device['device_id']) as $drive) {
if (is_integer($row / 2)) {
$row_colour = $list_colour_a;
} else {