@@ -10,7 +10,12 @@ const { fetchTree, treeNodeToAsset } = useAssetTree();
1010const { recentConnections } = useRecentConnections ();
1111const userInfoStore = useUserInfoStore ();
1212const { openLocalShell } = useWorkspaceTabs ();
13+ const { t } = useI18n ();
1314const localShellAvailable = computed (() => isDesktopRuntime ());
15+ const listTitle = computed (() => (search .value .trim () ? t (" AddSession.SearchResults" ) : t (" Menu.RecentConnections" )));
16+ const listEmpty = computed (() =>
17+ search .value .trim () ? t (" AddSession.NoMatchingAssets" ) : t (" RecentConnections.Empty" )
18+ );
1419
1520function flatten(nodes : AssetTreeNode []): AssetItem [] {
1621 return nodes .flatMap ((node ) => (node .isParent ? flatten (node .children || []) : [treeNodeToAsset (node )]));
@@ -52,32 +57,35 @@ watch(open, (value) => {
5257
5358<template >
5459 <UPopover v-model :open =" open " :content =" { align: ' start' , side: ' bottom' , sideOffset: 8 } " :ui =" { content: ' p-0' } " >
55- <UTooltip text="新建连接 " :delay-duration =" 150 " >
60+ <UTooltip : text =" t ( ' AddSession.NewConnection ' ) " :delay-duration =" 150 " >
5661 <button
5762 type =" button"
58- class =" grid size-6 shrink-0 place-items-center rounded-lg text-muted transition-colors hover:bg-[var(--app-hover-strong)] hover:text-highlighted"
59- aria-label =" 新建连接"
63+ data-workspace-tour =" add-session"
64+ class =" grid size-6 shrink-0 place-items-center rounded-lg text-muted transition-colors hover:bg-(--app-hover-strong) hover:text-highlighted"
65+ :aria-label =" t('AddSession.NewConnection')"
6066 >
6167 <UIcon name="i-lucide-plus" class="size-4" />
6268 </button >
6369 </UTooltip >
6470
6571 <template #content >
66- <div class =" w-[360px] overflow-hidden rounded-xl bg-default shadow-xl ring-1 ring-black/10 dark:ring-white/12" >
72+ <div class =" w-90 overflow-hidden rounded-xl bg-default shadow-xl ring-1 ring-black/10 dark:ring-white/12" >
6773 <div class =" border-b border-default p-2" >
6874 <UInput
6975 v-model =" search "
7076 autofocus
7177 icon="i-lucide-search"
7278 size="sm"
7379 variant="none"
74- placeholder="搜索资产名称或地址… "
80+ : placeholder =" t ( ' AddSession.SearchPlaceholder ' ) "
7581 :ui =" { base: ' h-8 rounded-lg bg-elevated/70 ring-1 ring-inset ring-default' } "
7682 />
7783 </div >
7884 <div class =" max-h-80 min-h-32 overflow-y-auto p-1.5" >
7985 <template v-if =" localShellAvailable && ! search .trim ()" >
80- <div class =" px-2 py-1 text-[10px] font-semibold uppercase tracking-wider text-muted" >本地</div >
86+ <div class =" px-2 py-1 text-[10px] font-semibold uppercase tracking-wider text-muted" >
87+ {{ t("AddSession.Local") }}
88+ </div >
8189 <button
8290 type =" button"
8391 class =" flex w-full items-center gap-3 rounded-lg px-2 py-2 text-left hover:bg-elevated"
@@ -87,14 +95,14 @@ watch(open, (value) => {
8795 <UIcon name="i-lucide-square-terminal" class="size-4 text-muted" />
8896 </span >
8997 <span class =" min-w-0 flex-1" >
90- <span class =" block truncate text-sm text-highlighted" >Local Shell </span >
91- <span class =" block truncate text-[11px] text-muted" >打开本机终端 </span >
98+ <span class =" block truncate text-sm text-highlighted" >{{ t("AddSession.LocalShell") }} </span >
99+ <span class =" block truncate text-[11px] text-muted" >{{ t("AddSession.LocalShellHint") }} </span >
92100 </span >
93101 <UIcon name="i-lucide-chevron-right" class="size-3.5 shrink-0 text-dimmed" />
94102 </button >
95103 </template >
96104 <div class =" px-2 py-1 text-[10px] font-semibold uppercase tracking-wider text-muted" >
97- {{ search.trim() ? "搜索结果" : "最近连接" }}
105+ {{ listTitle }}
98106 </div >
99107 <div v-if =" loading" class =" grid h-24 place-items-center" >
100108 <UIcon name="i-lucide-loader-circle" class="size-4 animate-spin text-muted" />
@@ -122,7 +130,7 @@ watch(open, (value) => {
122130 v-if =" !loading && (search.trim() ? results : recentConnections).length === 0"
123131 class =" grid h-24 place-items-center text-xs text-muted"
124132 >
125- {{ search.trim() ? "未找到匹配资产" : "暂无最近连接" }}
133+ {{ listEmpty }}
126134 </div >
127135 </div >
128136 </div >
0 commit comments