1
0
mirror of https://github.com/billz/raspap-webgui.git synced 2023-10-10 13:37:24 +02:00

Load default iface on page load

This commit is contained in:
billz 2020-11-19 12:31:48 +00:00
parent ebbd6f4399
commit 04590dc889

View File

@ -222,6 +222,8 @@ function contentLoaded() {
setupBtns(); setupBtns();
case "hostapd_conf": case "hostapd_conf":
loadChannel(); loadChannel();
case "dhcpd_conf":
loadInterfaceDHCPSelect('wlan0');
break; break;
} }
} }
@ -238,15 +240,10 @@ function loadWifiStations(refresh) {
} }
$(".js-reload-wifi-stations").on("click", loadWifiStations(true)); $(".js-reload-wifi-stations").on("click", loadWifiStations(true));
function loadInterfaceDHCPSelect(default_iface) {
function loadInterfaceDHCP(selected) { var iface = (default_iface) ? default_iface : $('#cbxdhcpiface').val();
$('#cbxdhcpiface').val(iface);
} $.get('ajax/networking/get_netcfg.php?iface='+iface,function(data){
function loadInterfaceDHCPSelect() {
var interface = $('#cbxdhcpiface').val();
console.log(interface);
$.get('ajax/networking/get_netcfg.php?iface='+interface,function(data){
jsonData = JSON.parse(data); jsonData = JSON.parse(data);
$('#dhcp-iface')[0].checked = jsonData.DHCPEnabled; $('#dhcp-iface')[0].checked = jsonData.DHCPEnabled;
$('#txtrangestart').val(jsonData.RangeStart); $('#txtrangestart').val(jsonData.RangeStart);