add ui to manage static dhcp leases

* add support to parse duplicate options in ParseConfig()
* add logic, html and js to edit dhcp leases
This commit is contained in:
glaszig
2019-08-01 16:31:11 +02:00
parent 1b32ed53d6
commit d18dbd7def
4 changed files with 118 additions and 7 deletions

View File

@@ -122,6 +122,29 @@ function applyNetworkSettings() {
});
}
$(document).on("click", ".js-add-dhcp-static-lease", function(e) {
e.preventDefault();
var container = $(".js-new-dhcp-static-lease");
var mac = $("input[name=mac]", container).val().trim();
var ip = $("input[name=ip]", container).val().trim();
if (mac == "" || ip == "") {
return;
}
var row = $("#js-dhcp-static-lease-row").html()
.replace("{{ mac }}", mac)
.replace("{{ ip }}", ip);
$(".js-dhcp-static-lease-container").append(row);
$("input[name=mac]", container).val("");
$("input[name=ip]", container).val("");
});
$(document).on("click", ".js-remove-dhcp-static-lease", function(e) {
e.preventDefault();
$(this).parents(".js-dhcp-static-lease-row").remove();
});
function setupBtns() {
$('#btnSummaryRefresh').click(function(){getAllInterfaces();});