summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorRenato Botelho <renato@netgate.com>2016-07-13 19:01:27 -0300
committerRenato Botelho <renato@netgate.com>2016-07-13 19:01:27 -0300
commit0666f04efd1e2c6e22ce73d7817aff7168ab54ab (patch)
tree4b23b0c02466d43ac9c94548c4796ca995c82c49 /src
parent9da88ef5a1eceddcaa149e0d196addcbf7e9fb3f (diff)
parent68de2169b9d5cd2878d43344a0fc0a25bd86d7af (diff)
downloadpfsense-0666f04efd1e2c6e22ce73d7817aff7168ab54ab.zip
pfsense-0666f04efd1e2c6e22ce73d7817aff7168ab54ab.tar.gz
Merge pull request #3052 from phil-davis/patch-3
Diffstat (limited to 'src')
-rw-r--r--src/usr/local/www/services_dhcp.php148
1 files changed, 97 insertions, 51 deletions
diff --git a/src/usr/local/www/services_dhcp.php b/src/usr/local/www/services_dhcp.php
index 6bff118..4e20f1e 100644
--- a/src/usr/local/www/services_dhcp.php
+++ b/src/usr/local/www/services_dhcp.php
@@ -1145,6 +1145,63 @@ $section->addInput(new Form_Input(
$pconfig['ldap']
))->setHelp('Leave blank to disable. Enter a full URI for the LDAP server in the form ldap://ldap.example.com/dc=example,dc=com ');
+// Advanced Network Booting options
+$btnadv = new Form_Button(
+ 'btnadvnwkboot',
+ 'Display Advanced',
+ null,
+ 'fa-cog'
+);
+
+$btnadv->setAttribute('type','button')->addClass('btn-info btn-sm');
+
+$section->addInput(new Form_StaticText(
+ 'Network Booting',
+ $btnadv
+));
+
+$section->addInput(new Form_Checkbox(
+ 'netboot',
+ 'Enable',
+ 'Enables network booting',
+ $pconfig['netboot']
+));
+
+$section->addInput(new Form_IpAddress(
+ 'nextserver',
+ 'Next Server',
+ $pconfig['nextserver']
+))->setHelp('Enter the IP address of the next server');
+
+$section->addInput(new Form_Input(
+ 'filename',
+ 'Default BIOS file name',
+ 'text',
+ $pconfig['filename']
+));
+
+$section->addInput(new Form_Input(
+ 'filename32',
+ 'UEFI 32 bit file name',
+ 'text',
+ $pconfig['filename32']
+));
+
+$section->addInput(new Form_Input(
+ 'filename64',
+ 'UEFI 64 bit file name',
+ 'text',
+ $pconfig['filename64']
+))->setHelp('Both a filename and a boot server must be configured for this to work! ' .
+ 'All three filenames and a configured boot server are necessary for UEFI to work! ');
+
+$section->addInput(new Form_Input(
+ 'rootpath',
+ 'Root path',
+ 'text',
+ $pconfig['rootpath']
+))->setHelp('string-format: iscsi:(servername):(protocol):(port):(LUN):targetname ');
+
// Advanced Additional options
$btnadv = new Form_Button(
'btnadvopts',
@@ -1237,57 +1294,6 @@ $section->addInput(new Form_Button(
$form->add($section);
-if ($pconfig['netboot']) {
- $sectate = COLLAPSIBLE|SEC_OPEN;
-} else {
- $sectate = COLLAPSIBLE|SEC_CLOSED;
-}
-$section = new Form_Section("Network Booting", nwkbootsec, $sectate);
-
-$section->addInput(new Form_Checkbox(
- 'netboot',
- 'Enable',
- 'Enables network booting',
- $pconfig['netboot']
-));
-
-$section->addInput(new Form_IpAddress(
- 'nextserver',
- 'Next Server',
- $pconfig['nextserver']
-))->setHelp('Enter the IP address of the next server');
-
-$section->addInput(new Form_Input(
- 'filename',
- 'Default BIOS file name',
- 'text',
- $pconfig['filename']
-));
-
-$section->addInput(new Form_Input(
- 'filename32',
- 'UEFI 32 bit file name',
- 'text',
- $pconfig['filename32']
-));
-
-$section->addInput(new Form_Input(
- 'filename64',
- 'UEFI 64 bit file name',
- 'text',
- $pconfig['filename64']
-))->setHelp('Both a filename and a boot server must be configured for this to work! ' .
- 'All three filenames and a configured boot server are necessary for UEFI to work! ');
-
-$section->addInput(new Form_Input(
- 'rootpath',
- 'Root path',
- 'text',
- $pconfig['rootpath']
-))->setHelp('string-format: iscsi:(servername):(protocol):(port):(LUN):targetname ');
-
-$form->add($section);
-
if ($act == "newpool") {
$form->addGlobal(new Form_Input(
'act',
@@ -1603,6 +1609,45 @@ events.push(function() {
show_advopts();
});
+ // Show advanced Network Booting options ===========================================================================
+ var showadvnwkboot = false;
+
+ function show_advnwkboot(ispageload) {
+ var text;
+ // On page load decide the initial state based on the data.
+ if (ispageload) {
+<?php
+ if (empty($pconfig['netboot'])) {
+ $showadv = false;
+ } else {
+ $showadv = true;
+ }
+?>
+ showadvnwkboot = <?php if ($showadv) {echo 'true';} else {echo 'false';} ?>;
+ } else {
+ // It was a click, swap the state.
+ showadvnwkboot = !showadvnwkboot;
+ }
+
+ hideCheckbox('netboot', !showadvnwkboot);
+ hideInput('nextserver', !showadvnwkboot);
+ hideInput('filename', !showadvnwkboot);
+ hideInput('filename32', !showadvnwkboot);
+ hideInput('filename64', !showadvnwkboot);
+ hideInput('rootpath', !showadvnwkboot);
+
+ if (showadvnwkboot) {
+ text = "<?=gettext('Hide Advanced');?>";
+ } else {
+ text = "<?=gettext('Display Advanced');?>";
+ }
+ $('#btnadvnwkboot').html('<i class="fa fa-cog"></i> ' + text);
+ }
+
+ $('#btnadvnwkboot').click(function(event) {
+ show_advnwkboot();
+ });
+
// ---------- On initial page load ------------------------------------------------------------
show_advdns(true);
@@ -1611,6 +1656,7 @@ events.push(function() {
show_advtftp(true);
show_advldap(true);
show_advopts(true);
+ show_advnwkboot(true);
// Suppress "Delete row" button if there are fewer than two rows
checkLastRow();
OpenPOWER on IntegriCloud