summaryrefslogtreecommitdiffstats
path: root/usr/local/www/widgets/widgets
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
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')
-rw-r--r--usr/local/www/widgets/widgets/interfaces.widget.php56
-rw-r--r--usr/local/www/widgets/widgets/log.widget.php41
2 files changed, 97 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
diff --git a/usr/local/www/widgets/widgets/log.widget.php b/usr/local/www/widgets/widgets/log.widget.php
new file mode 100644
index 0000000..3e6259f
--- /dev/null
+++ b/usr/local/www/widgets/widgets/log.widget.php
@@ -0,0 +1,41 @@
+<div class="log-header">
+ <span class="log-action-mini-header">Act</span>
+ <span class="log-interface-mini-header">IF</span>
+ <span class="log-source-mini-header">Source</span>
+ <span class="log-destination-mini-header">Destination</span>
+ <span class="log-protocol-mini-header">Proto</span>
+</div>
+<?php $counter=0; foreach ($filterlog as $filterent): ?>
+<?php
+ if(isset($config['syslog']['reverse'])) {
+ /* honour reverse logging setting */
+ if($counter == 0)
+ $activerow = " id=\"firstrow\"";
+ else
+ $activerow = "";
+
+ } else {
+ /* non-reverse logging */
+ if($counter == count($filterlog))
+ $activerow = " id=\"firstrow\"";
+ else
+ $activerow = "";
+ }
+?>
+<div class="log-entry-mini" <?php echo $activerow; ?> style="clear:both;">
+ <span class="log-action-mini" nowrap>
+ <?php
+ if (strstr(strtolower($filterent['act']), "p"))
+ $img = "/themes/metallic/images/icons/icon_pass.gif";
+ else if(strstr(strtolower($filterent['act']), "r"))
+ $img = "/themes/metallic/images/icons/icon_reject.gif";
+ else
+ $img = "/themes/metallic/images/icons/icon_block.gif";
+ ?>
+ &nbsp;<img border="0" src="<?=$img;?>">&nbsp;</span>
+ <span class="log-interface-mini" ><?=htmlspecialchars(convert_real_interface_to_friendly_interface_name($filterent['interface']));?></span>
+ <span class="log-source-mini" ><?=htmlspecialchars($filterent['src']);?></span>
+ <span class="log-destination-mini" ><?=htmlspecialchars($filterent['dst']);?></span>
+ <span class="log-protocol-mini" ><?=htmlspecialchars($filterent['proto']);?></span>
+</div>
+<?php $counter++; endforeach; ?> \ No newline at end of file
OpenPOWER on IntegriCloud