diff options
author | Stephen Beaver <sbeaver@netgate.com> | 2015-09-16 08:31:20 -0400 |
---|---|---|
committer | Stephen Beaver <sbeaver@netgate.com> | 2015-09-16 08:31:56 -0400 |
commit | f438135364e7e4d5713c0a44399b1cb166255f25 (patch) | |
tree | 45d674b136021a1f3f1c595f9d9deec2480571dd /src/usr/local/www/interfaces.php | |
parent | cc493d00395ad5e9b6f90c46b1882b3546c2b1ca (diff) | |
download | pfsense-f438135364e7e4d5713c0a44399b1cb166255f25.zip pfsense-f438135364e7e4d5713c0a44399b1cb166255f25.tar.gz |
Fixed #5147
JS added to provide DHCP preset functionality
Diffstat (limited to 'src/usr/local/www/interfaces.php')
-rw-r--r-- | src/usr/local/www/interfaces.php | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/src/usr/local/www/interfaces.php b/src/usr/local/www/interfaces.php index 95dc0bd..c6ca821 100644 --- a/src/usr/local/www/interfaces.php +++ b/src/usr/local/www/interfaces.php @@ -3674,6 +3674,37 @@ events.push(function(){ show_dhcp6adv(); }); + // DHCP preset actions + // Set presets from value of radio buttons + function setPresets(val) { + // timeout, retry, select-timeout, reboot, backoff-cutoff, initial-interval + if (val == "DHCP") setPresetsnow("60", "300", "0", "10", "120", "10"); + if (val == "pfSense") setPresetsnow("60", "15", "0", "", "", "1"); + if (val == "SavedCfg") setPresetsnow("<?=htmlspecialchars($pconfig['adv_dhcp_pt_timeout']);?>", "<?=htmlspecialchars($pconfig['adv_dhcp_pt_retry']);?>", "<?=htmlspecialchars($pconfig['adv_dhcp_pt_select_timeout']);?>", "<?=htmlspecialchars($pconfig['adv_dhcp_pt_reboot']);?>", "<?=htmlspecialchars($pconfig['adv_dhcp_pt_backoff_cutoff']);?>", "<?=htmlspecialchars($pconfig['adv_dhcp_pt_initial_interval']);?>"); + if (val == "Clear") setPresetsnow("", "", "", "", "", ""); + } + + function setPresetsnow(timeout, retry, selecttimeout, reboot, backoffcutoff, initialinterval) { + $('#adv_dhcp_pt_timeout').val(timeout); + $('#adv_dhcp_pt_retry').val(retry); + $('#adv_dhcp_pt_select_timeout').val(selecttimeout); + $('#adv_dhcp_pt_reboot').val(reboot); + $('#adv_dhcp_pt_backoff_cutoff').val(backoffcutoff); + $('#adv_dhcp_pt_initial_interval').val(initialinterval); + } + + // Set preset buttons on page load + var sv = "<?=htmlspecialchars($pconfig['adv_dhcp_pt_values']);?>"; + if(sv == "") + $("input[name=adv_dhcp_pt_values][value='SavedCfg']").prop('checked', true); + + // Set preset from value + setPresets(sv); + + // On click . . + $('[id=adv_dhcp_pt_values]').click(function () { + setPresets($('input[name=adv_dhcp_pt_values]:checked').val()); + }); }); //]]> </script> |