mirror of
https://github.com/pi-hole/web.git
synced 2025-12-24 04:38:28 +00:00
Restructure settings page into individual smaller files. The massive file grew beyond all bounds and was rather unmaintainable. The new structure has a number of benefits, most importantly it's a lot more repsonsive as we do not have to fire a ton of individual AJAX queries to populate all tabs but only need to source what is actually displayed on the page we are showing here
Signed-off-by: DL6ER <dl6er@dl6er.de>
This commit is contained in:
@@ -5,7 +5,7 @@
|
||||
* This file is copyright under the latest version of the EUPL.
|
||||
* Please see LICENSE file for your rights under this license. */
|
||||
|
||||
/* global utils:false */
|
||||
/* global utils:false, setConfigValues: false, apiFailure: false */
|
||||
|
||||
var dhcpLeaesTable = null;
|
||||
|
||||
@@ -204,3 +204,24 @@ function delLease(ip) {
|
||||
console.log(exception); // eslint-disable-line no-console
|
||||
});
|
||||
}
|
||||
|
||||
function fillDHCPhosts(data) {
|
||||
$("#dhcp-hosts").val(data.value.join("\n"));
|
||||
}
|
||||
|
||||
function processDHCPConfig() {
|
||||
$.ajax({
|
||||
url: "/api/config/dhcp?detailed=true",
|
||||
})
|
||||
.done(function (data) {
|
||||
fillDHCPhosts(data.config.dhcp.hosts);
|
||||
setConfigValues("dhcp", "dhcp", data.config.dhcp);
|
||||
})
|
||||
.fail(function (data) {
|
||||
apiFailure(data);
|
||||
});
|
||||
}
|
||||
|
||||
$(document).ready(function () {
|
||||
processDHCPConfig();
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user