1
0
mirror of https://github.com/donaldzou/WGDashboard.git synced 2024-11-22 07:10:09 +01:00

Adjusted search functions

This commit is contained in:
Donald Zou 2024-09-06 17:15:38 +08:00
parent 4dbbc32108
commit a102a780f8
2 changed files with 11 additions and 6 deletions

View File

@ -370,7 +370,11 @@ export default {
});
const result = this.wireguardConfigurationStore.searchString ?
fuse.search(this.wireguardConfigurationStore.searchString).map(x => x.item) : this.configurationPeers;
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) => {

View File

@ -95,9 +95,10 @@ export default {
@click="this.downloadAllPeer()">
<i class="bi bi-download me-2"></i> Download All
</button>
<div class="flex-grow-1 mt-3 mt-md-0">
<div class="mt-3 mt-md-0 flex-grow-1">
<input class="form-control rounded-3 bg-secondary-subtle border-1 border-secondary-subtle shadow-sm w-100"
placeholder="Search..."
placeholder="Search Peers..."
id="searchPeers"
@keyup="this.debounce()"
v-model="this.searchString">