diff options
author | jim-p <jimp@pfsense.org> | 2014-05-22 12:47:23 -0400 |
---|---|---|
committer | jim-p <jimp@pfsense.org> | 2014-05-22 12:47:23 -0400 |
commit | 0d4b6b89c97c33c6150058df3c915e6b71d197ac (patch) | |
tree | 5a7cef5b3c288f3ae3b841bcfb364a93709bb5e6 /usr/local/www/widgets | |
parent | e1854cad12e91e83cede2595dab9a2c66fefd10c (diff) | |
download | pfsense-0d4b6b89c97c33c6150058df3c915e6b71d197ac.zip pfsense-0d4b6b89c97c33c6150058df3c915e6b71d197ac.tar.gz |
Display space usage for all mounted filesystems, not just /. Also display FS type and indicate if it's a RAM disk.
Diffstat (limited to 'usr/local/www/widgets')
-rw-r--r-- | usr/local/www/widgets/widgets/system_information.widget.php | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/usr/local/www/widgets/widgets/system_information.widget.php b/usr/local/www/widgets/widgets/system_information.widget.php index 2cb00f2..3705937 100644 --- a/usr/local/www/widgets/widgets/system_information.widget.php +++ b/usr/local/www/widgets/widgets/system_information.widget.php @@ -85,6 +85,8 @@ if($_REQUEST['getupdatestatus']) { $curcfg = $config['system']['firmware']; +$filesystems = get_mounted_filesystems(); + ?> <script type="text/javascript"> //<![CDATA[ @@ -93,7 +95,11 @@ $curcfg = $config['system']['firmware']; jQuery("#mbufPB").progressbar( { value: <?php echo get_mbuf(true); ?> } ); jQuery("#cpuPB").progressbar( { value:false } ); jQuery("#memUsagePB").progressbar( { value: <?php echo mem_usage(); ?> } ); - jQuery("#diskUsagePB").progressbar( { value: <?php echo disk_usage(); ?> } ); + +<?PHP $d = 0; ?> +<?PHP foreach ($filesystems as $fs): ?> + jQuery("#diskUsagePB<?php echo $d++; ?>").progressbar( { value: <?php echo $fs['percent_used']; ?> } ); +<?PHP endforeach; ?> <?php if($showswap == true): ?> jQuery("#swapUsagePB").progressbar( { value: <?php echo swap_usage(); ?> } ); @@ -274,9 +280,13 @@ $curcfg = $config['system']['firmware']; <tr> <td width="25%" class="vncellt"><?=gettext("Disk usage");?></td> <td width="75%" class="listr"> - <?php $diskusage = disk_usage(); ?> - <div id="diskUsagePB"></div> - <span id="diskusagemeter"><?= $diskusage.'%'; ?></span> of <?= `/bin/df -h / | /usr/bin/grep -v 'Size' | /usr/bin/awk '{ print $2 }'` ?> +<?PHP $d = 0; ?> +<?PHP foreach ($filesystems as $fs): ?> + <div id="diskUsagePB<?php echo $d; ?>"></div> + <?PHP if (substr(basename($fs['device']), 0, 2) == "md") $fs['type'] .= " in RAM"; ?> + <?PHP echo "{$fs['mountpoint']} ({$fs['type']})";?>: <span id="diskusagemeter<?php echo $d++ ?>"><?= $fs['percent_used'].'%'; ?></span> of <?PHP echo $fs['total_size'];?> + <br /> +<?PHP endforeach; ?> </td> </tr> </tbody> |