Browse Source

Add advanced fields to JSON response

pull/749/head
billz 2 years ago
parent
commit
e4856484d9
  1. 2
      ajax/networking/get_netcfg.php
  2. 2
      app/js/custom.js
  3. 2
      templates/dhcp/advanced.php

2
ajax/networking/get_netcfg.php

@ -21,7 +21,7 @@ if (isset($interface)) {
$dhcpdata['dhcpHost'] = is_array($dhcpHost) ? $dhcpHost : [ $dhcpHost ];
$upstreamServers = is_array($conf['server']) ? $conf['server'] : [ $conf['server'] ];
$dhcpdata['upstreamServers'] = array_filter($upstreamServers);
$dhcpdata['upstreamServersEnabled'] = empty($conf['server']) ? false: true;
preg_match('/([0-9]*)([a-z])/i', $dhcpdata['leaseTime'], $arrRangeLeaseTime);
$dhcpdata['leaseTime'] = $arrRangeLeaseTime[1];
$dhcpdata['leaseTimeInterval'] = $arrRangeLeaseTime[2];

2
app/js/custom.js

@ -255,6 +255,8 @@ function loadInterfaceDHCPSelect() {
$('#txtdns1').val(jsonData.DNS1);
$('#txtdns2').val(jsonData.DNS2);
$('#cbxrangeleasetimeunits').val(jsonData.leaseTimeInterval);
$('#no-resolv')[0].checked = jsonData.upstreamServersEnabled;
$('#cbxdhcpupstreamserver').val(jsonData.upstreamServers[0]);
});
}

2
templates/dhcp/advanced.php

@ -41,7 +41,7 @@
<code class="text-muted"><?php echo htmlspecialchars("[/[<domain>]/[domain/]][<ipaddr>[#<port>][@<source-ip>|<interface>[#<port>]]"); ?></code>
</small>
</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 disabled="disabled"></option>
<?php echo optionsForSelect(dnsServers()) ?>

Loading…
Cancel
Save