summaryrefslogtreecommitdiffstats
path: root/usr/local/www/widgets
diff options
context:
space:
mode:
authorPhil Davis <phil.davis@inf.org>2014-12-20 22:53:58 +0545
committerRenato Botelho <garga@FreeBSD.org>2014-12-23 09:09:24 -0200
commitd4b3c264d16664991d33e380b2776b96f4fef95a (patch)
tree09e30000d1237c0e96523a2c786055aa04fba75b /usr/local/www/widgets
parent490810ed531162f5a99923024d676568e3ee2658 (diff)
downloadpfsense-d4b3c264d16664991d33e380b2776b96f4fef95a.zip
pfsense-d4b3c264d16664991d33e380b2776b96f4fef95a.tar.gz
Interfaces widget create all div
All div for the various things need to be created here, so that later AJAX can switch the necessary things on/off and write a new IPv4 or IPv6 address into the div when an interface acquires an address.
Diffstat (limited to 'usr/local/www/widgets')
-rw-r--r--usr/local/www/widgets/widgets/interfaces.widget.php49
1 files changed, 24 insertions, 25 deletions
diff --git a/usr/local/www/widgets/widgets/interfaces.widget.php b/usr/local/www/widgets/widgets/interfaces.widget.php
index 4cdee4e..99d52d9 100644
--- a/usr/local/www/widgets/widgets/interfaces.widget.php
+++ b/usr/local/www/widgets/widgets/interfaces.widget.php
@@ -59,19 +59,22 @@ foreach ($ifdescrs as $ifdescr => $ifname):
$icon = 'cablenic';
if ($ifinfo['status'] == "up" || $ifinfo['status'] == "associated") {
- $status = '-up';
- $status_text = 'up';
- $status_icon = 'icon_interface_up.gif';
+ $known_status = true;
+ $up_display = "inline";
+ $down_display = "none";
+ $block_display = "none";
} elseif ($ifinfo['status'] == "no carrier") {
- $status = '-down';
- $status_text = 'down';
- $status_icon = 'icon_interface_down.gif';
+ $known_status = true;
+ $up_display = "none";
+ $down_display = "inline";
+ $block_display = "none";
} elseif ($ifinfo['status'] == "down") {
- $status = '-block';
- $status_text = 'disabled';
- $status_icon = 'icon_block.gif';
+ $known_status = true;
+ $up_display = "none";
+ $down_display = "none";
+ $block_display = "inline";
} else
- $status = '';
+ $known_status = false;
?>
<tr>
<td class="vncellt" rowspan="2">
@@ -85,16 +88,22 @@ foreach ($ifdescrs as $ifdescr => $ifname):
?>
</td>
<?php
- if ($status === ''):
- echo htmlspecialchars($ifinfo['status']);
- else:
+ if ($known_status):
?>
<td rowspan="2" class="listr" align="center">
- <div id="<?php echo $ifname . $status;?>" style="display:inline" >
- <img src="./themes/<?= $g['theme']; ?>/images/icons/<?=$status_icon;?>" title="<?=$ifname;?> is <?=$status_text;?>" alt="<?=$status;?>" />
+ <div id="<?php echo $ifname . "-up";?>" style="display:<?=$up_display;?>" >
+ <img src="./themes/<?= $g['theme']; ?>/images/icons/icon_interface_up.gif" title="<?=$ifname;?> is up" alt="up" />
+ </div>
+ <div id="<?php echo $ifname . "-down";?>" style="display:<?=$down_display;?>" >
+ <img src="./themes/<?= $g['theme']; ?>/images/icons/icon_interface_down.gif" title="<?=$ifname;?> is down" alt="down" />
+ </div>
+ <div id="<?php echo $ifname . "-block";?>" style="display:<?=$block_display;?>" >
+ <img src="./themes/<?= $g['theme']; ?>/images/icons/icon_block.gif" title="<?=$ifname;?> is disabled" alt="block" />
</div>
</td>
<?php
+ else:
+ echo htmlspecialchars($ifinfo['status']);
endif;
?>
<td class="listr">
@@ -103,19 +112,9 @@ foreach ($ifdescrs as $ifdescr => $ifname):
</tr>
<tr>
<td class="listr">
-<?php
- if($ifinfo['ipaddr'] != ""):
-?>
<div id="<?php echo $ifname;?>-ip" style="display:inline"><strong><?=htmlspecialchars($ifinfo['ipaddr']);?> </strong></div>
<br />
-<?php
- endif;
- if ($ifinfo['ipaddrv6'] != ""):
-?>
<div id="<?php echo $ifname;?>-ipv6" style="display:inline"><strong><?=htmlspecialchars($ifinfo['ipaddrv6']);?> </strong></div>
-<?php
- endif;
-?>
</td>
</tr>
<?php
OpenPOWER on IntegriCloud