diff options
-rw-r--r-- | src/usr/local/www/widgets/widgets/gateways.widget.php | 26 |
1 files changed, 7 insertions, 19 deletions
diff --git a/src/usr/local/www/widgets/widgets/gateways.widget.php b/src/usr/local/www/widgets/widgets/gateways.widget.php index 46cb105..a5b5d1c 100644 --- a/src/usr/local/www/widgets/widgets/gateways.widget.php +++ b/src/usr/local/www/widgets/widgets/gateways.widget.php @@ -68,6 +68,12 @@ $a_gateways = return_gateways_array(); $gateways_status = array(); $gateways_status = return_gateways_status(true); +if (isset($config["widgets"]["gateways_widget"]["display_type"])) { + $display_type = $config["widgets"]["gateways_widget"]["display_type"]; +} else { + $display_type = "gw_ip"; +} + // Compose the table contents and pass it back to the ajax caller if($_REQUEST && $_REQUEST['ajax']) { global $a_gateways, $gateways_status; @@ -85,19 +91,7 @@ if($_REQUEST && $_REQUEST['ajax']) { foreach ($a_gateways as $gname => $gateway) { print("<tr>\n"); print( "<td>\n"); - - $if_gw = ''; - if (is_ipaddr($gateway['gateway'])) - $if_gw = $gateway['gateway']; - else { - if($gateway['ipprotocol'] == "inet") - $if_gw = get_interface_gateway($gateway['friendlyiface']); - if($gateway['ipprotocol'] == "inet6") - $if_gw = get_interface_gateway_v6($gateway['friendlyiface']); - } - print(htmlspecialchars($gateway['name']) . "<br />"); - print('<div id="gateway' . $counter . '" style="display:inline"><b>'); $monitor_address = ""; @@ -191,12 +185,6 @@ if ($_POST) { header("Location: /"); exit(0); } - -if (isset($config["widgets"]["gateways_widget"]["display_type"])) { - $display_type = $config["widgets"]["gateways_widget"]["display_type"]; -} else { - $display_type = "gw_ip"; -} ?> <table id="gwtbl" class="table table-hover"> @@ -266,4 +254,4 @@ if (isset($config["widgets"]["gateways_widget"]["display_type"])) { <br /><br /> <input id="submit_settings" name="submit_settings" type="submit" onclick="return updatePref();" class="formbtn" value="Save Settings" /> </form> -</div>
\ No newline at end of file +</div> |