diff options
author | Scott Ullrich <sullrich@pfsense.org> | 2005-05-23 13:44:09 +0000 |
---|---|---|
committer | Scott Ullrich <sullrich@pfsense.org> | 2005-05-23 13:44:09 +0000 |
commit | 8fecad112914a8a1425b41f5f7ec3452f61d25e3 (patch) | |
tree | 148a8c44635dfa791d5a6cb1590273d89a50dda4 /usr/local/www | |
parent | 2733ae78876fc53855cbb46e504ad9deb577b0bb (diff) | |
download | pfsense-8fecad112914a8a1425b41f5f7ec3452f61d25e3.zip pfsense-8fecad112914a8a1425b41f5f7ec3452f61d25e3.tar.gz |
Do not show swap graph unless a swap partition is loaded
Fixes Ticket #93
Diffstat (limited to 'usr/local/www')
-rwxr-xr-x | usr/local/www/index.php | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/usr/local/www/index.php b/usr/local/www/index.php index 5589947..91c3bfe 100755 --- a/usr/local/www/index.php +++ b/usr/local/www/index.php @@ -34,6 +34,9 @@ require("guiconfig.inc"); +$swapinfo = `/usr/sbin/swapinfo`; +if(stristr($swapinfo,"%") == true) $showswap=true; + if(file_exists("/usr/local/www/trigger_initial_wizard")) { conf_mount_rw(); unlink("/usr/local/www/trigger_initial_wizard"); @@ -120,7 +123,7 @@ return $cpuUsage; function get_pfstate() { global $config, $g; - if (isset($config['system']['maximumstates'])) + if (isset($config['system']['maximumstates']) and $config['system']['maximumstates'] > 0) $maxstates="/{$config['system']['maximumstates']}"; else $maxstates="/10000"; @@ -241,6 +244,8 @@ echo "<input style='border: 0px solid white;' size='30' name='memusagemeter' id= ?> </td> </tr> + +<?php if($showswap == true): ?> <tr> <td width="25%" class="vncellt">SWAP usage</td> <td width="75%" class="listr"> @@ -262,6 +267,8 @@ echo "<input style='border: 0px solid white;' size='30' name='swapusagemeter' id ?> </td> </tr> +<?php endif; ?> + <?php /* XXX - Stub in the HW monitor for net4801 - needs to use platform var's once we start using them */ $is4801 = `/sbin/dmesg -a | grep NET4801`; |