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:
DL6ER
2023-02-18 13:48:37 +01:00
parent 7396156274
commit 3ea5a985cf
13 changed files with 1012 additions and 943 deletions

View File

@@ -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();
});