Merge branch 'feature/dhcp-eth0' of https://github.com/billz/raspap-webgui into feature/dhcp-eth0

This commit is contained in:
Bill Zimmerman 2020-11-21 16:54:11 +01:00
commit 7925513367
3 changed files with 7 additions and 7 deletions

View File

@ -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;

View File

@ -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"

View File

@ -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>