mirror of
https://github.com/RaspAP/raspap-webgui.git
synced 2024-11-21 23:20:22 +00:00
Set default dhcp interface on page load
This commit is contained in:
parent
73deab78cf
commit
b63a53e182
3 changed files with 7 additions and 7 deletions
|
@ -223,7 +223,7 @@ function contentLoaded() {
|
|||
case "hostapd_conf":
|
||||
loadChannel();
|
||||
case "dhcpd_conf":
|
||||
loadInterfaceDHCPSelect('wlan0');
|
||||
loadInterfaceDHCPSelect();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@ -240,9 +240,8 @@ function loadWifiStations(refresh) {
|
|||
}
|
||||
$(".js-reload-wifi-stations").on("click", loadWifiStations(true));
|
||||
|
||||
function loadInterfaceDHCPSelect(default_iface) {
|
||||
var iface = (default_iface) ? default_iface : $('#cbxdhcpiface').val();
|
||||
$('#cbxdhcpiface').val(iface);
|
||||
function loadInterfaceDHCPSelect() {
|
||||
var iface = $('#cbxdhcpiface').val();
|
||||
$.get('ajax/networking/get_netcfg.php?iface='+iface,function(data){
|
||||
jsonData = JSON.parse(data);
|
||||
$('#dhcp-iface')[0].checked = jsonData.DHCPEnabled;
|
||||
|
|
|
@ -44,17 +44,18 @@ function DisplayDHCPConfig()
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
getWifiInterface();
|
||||
$serviceStatus = $dnsmasq_state ? "up" : "down";
|
||||
exec("ip -o link show | awk -F': ' '{print $2}'", $interfaces);
|
||||
exec('cat ' . RASPI_DNSMASQ_LEASES, $leases);
|
||||
$ap_iface = $_SESSION['ap_interface'];
|
||||
|
||||
echo renderTemplate(
|
||||
"dhcp", compact(
|
||||
"status",
|
||||
"serviceStatus",
|
||||
"dnsmasq_state",
|
||||
"conf",
|
||||
"ap_iface",
|
||||
"dhcpHost",
|
||||
"interfaces",
|
||||
"leases"
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
<div class="row">
|
||||
<div class="form-group col-md-6">
|
||||
<label for="code">Interface</label>
|
||||
<?php SelectorOptions('interface', $interfaces, $conf['interface'], 'cbxdhcpiface', 'loadInterfaceDHCPSelect', $DHCPDisabled); ?>
|
||||
<?php SelectorOptions('interface', $interfaces, $ap_iface, 'cbxdhcpiface', 'loadInterfaceDHCPSelect', $DHCPDisabled); ?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
|
Loading…
Reference in a new issue