diff --git a/templates/base.html b/templates/base.html
index ab086e1..ef16c93 100644
--- a/templates/base.html
+++ b/templates/base.html
@@ -58,13 +58,13 @@
@@ -396,7 +396,7 @@
toastr.options.positionClass = 'toast-top-right-fix';
updateApplyConfigVisibility()
- // from clients.html
+
updateSearchList()
});
@@ -436,6 +436,35 @@
});
}
+ 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 cf11e0a..54587a7 100644
--- a/templates/clients.html
+++ b/templates/clients.html
@@ -362,36 +362,6 @@ Wireguard Clients
});
});
}
-
- 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)
- );
- });
- });
-}