mirror of
https://github.com/RaspAP/raspap-webgui.git
synced 2024-11-22 15:40:22 +00:00
Add advanced fields to JSON response
This commit is contained in:
parent
209d741363
commit
e4856484d9
3 changed files with 4 additions and 2 deletions
|
@ -21,7 +21,7 @@ if (isset($interface)) {
|
||||||
$dhcpdata['dhcpHost'] = is_array($dhcpHost) ? $dhcpHost : [ $dhcpHost ];
|
$dhcpdata['dhcpHost'] = is_array($dhcpHost) ? $dhcpHost : [ $dhcpHost ];
|
||||||
$upstreamServers = is_array($conf['server']) ? $conf['server'] : [ $conf['server'] ];
|
$upstreamServers = is_array($conf['server']) ? $conf['server'] : [ $conf['server'] ];
|
||||||
$dhcpdata['upstreamServers'] = array_filter($upstreamServers);
|
$dhcpdata['upstreamServers'] = array_filter($upstreamServers);
|
||||||
|
$dhcpdata['upstreamServersEnabled'] = empty($conf['server']) ? false: true;
|
||||||
preg_match('/([0-9]*)([a-z])/i', $dhcpdata['leaseTime'], $arrRangeLeaseTime);
|
preg_match('/([0-9]*)([a-z])/i', $dhcpdata['leaseTime'], $arrRangeLeaseTime);
|
||||||
$dhcpdata['leaseTime'] = $arrRangeLeaseTime[1];
|
$dhcpdata['leaseTime'] = $arrRangeLeaseTime[1];
|
||||||
$dhcpdata['leaseTimeInterval'] = $arrRangeLeaseTime[2];
|
$dhcpdata['leaseTimeInterval'] = $arrRangeLeaseTime[2];
|
||||||
|
|
|
@ -255,6 +255,8 @@ function loadInterfaceDHCPSelect() {
|
||||||
$('#txtdns1').val(jsonData.DNS1);
|
$('#txtdns1').val(jsonData.DNS1);
|
||||||
$('#txtdns2').val(jsonData.DNS2);
|
$('#txtdns2').val(jsonData.DNS2);
|
||||||
$('#cbxrangeleasetimeunits').val(jsonData.leaseTimeInterval);
|
$('#cbxrangeleasetimeunits').val(jsonData.leaseTimeInterval);
|
||||||
|
$('#no-resolv')[0].checked = jsonData.upstreamServersEnabled;
|
||||||
|
$('#cbxdhcpupstreamserver').val(jsonData.upstreamServers[0]);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -41,7 +41,7 @@
|
||||||
<code class="text-muted"><?php echo htmlspecialchars("[/[<domain>]/[domain/]][<ipaddr>[#<port>][@<source-ip>|<interface>[#<port>]]"); ?></code>
|
<code class="text-muted"><?php echo htmlspecialchars("[/[<domain>]/[domain/]][<ipaddr>[#<port>][@<source-ip>|<interface>[#<port>]]"); ?></code>
|
||||||
</small>
|
</small>
|
||||||
</p>
|
</p>
|
||||||
<select class="custom-select custom-select-sm js-field-preset" data-field-preset-target="#add-dhcp-upstream-server-field">
|
<select class="custom-select custom-select-sm js-field-preset" id="cbxdhcpupstreamserver" data-field-preset-target="#add-dhcp-upstream-server-field">
|
||||||
<option value=""><?php echo _("Choose a hosted server") ?></option>
|
<option value=""><?php echo _("Choose a hosted server") ?></option>
|
||||||
<option disabled="disabled"></option>
|
<option disabled="disabled"></option>
|
||||||
<?php echo optionsForSelect(dnsServers()) ?>
|
<?php echo optionsForSelect(dnsServers()) ?>
|
||||||
|
|
Loading…
Reference in a new issue