From 68e37604e2c09838c936c5fd5b90e0e844ebd822 Mon Sep 17 00:00:00 2001 From: Peter_Liu Date: Sat, 21 Feb 2026 02:00:35 +0800 Subject: [PATCH] feat: auto-select best server on country/city change --- web/html/modals/nord_modal.html | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/web/html/modals/nord_modal.html b/web/html/modals/nord_modal.html index 5cd5fceb..c86d8ed9 100644 --- a/web/html/modals/nord_modal.html +++ b/web/html/modals/nord_modal.html @@ -48,7 +48,7 @@ - + {{ i18n "pages.xray.outbound.allCities" }} @@ -182,6 +182,10 @@ return s; }).sort((a, b) => a.load - b.load); + if (this.servers.length > 0) { + this.serverId = this.servers[0].id; + } + if (this.servers.length === 0) { app.$message.warning('No servers found for the selected country'); } @@ -276,6 +280,13 @@ fetchServers: () => nordModal.fetchServers(), addOutbound: () => nordModal.addOutbound(), resetOutbound() { nordModal.resetOutbound(this.nordOutboundIndex) }, + onCityChange() { + if (this.filteredServers.length > 0) { + this.nordModal.serverId = this.filteredServers[0].id; + } else { + this.nordModal.serverId = null; + } + } }, computed: { nordOutboundIndex: {