From 3e01079caf7738e02e337b458077c70f7335a081 Mon Sep 17 00:00:00 2001 From: Donald Zou Date: Sat, 7 Dec 2024 21:41:05 +0800 Subject: [PATCH] Added sorting and search to configuration list --- src/dashboard.py | 2 - .../configurationComponents/peerList.vue | 3 + .../app/src/components/configurationList.vue | 105 ++++++++++++++---- src/static/app/src/components/navbar.vue | 1 - src/static/app/src/router/router.js | 1 - src/static/app/src/stores/wgdashboardStore.js | 20 ---- 6 files changed, 88 insertions(+), 44 deletions(-) delete mode 100644 src/static/app/src/stores/wgdashboardStore.js diff --git a/src/dashboard.py b/src/dashboard.py index 1b9cf66..48bdea6 100644 --- a/src/dashboard.py +++ b/src/dashboard.py @@ -3108,7 +3108,6 @@ def ProtocolsEnabled() -> list[str]: protocols.append("wg") return protocols - def InitWireguardConfigurationsList(startup: bool = False): confs = os.listdir(DashboardConfig.GetConfig("Server", "wg_conf_path")[1]) confs.sort() @@ -3164,7 +3163,6 @@ def startThreads(): scheduleJobThread.daemon = True scheduleJobThread.start() - if __name__ == "__main__": startThreads() app.run(host=app_ip, debug=False, port=app_port) \ No newline at end of file diff --git a/src/static/app/src/components/configurationComponents/peerList.vue b/src/static/app/src/components/configurationComponents/peerList.vue index b4541af..b10ce6f 100644 --- a/src/static/app/src/components/configurationComponents/peerList.vue +++ b/src/static/app/src/components/configurationComponents/peerList.vue @@ -204,6 +204,9 @@ export default { this.dashboardConfigurationStore.newMessage("Server", res.message, 'danger') } + this.wireguardConfigurationStore.Configurations.find(x => x.Name === this.configurationInfo.Name).Status = res.data + console.log(this.wireguardConfigurationStore.Configurations.find(x => x.Name === this.configurationInfo.Name).Status) + this.configurationInfo.Status = res.data this.configurationToggling = false; }) diff --git a/src/static/app/src/components/configurationList.vue b/src/static/app/src/components/configurationList.vue index 6407b31..951eade 100644 --- a/src/static/app/src/components/configurationList.vue +++ b/src/static/app/src/components/configurationList.vue @@ -1,9 +1,9 @@ @@ -35,33 +82,53 @@ export default {
-
-

- - - +
+

+

-

- -

+ class="ms-md-auto py-2 text-decoration-none btn text-primary-emphasis bg-primary-subtle rounded-3 border-1 border-primary-subtle"> +
-

- -

+ class="py-2 text-decoration-none btn text-primary-emphasis bg-primary-subtle rounded-3 border-1 border-primary-subtle"> +
+
+
+ + + + + + {{s}} + + +
+
+ + +
+
+

- @@ -73,9 +140,7 @@ export default { \ No newline at end of file diff --git a/src/static/app/src/components/navbar.vue b/src/static/app/src/components/navbar.vue index 8b4a11c..4c8a18b 100644 --- a/src/static/app/src/components/navbar.vue +++ b/src/static/app/src/components/navbar.vue @@ -1,5 +1,4 @@