Improve conditional forwarding settings so users can specify the subnet according to their needs.

Signed-off-by: DL6ER <dl6er@dl6er.de>
This commit is contained in:
DL6ER
2020-04-09 09:03:50 +02:00
parent 25a08ed161
commit 373d59f751
3 changed files with 102 additions and 46 deletions

View File

@@ -215,21 +215,8 @@ $(function() {
// DHCP leases tooltips
$(document).ready(function() {
$('[data-toggle="tooltip"]').tooltip({ html: true, container: "body" });
});
// Change "?tab=" parameter in URL for save and reload
$(".nav-tabs a").on("shown.bs.tab", function(e) {
var tab = e.target.hash.substring(1);
window.history.pushState("", "", "?tab=" + tab);
if (tab === "piholedhcp") {
window.location.reload();
}
window.scrollTo(0, 0);
});
// Auto dismissal for info notifications
$(document).ready(function() {
// Auto dismissal for info notifications
var alInfo = $("#alInfo");
if (alInfo.length) {
alInfo.delay(3000).fadeOut(2000, function() {
@@ -243,4 +230,23 @@ $(document).ready(function() {
input.setAttribute("autocorrect", "off");
input.setAttribute("autocapitalize", "off");
input.setAttribute("spellcheck", false);
// En-/disable conditional forwarding input fields based
// on the checkbox state
$('input[name="rev_server"]').click(function() {
$('input[name="rev_server_cidr"]').prop("disabled", !this.checked);
$('input[name="rev_server_target"]').prop("disabled", !this.checked);
$('input[name="rev_server_domain"]').prop("disabled", !this.checked);
});
});
// Change "?tab=" parameter in URL for save and reload
$(".nav-tabs a").on("shown.bs.tab", function(e) {
var tab = e.target.hash.substring(1);
window.history.pushState("", "", "?tab=" + tab);
if (tab === "piholedhcp") {
window.location.reload();
}
window.scrollTo(0, 0);
});