Project

General

Profile

« Previous | Next » 

Revision 8fecad11

Added by Scott Ullrich about 20 years ago

Do not show swap graph unless a swap partition is loaded

Fixes Ticket #93

View differences:

usr/local/www/index.php
34 34

  
35 35
require("guiconfig.inc");
36 36

  
37
$swapinfo = `/usr/sbin/swapinfo`;
38
if(stristr($swapinfo,"%") == true) $showswap=true;
39

  
37 40
if(file_exists("/usr/local/www/trigger_initial_wizard")) {
38 41
	conf_mount_rw();
39 42
	unlink("/usr/local/www/trigger_initial_wizard");
......
120 123

  
121 124
function get_pfstate() {
122 125
	global $config, $g;
123
        if (isset($config['system']['maximumstates']))
126
        if (isset($config['system']['maximumstates']) and $config['system']['maximumstates'] > 0)
124 127
                $maxstates="/{$config['system']['maximumstates']}";
125 128
        else
126 129
                $maxstates="/10000";
......
241 244
?>
242 245
                </td>
243 246
              </tr>
247
	      
248
<?php if($showswap == true): ?>
244 249
			  <tr>
245 250
                <td width="25%" class="vncellt">SWAP usage</td>
246 251
                <td width="75%" class="listr">
......
262 267
?>
263 268
                </td>
264 269
              </tr>
270
<?php endif; ?>
271

  
265 272
<?php
266 273
	/* XXX - Stub in the HW monitor for net4801 - needs to use platform var's once we start using them */
267 274
	$is4801 = `/sbin/dmesg -a | grep NET4801`;

Also available in: Unified diff