diff --git a/src/static/app/src/components/configurationComponents/peerList.vue b/src/static/app/src/components/configurationComponents/peerList.vue index c75637c..fb9572d 100644 --- a/src/static/app/src/components/configurationComponents/peerList.vue +++ b/src/static/app/src/components/configurationComponents/peerList.vue @@ -35,6 +35,7 @@ import dayjs from "dayjs"; import {defineAsyncComponent, ref} from "vue"; import LocaleText from "@/components/text/localeText.vue"; import PeerRow from "@/components/configurationComponents/peerRow.vue"; +import {GetLocale} from "@/utilities/locale.js"; export default { name: "peerList", components: { @@ -148,7 +149,9 @@ export default { }, deleteConfiguration: { modalOpen: false - } + }, + searchStringTimeout: undefined, + searchString: "", } }, mounted() { @@ -194,6 +197,18 @@ export default { this.configurationToggling = false; }) }, + debounce(){ + if (!this.searchStringTimeout){ + this.searchStringTimeout = setTimeout(() => { + this.wireguardConfigurationStore.searchString = this.searchString; + }, 300) + }else{ + clearTimeout(this.searchStringTimeout) + this.searchStringTimeout = setTimeout(() => { + this.wireguardConfigurationStore.searchString = this.searchString; + }, 300) + } + }, getPeers(id = this.$route.params.id){ fetchGet("/api/getWireguardConfigurationInfo", { @@ -372,6 +387,9 @@ export default { } } }, + searchBarPlaceholder(){ + return GetLocale("Search Peers...") + }, searchPeers(){ const fuse = new Fuse(this.configurationPeers, { keys: ["name", "id", "allowed_ip"] @@ -426,7 +444,7 @@ export default {
@@ -522,7 +535,7 @@ export default {
@@ -535,7 +548,7 @@ export default {
@@ -548,7 +561,7 @@ export default {
@@ -563,7 +576,7 @@ export default {