From 564599fa0923be91b465c642f9f9783476f86853 Mon Sep 17 00:00:00 2001 From: Stephen Beaver Date: Wed, 11 Nov 2015 11:19:34 -0500 Subject: Various changes in pursuit of tracking down slow page load. As yet not effective :( --- src/usr/local/www/interfaces.php | 174 ++++++++++++++++++++------------------- 1 file changed, 90 insertions(+), 84 deletions(-) (limited to 'src/usr/local') diff --git a/src/usr/local/www/interfaces.php b/src/usr/local/www/interfaces.php index e945b11..6761d67 100644 --- a/src/usr/local/www/interfaces.php +++ b/src/usr/local/www/interfaces.php @@ -124,12 +124,14 @@ function remove_bad_chars($string) { if (!is_array($config['gateways']['gateway_item'])) { $config['gateways']['gateway_item'] = array(); } + $a_gateways = &$config['gateways']['gateway_item']; $wancfg = &$config['interfaces'][$if]; $old_wancfg = $wancfg; $old_wancfg['realif'] = get_real_interface($if); $old_ppps = $a_ppps; + // Populate page descr if it does not exist. if ($if == "wan" && !$wancfg['descr']) { $wancfg['descr'] = "WAN"; @@ -220,6 +222,7 @@ if ($wancfg['if'] == $a_ppps[$pppid]['if']) { $pconfig['ptpid'] = interfaces_ptpid_next(); $pppid = count($a_ppps); } + $pconfig['dhcphostname'] = $wancfg['dhcphostname']; $pconfig['alias-address'] = $wancfg['alias-address']; $pconfig['alias-subnet'] = $wancfg['alias-subnet']; @@ -361,8 +364,6 @@ switch ($wancfg['ipaddrv6']) { break; } -// print_r($pconfig); - $pconfig['blockpriv'] = isset($wancfg['blockpriv']); $pconfig['blockbogons'] = isset($wancfg['blockbogons']); $pconfig['spoofmac'] = $wancfg['spoofmac']; @@ -1893,56 +1894,6 @@ $section->add($group); $form->add($section); -// Add new gateway modal pop-up -$modal = new Modal('New gateway', 'newgateway', 'large'); - -$modal->addInput(new Form_Checkbox( - 'defaultgw', - 'Default', - 'Default gateway', - ($if == "wan" || $if == "WAN") -)); - -$modal->addInput(new Form_Input( - 'name', - 'Gateway name', - 'text', - $wancfg['descr'] . "GW" -)); - -$modal->addInput(new Form_IpAddress( - 'gatewayip', - 'Gateway IPv4', - null -)); - -$modal->addInput(new Form_Input( - 'gatewaydescr', - 'Description', - 'text' -)); - -$btnaddgw = new Form_Button( - 'add', - 'Add' -); - -$btnaddgw->removeClass('btn-primary')->addClass('btn-success'); - -$btncnxgw = new Form_Button( - 'cnx', - 'Cancel' -); - -$btncnxgw->removeClass('btn-primary')->addClass('btn-default'); - -$modal->addInput(new Form_StaticText( - null, - $btnaddgw . $btncnxgw -)); - -$form->add($modal); - $section = new Form_Section('Static IPv6 configuration'); $section->addClass('staticv6'); @@ -3326,25 +3277,80 @@ $form->addGlobal(new Form_Input( $pconfig['ptpid'] )); + +// Add new gateway modal pop-up +$modal = new Modal('New gateway', 'newgateway', 'large'); + +$modal->addInput(new Form_Checkbox( + 'defaultgw', + 'Default', + 'Default gateway', + ($if == "wan" || $if == "WAN") +)); + +$modal->addInput(new Form_Input( + 'name', + 'Gateway name', + 'text', + $wancfg['descr'] . "GW" +)); + +$modal->addInput(new Form_IpAddress( + 'gatewayip', + 'Gateway IPv4', + null +)); + +$modal->addInput(new Form_Input( + 'gatewaydescr', + 'Description', + 'text' +)); + +$btnaddgw = new Form_Button( + 'add', + 'Add' +); + +$btnaddgw->removeClass('btn-primary')->addClass('btn-success'); + +$btncnxgw = new Form_Button( + 'cnx', + 'Cancel' +); + +$btncnxgw->removeClass('btn-primary')->addClass('btn-default'); + +$modal->addInput(new Form_StaticText( + null, + $btnaddgw . $btncnxgw +)); + +$form->add($modal); + print($form); ?> -- cgit v1.1