From a45ab628850f6b112010a34dfa073fe29bed37f4 Mon Sep 17 00:00:00 2001 From: divocat Date: Tue, 7 Oct 2025 22:56:40 +0300 Subject: [PATCH] fix: correct section display name for json outbound --- .../src/podkop/methods/getDashboardSections.ts | 10 ++++++---- .../htdocs/luci-static/resources/view/podkop/main.js | 5 ++++- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/fe-app-podkop/src/podkop/methods/getDashboardSections.ts b/fe-app-podkop/src/podkop/methods/getDashboardSections.ts index 6507775..e9244e9 100644 --- a/fe-app-podkop/src/podkop/methods/getDashboardSections.ts +++ b/fe-app-podkop/src/podkop/methods/getDashboardSections.ts @@ -61,6 +61,11 @@ export async function getDashboardSections(): Promise proxy.code === `${section['.name']}-out`, ); + const parsedOutbound = JSON.parse(section.outbound_json); + const parsedTag = parsedOutbound?.tag ? decodeURIComponent(parsedOutbound?.tag) : undefined; + const proxyDisplayName = parsedTag || outbound?.value?.name || '' + + return { withTagSelect: false, code: outbound?.code || section['.name'], @@ -68,10 +73,7 @@ export async function getDashboardSections(): Promise proxy.code === `${section[".name"]}-out` ); + const parsedOutbound = JSON.parse(section.outbound_json); + const parsedTag = parsedOutbound?.tag ? decodeURIComponent(parsedOutbound?.tag) : void 0; + const proxyDisplayName = parsedTag || outbound?.value?.name || ""; return { withTagSelect: false, code: outbound?.code || section[".name"], @@ -932,7 +935,7 @@ async function getDashboardSections() { outbounds: [ { code: outbound?.code || section[".name"], - displayName: decodeURIComponent(JSON.parse(section.outbound_json)?.tag) || outbound?.value?.name || "", + displayName: proxyDisplayName, latency: outbound?.value?.history?.[0]?.delay || 0, type: outbound?.value?.type || "", selected: true