summaryrefslogtreecommitdiffstats
path: root/usr/local/www/index.php
diff options
context:
space:
mode:
authorScott Ullrich <sullrich@pfsense.org>2005-05-23 13:44:09 +0000
committerScott Ullrich <sullrich@pfsense.org>2005-05-23 13:44:09 +0000
commit8fecad112914a8a1425b41f5f7ec3452f61d25e3 (patch)
tree148a8c44635dfa791d5a6cb1590273d89a50dda4 /usr/local/www/index.php
parent2733ae78876fc53855cbb46e504ad9deb577b0bb (diff)
downloadpfsense-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/index.php')
-rwxr-xr-xusr/local/www/index.php9
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`;
OpenPOWER on IntegriCloud