From 893a1ac5dbb86618ca058c15b0558837677b4881 Mon Sep 17 00:00:00 2001 From: kevin Date: Sun, 7 Jan 2024 17:20:23 +0800 Subject: [PATCH 1/2] fix js error --- templates/base.html | 35 ++++++++++++++++++++++++++++++++--- templates/clients.html | 30 ------------------------------ 2 files changed, 32 insertions(+), 33 deletions(-) diff --git a/templates/base.html b/templates/base.html index ab086e13..ef16c934 100644 --- a/templates/base.html +++ b/templates/base.html @@ -58,13 +58,13 @@
@@ -396,7 +396,7 @@

{{template "page_title" .}}

toastr.options.positionClass = 'toast-top-right-fix'; updateApplyConfigVisibility() - // from clients.html + updateSearchList() }); @@ -436,6 +436,35 @@

{{template "page_title" .}}

}); } + function updateSearchList() { + $.getJSON("{{.basePath}}/api/subnet-ranges", null, function(data) { + $("#status-selector option").remove(); + $("#status-selector").append( + $("") + .text("All") + .val("All"), + $("") + .text("Enabled") + .val("Enabled"), + $("") + .text("Disabled") + .val("Disabled"), + $("") + .text("Connected") + .val("Connected"), + $("") + .text("Disconnected") + .val("Disconnected") + ); + $.each(data, function(index, item) { + $("#status-selector").append( + $("") + .text(item) + .val(item) + ); + }); + }); + } // populateClient function for render new client info // on the client page. diff --git a/templates/clients.html b/templates/clients.html index cf11e0a5..54587a79 100644 --- a/templates/clients.html +++ b/templates/clients.html @@ -362,36 +362,6 @@ }); }); } - - function updateSearchList() { - $.getJSON("{{.basePath}}/api/subnet-ranges", null, function(data) { - $("#status-selector option").remove(); - $("#status-selector").append( - $("") - .text("All") - .val("All"), - $("") - .text("Enabled") - .val("Enabled"), - $("") - .text("Disabled") - .val("Disabled"), - $("") - .text("Connected") - .val("Connected"), - $("") - .text("Disconnected") - .val("Disconnected") - ); - $.each(data, function(index, item) { - $("#status-selector").append( - $("") - .text(item) - .val(item) - ); - }); - }); -}