diff options
author | Chris Buechler <cmb@pfsense.org> | 2014-12-22 17:41:16 -0600 |
---|---|---|
committer | Chris Buechler <cmb@pfsense.org> | 2014-12-22 17:41:16 -0600 |
commit | f2087b77d82352de5230c5f429d9dbfb74bee140 (patch) | |
tree | 34e3af386cc7a9215e1bf1e21f87b2effbf7bf36 /usr/local | |
parent | b5d827f644b3ae4fbd9e7a58d6e4bb1e34897fed (diff) | |
parent | fe416714b988023bf3a985643936ebfa5584c793 (diff) | |
download | pfsense-f2087b77d82352de5230c5f429d9dbfb74bee140.zip pfsense-f2087b77d82352de5230c5f429d9dbfb74bee140.tar.gz |
Merge pull request #1397 from phil-davis/patch-15
Diffstat (limited to 'usr/local')
-rw-r--r-- | usr/local/www/includes/functions.inc.php | 5 | ||||
-rw-r--r-- | usr/local/www/javascript/index/ajax.js | 20 | ||||
-rw-r--r-- | usr/local/www/widgets/widgets/interfaces.widget.php | 52 |
3 files changed, 42 insertions, 35 deletions
diff --git a/usr/local/www/includes/functions.inc.php b/usr/local/www/includes/functions.inc.php index f2d8cf0..4a212ec 100644 --- a/usr/local/www/includes/functions.inc.php +++ b/usr/local/www/includes/functions.inc.php @@ -336,7 +336,10 @@ function get_interfacestatus() { } $data .= ","; if ($ifinfo['ipaddr']) - $data .= htmlspecialchars($ifinfo['ipaddr']); + $data .= "<strong>" . htmlspecialchars($ifinfo['ipaddr']) . "</strong>"; + $data .= ","; + if ($ifinfo['ipaddrv6']) + $data .= "<strong>" . htmlspecialchars($ifinfo['ipaddrv6']) . "</strong>"; $data .= ","; if ($ifinfo['status'] != "down") $data .= htmlspecialchars($ifinfo['media']); diff --git a/usr/local/www/javascript/index/ajax.js b/usr/local/www/javascript/index/ajax.js index 47c1ee7..d2ac90e 100644 --- a/usr/local/www/javascript/index/ajax.js +++ b/usr/local/www/javascript/index/ajax.js @@ -150,25 +150,31 @@ function updateInterfaces(x){ interfaces_split = x.split("~"); interfaces_split.each(function(iface){ details = iface.split(","); + if (details[2] == '') + ipv4_details = ''; + else + ipv4_details = details[2] + '<br />'; switch(details[1]) { case "up": jQuery('#' + details[0] + '-up').css("display","inline"); jQuery('#' + details[0] + '-down').css("display","none"); jQuery('#' + details[0] + '-block').css("display","none"); - jQuery('#' + details[0] + '-ip').html(details[2]); - jQuery('#' + details[0] + '-media').html(details[3]); + jQuery('#' + details[0] + '-ip').html(ipv4_details); + jQuery('#' + details[0] + '-ipv6').html(details[3]); + jQuery('#' + details[0] + '-media').html(details[4]); break; case "down": jQuery('#' + details[0] + '-down').css("display","inline"); jQuery('#' + details[0] + '-up').css("display","none"); jQuery('#' + details[0] + '-block').css("display","none"); - jQuery('#' + details[0] + '-ip').html(details[2]); - jQuery('#' + details[0] + '-media').html(details[3]); + jQuery('#' + details[0] + '-ip').html(ipv4_details); + jQuery('#' + details[0] + '-ipv6').html(details[3]); + jQuery('#' + details[0] + '-media').html(details[4]); break; case "block": - jQuery('#' + details[0] + '-block').css("display","inline"); - jQuery('#' + details[0] + '-down').css("display","none"); - jQuery('#' + details[0] + '-up').css("display","none"); + jQuery('#' + details[0] + '-block').css("display","inline"); + jQuery('#' + details[0] + '-down').css("display","none"); + jQuery('#' + details[0] + '-up').css("display","none"); break; } }); diff --git a/usr/local/www/widgets/widgets/interfaces.widget.php b/usr/local/www/widgets/widgets/interfaces.widget.php index 4cdee4e..8dbcad0 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,8 @@ 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;?>-ip" style="display:inline"><strong><?=htmlspecialchars($ifinfo['ipaddr']);?> </strong><?php if ($ifinfo['ipaddr']) echo "<br />";?></div> <div id="<?php echo $ifname;?>-ipv6" style="display:inline"><strong><?=htmlspecialchars($ifinfo['ipaddrv6']);?> </strong></div> -<?php - endif; -?> </td> </tr> <?php |