From 8fecad112914a8a1425b41f5f7ec3452f61d25e3 Mon Sep 17 00:00:00 2001 From: Scott Ullrich Date: Mon, 23 May 2005 13:44:09 +0000 Subject: Do not show swap graph unless a swap partition is loaded Fixes Ticket #93 --- usr/local/www/index.php | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'usr/local/www') 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 " + + SWAP usage @@ -262,6 +267,8 @@ echo " + +