diff --git a/src/static/app/src/components/configurationComponents/peerList.vue b/src/static/app/src/components/configurationComponents/peerList.vue index 85ea6651..f7d5e478 100644 --- a/src/static/app/src/components/configurationComponents/peerList.vue +++ b/src/static/app/src/components/configurationComponents/peerList.vue @@ -191,6 +191,12 @@ const searchPeers = computed(() => { wireguardConfigurationStore.Filter.ShowAllPeersWhenHiddenTags || (!wireguardConfigurationStore.Filter.ShowAllPeersWhenHiddenTags && taggedPeers.value.includes(x.id)) )); + if (dashboardStore.Configuration.Server.dashboard_sort === "traffic"){ + return result.sort((a, b) => { + return (b.total_data + b.cumu_data) - (a.total_data + a.cumu_data) + }).slice(0, showPeersCount.value); + } + if (dashboardStore.Configuration.Server.dashboard_sort === "restricted"){ return result.sort((a, b) => { if ( a[dashboardStore.Configuration.Server.dashboard_sort] diff --git a/src/static/app/src/components/configurationComponents/peerSearch.vue b/src/static/app/src/components/configurationComponents/peerSearch.vue index 45dcd8a9..ef77960f 100644 --- a/src/static/app/src/components/configurationComponents/peerSearch.vue +++ b/src/static/app/src/components/configurationComponents/peerSearch.vue @@ -24,6 +24,7 @@ export default { status: GetLocale("Status"), name: GetLocale("Name"), allowed_ip: GetLocale("Allowed IPs"), + traffic: GetLocale("Total Usage"), restricted: GetLocale("Restricted") }, interval: {