mirror of
https://github.com/ngoduykhanh/wireguard-ui
synced 2024-06-10 18:02:26 +02:00
fix js error
This commit is contained in:
parent
893a1ac5db
commit
15f84de05b
|
@ -58,13 +58,13 @@
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group form-group-sm">
|
<div class="form-group form-group-sm">
|
||||||
<select name="status-selector" id="status-selector" class="custom-select form-control-navbar" style="margin-left: 0.5em; height: 90%; font-size: 14px;">
|
<select name="status-selector" id="status-selector" class="custom-select form-control-navbar" style="margin-left: 0.5em; height: 90%; font-size: 14px;">
|
||||||
<!-- THIS SECTION IS OVERRIDDEN BY JS. SEE updateSearchList() function BEFORE EDITING -->
|
<!-- THIS SECTION IS OVERRIDDEN BY JS. SEE updateSearchList() function in clients.html BEFORE EDITING -->
|
||||||
<option value="All">All</option>
|
<option value="All">All</option>
|
||||||
<option value="Enabled">Enabled</option>
|
<option value="Enabled">Enabled</option>
|
||||||
<option value="Disabled">Disabled</option>
|
<option value="Disabled">Disabled</option>
|
||||||
<option value="Connected">Connected</option>
|
<option value="Connected">Connected</option>
|
||||||
<option value="Disconnected">Disconnected</option>
|
<option value="Disconnected">Disconnected</option>
|
||||||
<!-- THIS SECTION IS OVERRIDDEN BY JS. SEE updateSearchList() function BEFORE EDITING -->
|
<!-- THIS SECTION IS OVERRIDDEN BY JS. SEE updateSearchList() function in clients.html BEFORE EDITING -->
|
||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
|
@ -397,8 +397,6 @@
|
||||||
|
|
||||||
updateApplyConfigVisibility()
|
updateApplyConfigVisibility()
|
||||||
|
|
||||||
updateSearchList()
|
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
function addGlobalStyle(css, id) {
|
function addGlobalStyle(css, id) {
|
||||||
|
@ -435,36 +433,6 @@
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
function updateSearchList() {
|
|
||||||
$.getJSON("{{.basePath}}/api/subnet-ranges", null, function(data) {
|
|
||||||
$("#status-selector option").remove();
|
|
||||||
$("#status-selector").append(
|
|
||||||
$("<option></option>")
|
|
||||||
.text("All")
|
|
||||||
.val("All"),
|
|
||||||
$("<option></option>")
|
|
||||||
.text("Enabled")
|
|
||||||
.val("Enabled"),
|
|
||||||
$("<option></option>")
|
|
||||||
.text("Disabled")
|
|
||||||
.val("Disabled"),
|
|
||||||
$("<option></option>")
|
|
||||||
.text("Connected")
|
|
||||||
.val("Connected"),
|
|
||||||
$("<option></option>")
|
|
||||||
.text("Disconnected")
|
|
||||||
.val("Disconnected")
|
|
||||||
);
|
|
||||||
$.each(data, function(index, item) {
|
|
||||||
$("#status-selector").append(
|
|
||||||
$("<option></option>")
|
|
||||||
.text(item)
|
|
||||||
.val(item)
|
|
||||||
);
|
|
||||||
});
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
// populateClient function for render new client info
|
// populateClient function for render new client info
|
||||||
// on the client page.
|
// on the client page.
|
||||||
|
|
|
@ -362,10 +362,41 @@ Wireguard Clients
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function updateSearchList() {
|
||||||
|
$.getJSON("{{.basePath}}/api/subnet-ranges", null, function(data) {
|
||||||
|
$("#status-selector option").remove();
|
||||||
|
$("#status-selector").append(
|
||||||
|
$("<option></option>")
|
||||||
|
.text("All")
|
||||||
|
.val("All"),
|
||||||
|
$("<option></option>")
|
||||||
|
.text("Enabled")
|
||||||
|
.val("Enabled"),
|
||||||
|
$("<option></option>")
|
||||||
|
.text("Disabled")
|
||||||
|
.val("Disabled"),
|
||||||
|
$("<option></option>")
|
||||||
|
.text("Connected")
|
||||||
|
.val("Connected"),
|
||||||
|
$("<option></option>")
|
||||||
|
.text("Disconnected")
|
||||||
|
.val("Disconnected")
|
||||||
|
);
|
||||||
|
$.each(data, function(index, item) {
|
||||||
|
$("#status-selector").append(
|
||||||
|
$("<option></option>")
|
||||||
|
.text(item)
|
||||||
|
.val(item)
|
||||||
|
);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
}
|
||||||
</script>
|
</script>
|
||||||
<script>
|
<script>
|
||||||
// load client list
|
// load client list
|
||||||
$(document).ready(function () {
|
$(document).ready(function () {
|
||||||
|
updateSearchList();
|
||||||
populateClientList();
|
populateClientList();
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue