From c162a41bc049bfd135073af3cce0f737ff7eea9d Mon Sep 17 00:00:00 2001 From: Denozordec Date: Thu, 10 Sep 2026 22:19:05 +0700 Subject: [PATCH] =?UTF-8?q?fix(network-map):=20=D0=BF=D0=BE=D0=B4=D0=BF?= =?UTF-8?q?=D0=B8=D1=81=D0=B0=D1=82=D1=8C=20unbound-=D0=BF=D1=83=D1=82?= =?UTF-8?q?=D0=B8=20=D0=BF=D0=B0=D1=80=D0=BE=D0=B9=20=D1=81=D0=B5=D1=80?= =?UTF-8?q?=D0=B2=D0=B5=D1=80=D0=BE=D0=B2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Cursor --- app/(main)/network-map/page.tsx | 14 ++++-- lib/format-service-path-label.test.ts | 62 +++++++++++++++++++++++++++ lib/format-service-path-label.ts | 45 +++++++++++++++++++ 3 files changed, 118 insertions(+), 3 deletions(-) create mode 100644 lib/format-service-path-label.test.ts create mode 100644 lib/format-service-path-label.ts diff --git a/app/(main)/network-map/page.tsx b/app/(main)/network-map/page.tsx index 2baafef..c582b2f 100644 --- a/app/(main)/network-map/page.tsx +++ b/app/(main)/network-map/page.tsx @@ -67,6 +67,7 @@ import { CableIcon, CopyIcon, ActivityIcon, ExternalLinkIcon, } from "lucide-react" import { cn } from "@/lib/utils" +import { formatServicePathLabel, formatServicePathTitle } from "@/lib/format-service-path-label" import Link from "next/link" import { Flag } from "@/components/flag" @@ -820,9 +821,15 @@ function ServicePathList({ {paths.map((p) => { const rowKey = servicePathKey(p) const via = servers.find((s) => s.id === p.viaId) - const viaLabel = via?.site || p.viaName + const en = servers.find((s) => s.id === p.enId) const svc = services.find((s) => s.id === p.serviceId) - const mid = viaMode === "via" ? viaLabel : (svc?.label ?? p.serviceId) + const label = formatServicePathLabel(p, viaMode, { + viaName: via?.name, + viaSite: via?.site, + enName: en?.name, + serviceLabel: svc?.label, + }) + const title = formatServicePathTitle(label, svc?.label ?? p.serviceId) const active = Boolean( highlight && highlight.viaId === p.viaId @@ -833,13 +840,14 @@ function ServicePathList({