summaryrefslogtreecommitdiffstats
path: root/usr/local/www/widgets/widgets/gateways.widget.php
diff options
context:
space:
mode:
authorRenato Botelho <garga@FreeBSD.org>2013-02-05 10:13:30 -0200
committerRenato Botelho <garga@FreeBSD.org>2013-02-05 10:13:30 -0200
commitee132ba1db9cfa49b60a5f32e49ced29d366bf35 (patch)
tree4cc1a0ee9a990a86f0567d4b4d0f4db9a89ce2e5 /usr/local/www/widgets/widgets/gateways.widget.php
parentdd82d25229d129166d74f339b287ddb5b8b34c45 (diff)
downloadpfsense-ee132ba1db9cfa49b60a5f32e49ced29d366bf35.zip
pfsense-ee132ba1db9cfa49b60a5f32e49ced29d366bf35.tar.gz
Change gateways widget layout to better accomodate long ipv6 addresses. It should fix #2790
Diffstat (limited to 'usr/local/www/widgets/widgets/gateways.widget.php')
-rw-r--r--usr/local/www/widgets/widgets/gateways.widget.php148
1 files changed, 80 insertions, 68 deletions
diff --git a/usr/local/www/widgets/widgets/gateways.widget.php b/usr/local/www/widgets/widgets/gateways.widget.php
index a360004..94a437f 100644
--- a/usr/local/www/widgets/widgets/gateways.widget.php
+++ b/usr/local/www/widgets/widgets/gateways.widget.php
@@ -42,78 +42,90 @@ $counter = 1;
?>
<table bgcolor="#990000" width="100%" border="0" cellspacing="0" cellpadding="0">
- <tr>
- <td width="10%" class="listhdrr">Name</td>
- <td width="10%" class="listhdrr">Gateway</td>
- <td width="10%" class="listhdrr">RTT</td>
- <td width="10%" class="listhdrr">Loss</td>
- <td width="30%" class="listhdrr">Status</td>
- </tr>
<?php foreach ($a_gateways as $gname => $gateway) { ?>
<tr>
- <td class="listlr" id="gateway<?= $counter; ?>">
- <?=$gateway['name'];?>
+ <td class="vncellt" width="30%" id="gateway<?php echo $counter; ?>">
+ <strong>
+ <?php echo htmlspecialchars($gateway['name']); ?>
+ </strong>
<?php $counter++; ?>
</td>
- <td class="listr" align="center" id="gateway<?= $counter; ?>">
- <?php
- if (is_ipaddr($gateway['gateway']))
- echo $gateway['gateway'];
- else {
- if($gateway['ipprotocol'] == "inet")
- echo get_interface_gateway($gateway['friendlyiface']);
- if($gateway['ipprotocol'] == "inet6")
- echo get_interface_gateway_v6($gateway['friendlyiface']);
- }
- ?>
- <?php $counter++; ?>
- </td>
- <td class="listr" align="center" id="gateway<?= $counter; ?>">
- <?php
- if ($gateways_status[$gname])
- echo $gateways_status[$gname]['delay'];
- else
- echo gettext("Pending");
- ?>
- <?php $counter++; ?>
- </td>
- <td class="listr" align="center" id="gateway<?= $counter; ?>">
- <?php
- if ($gateways_status[$gname])
- echo $gateways_status[$gname]['loss'];
- else
- echo gettext("Pending");
- ?>
- <?php $counter++; ?>
- </td>
- <td class="listr" id="gateway<?=$counter?>" >
- <table border="0" cellpadding="0" cellspacing="2">
- <?php
- if ($gateways_status[$gname]) {
- if (stristr($gateways_status[$gname]['status'], "down")) {
- $online = "Offline";
- $bgcolor = "#F08080"; // lightcoral
- } elseif (stristr($gateways_status[$gname]['status'], "loss")) {
- $online = "Packetloss";
- $bgcolor = "#F0E68C"; // khaki
- } elseif (stristr($gateways_status[$gname]['status'], "delay")) {
- $online = "Latency";
- $bgcolor = "#F0E68C"; // khaki
- } elseif ($gateways_status[$gname]['status'] == "none") {
- $online = "Online";
- $bgcolor = "#90EE90"; // lightgreen
- } elseif ($gateways_status[$gname]['status'] == "") {
- $online = "Pending";
- $bgcolor = "#D3D3D3"; // lightgray
- }
- } else {
- $online = gettext("Unknown");
- $bgcolor = "#ADD8E6"; // lightblue
- }
- echo "<tr><td bgcolor=\"$bgcolor\">&nbsp;$online&nbsp;</td></tr>\n";
- $counter++;
- ?>
- </table>
+ <td width="70%" class="listr">
+ <table width="100%" border="0" cellspacing="0" cellpadding="0">
+ <tr>
+ <td class="vncellt" width="100%">
+ <div id="gateway<?php echo $counter; ?>" style="display:inline">
+ <?php
+ if (is_ipaddr($gateway['gateway']))
+ echo htmlspecialchars($gateway['gateway']);
+ else {
+ if($gateway['ipprotocol'] == "inet")
+ echo htmlspecialchars(get_interface_gateway($gateway['friendlyiface']));
+ if($gateway['ipprotocol'] == "inet6")
+ echo htmlspecialchars(get_interface_gateway_v6($gateway['friendlyiface']));
+ }
+ $counter++;
+ ?>
+ </div>
+ </td>
+ </tr>
+ </table>
+ <table width="100%" border="0" cellspacing="0" cellpadding="0">
+ <tr>
+ <td width="20%" class="listhdrr">RTT</td>
+ <td width="20%" class="listhdrr">Loss</td>
+ <td width="60%" class="listhdrr">Status</td>
+ </tr>
+ <tr>
+ <td class="listlr" align="center" id="gateway<?php echo $counter; ?>">
+ <?php
+ if ($gateways_status[$gname])
+ echo htmlspecialchars($gateways_status[$gname]['delay']);
+ else
+ echo gettext("Pending");
+ ?>
+ <?php $counter++; ?>
+ </td>
+ <td class="listr" align="center" id="gateway<?php echo $counter; ?>">
+ <?php
+ if ($gateways_status[$gname])
+ echo htmlspecialchars($gateways_status[$gname]['loss']);
+ else
+ echo gettext("Pending");
+ ?>
+ <?php $counter++; ?>
+ </td>
+ <td class="listr" id="gateway<?php echo $counter ?>" >
+ <table border="0" cellpadding="0" cellspacing="2">
+ <?php
+ if ($gateways_status[$gname]) {
+ if (stristr($gateways_status[$gname]['status'], "down")) {
+ $online = "Offline";
+ $bgcolor = "#F08080"; // lightcoral
+ } elseif (stristr($gateways_status[$gname]['status'], "loss")) {
+ $online = "Packetloss";
+ $bgcolor = "#F0E68C"; // khaki
+ } elseif (stristr($gateways_status[$gname]['status'], "delay")) {
+ $online = "Latency";
+ $bgcolor = "#F0E68C"; // khaki
+ } elseif ($gateways_status[$gname]['status'] == "none") {
+ $online = "Online";
+ $bgcolor = "#90EE90"; // lightgreen
+ } elseif ($gateways_status[$gname]['status'] == "") {
+ $online = "Pending";
+ $bgcolor = "#D3D3D3"; // lightgray
+ }
+ } else {
+ $online = gettext("Unknown");
+ $bgcolor = "#ADD8E6"; // lightblue
+ }
+ echo "<tr><td bgcolor=\"$bgcolor\">&nbsp;$online&nbsp;</td></tr>\n";
+ $counter++;
+ ?>
+ </table>
+ </td>
+ </tr>
+ </table>
</td>
</tr>
<?php } // foreach ?>
OpenPOWER on IntegriCloud