From a102a780f8a726d157903b0bdc7c5ef776e51277 Mon Sep 17 00:00:00 2001 From: Donald Zou Date: Fri, 6 Sep 2024 17:15:38 +0800 Subject: [PATCH] Adjusted search functions --- .../src/components/configurationComponents/peerList.vue | 8 ++++++-- .../components/configurationComponents/peerSearch.vue | 9 +++++---- 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/src/static/app/src/components/configurationComponents/peerList.vue b/src/static/app/src/components/configurationComponents/peerList.vue index dd15058..a73cb96 100644 --- a/src/static/app/src/components/configurationComponents/peerList.vue +++ b/src/static/app/src/components/configurationComponents/peerList.vue @@ -369,8 +369,12 @@ export default { keys: ["name", "id", "allowed_ip"] }); - const result = this.wireguardConfigurationStore.searchString ? - fuse.search(this.wireguardConfigurationStore.searchString).map(x => x.item) : this.configurationPeers; + const result = this.wireguardConfigurationStore.searchString ? + this.configurationPeers.filter(x => { + return x.name.includes(this.wireguardConfigurationStore.searchString) || + x.id.includes(this.wireguardConfigurationStore.searchString) || + x.allowed_ip.includes(this.wireguardConfigurationStore.searchString) + }) : this.configurationPeers; if (this.dashboardConfigurationStore.Configuration.Server.dashboard_sort === "restricted"){ return result.slice().sort((a, b) => { diff --git a/src/static/app/src/components/configurationComponents/peerSearch.vue b/src/static/app/src/components/configurationComponents/peerSearch.vue index 349e66d..630fa99 100644 --- a/src/static/app/src/components/configurationComponents/peerSearch.vue +++ b/src/static/app/src/components/configurationComponents/peerSearch.vue @@ -95,17 +95,18 @@ export default { @click="this.downloadAllPeer()"> Download All -
+
+
-