summaryrefslogtreecommitdiffstats
path: root/usr/local/www/widgets/widgets/interfaces.widget.php
diff options
context:
space:
mode:
authorScott Dale <sdale@pfsense.org>2007-05-07 02:21:35 +0000
committerScott Dale <sdale@pfsense.org>2007-05-07 02:21:35 +0000
commit1db766dfbeaee353cbafbce8926d359454994415 (patch)
tree0b8e7d6cd608966dddf8167998ecda3a32daa9d1 /usr/local/www/widgets/widgets/interfaces.widget.php
parentaacd6b3dcc8bc76c3d7f54945a8092121d2cdd1c (diff)
downloadpfsense-1db766dfbeaee353cbafbce8926d359454994415.zip
pfsense-1db766dfbeaee353cbafbce8926d359454994415.tar.gz
Widget base. Note: changes to widgets are not saved yet.
Diffstat (limited to 'usr/local/www/widgets/widgets/interfaces.widget.php')
-rw-r--r--usr/local/www/widgets/widgets/interfaces.widget.php56
1 files changed, 56 insertions, 0 deletions
diff --git a/usr/local/www/widgets/widgets/interfaces.widget.php b/usr/local/www/widgets/widgets/interfaces.widget.php
new file mode 100644
index 0000000..1ebaa95
--- /dev/null
+++ b/usr/local/www/widgets/widgets/interfaces.widget.php
@@ -0,0 +1,56 @@
+<?php $i = 0; $ifdescrs = array('wan' => 'WAN', 'lan' => 'LAN');
+ for ($j = 1; isset($config['interfaces']['opt' . $j]); $j++) {
+ $ifdescrs['opt' . $j] = $config['interfaces']['opt' . $j]['descr'];
+ }?>
+
+ <table bgcolor="#990000" width="100%" border="0" cellspacing="0" cellpadding="0">
+ <?php
+ $counter = 1;
+ foreach ($ifdescrs as $ifdescr => $ifname){
+ $ifinfo = get_interface_info($ifdescr);
+ $iswireless = is_interface_wireless($ifdescr);
+ ?>
+ <tr>
+ <td class="vncellt" width="30%">
+ <?php if($iswireless) {
+ if($ifinfo['status'] == "associated") { ?>
+ <img src="./themes/<?= $g['theme']; ?>/images/icons/icon_wlan.gif" />
+ <? } else { ?>
+ <img src="./themes/<?= $g['theme']; ?>/images/icons/icon_wlan_d.gif" />
+ <? } ?>
+ <? } else { ?>
+ <img src="./themes/<?= $g['theme']; ?>/images/icons/icon_cablenic.gif"/>
+ <? } ?>&nbsp;
+ <strong>
+ <?php
+ if ($ifname == "WAN") { ?>
+ <a href="/interfaces_wan.php">
+ <? } else if ($ifname == "LAN") { ?>
+ <a href="/interfaces_lan.php">
+ <? } else { ?>
+ <a href="/interfaces_opt.php?index=<?=$counter; ?>">
+ <?
+ $counter++;
+ } ?>
+
+
+ <span style="color:#000000"><?=htmlspecialchars($ifname);?></span></a></strong>
+ </td>
+ <td width="70%" class="listr">
+
+ <?php if ($ifinfo['dhcplink'] != "down" && $ifinfo['pppoelink'] != "down" && $ifinfo['pptplink'] != "down"){ ?>
+ <?php if($ifinfo['status'] == "up") { ?>
+ <img src="./themes/<?= $g['theme']; ?>/images/icons/icon_pass.gif" title="<?=$ifname;?> is up" />&nbsp;
+ <? } else if ($ifinfo['status'] == "down") { ?>
+ <img src="./themes/<?= $g['theme']; ?>/images/icons/icon_block.gif" title="<?=$ifname;?> is down" />&nbsp;
+ <? } else if ($ifinfo['status'] == "associated") { ?>
+ <img src="./themes/<?= $g['theme']; ?>/images/icons/icon_pass.gif" title="<?=$ifname;?> is associated" />&nbsp;
+ <? } else { ?><?=htmlspecialchars($ifinfo['status']);
+ }?>
+ <?php if ($ifinfo['ipaddr']){ ?>
+ <?=htmlspecialchars($ifinfo['ipaddr']);}?>&nbsp;
+ <?=htmlspecialchars($ifinfo['media']);?>
+ </tr><?php }
+ }
+ ?>
+ </table> \ No newline at end of file
OpenPOWER on IntegriCloud