From 264a5e664a1c4da754e06809225e066c1db2dd40 Mon Sep 17 00:00:00 2001 From: m1saka Date: Thu, 22 Oct 2026 16:55:03 +0800 Subject: [PATCH] refactor(web): remove DSH workspace status bar duplicated in settings --- web/src/RuntimeWorkspace.tsx | 31 +++---------------------------- 1 file changed, 3 insertions(+), 28 deletions(-) diff --git a/web/src/RuntimeWorkspace.tsx b/web/src/RuntimeWorkspace.tsx index 1c2431f..2325aa1 100644 --- a/web/src/RuntimeWorkspace.tsx +++ b/web/src/RuntimeWorkspace.tsx @@ -1,10 +1,7 @@ import { useCallback, useEffect, useRef, useState } from 'react'; -import { ExternalLink, MoreVertical, RefreshCw, RotateCw, Settings2 } from 'lucide-react'; import { api, type Instance } from './api'; -import { Alert, message, Status } from './ui'; -import { RuntimeSelector } from './RuntimeSelector'; +import { Alert, message } from './ui'; import { runtimeSelectionKey, selectRuntime } from './runtimeSelection'; -import { DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuTrigger } from './components/ui/dropdown-menu'; import { buttonVariants } from './components/ui/button'; import { cn } from './lib/utils'; @@ -71,33 +68,11 @@ export function useRuntimeInstances(userId: string, page: string) { export function RuntimeWorkspace({ runtime, visible, manage, settings }: { runtime: ReturnType; visible: boolean; manage: () => void; settings: () => void; }) { - const [revision, setRevision] = useState(0); const [frameError, setFrameError] = useState(false); const selected = runtime.instances?.find(instance => instance.id === runtime.selectedId); const url = selected ? '/dsh/' + encodeURIComponent(selected.id) + '/' : ''; - useEffect(() => { setFrameError(false); }, [selected?.id, revision]); - const iconBtn = cn(buttonVariants({variant: 'ghost', size: 'icon'}), 'text-muted-foreground'); + useEffect(() => { setFrameError(false); }, [selected?.id]); return
-
-
- {selected?.name || 'DSH'} - {selected && } -
-
- - - {selected?.status === 'running' && - - - setRevision(value => value + 1)}>重新加载内嵌页面 - window.open(url, '_blank', 'noopener,noreferrer')}>新窗口打开 - 管理实例 - - } -
-
{runtime.error &&
{runtime.error}
} {!runtime.instances && runtime.loading &&
正在加载实例…
} {!runtime.instances && !runtime.loading &&
暂时无法加载实例,请重试。
} @@ -116,7 +91,7 @@ export function RuntimeWorkspace({ runtime, visible, manage, settings }: { } {selected?.status === 'running' &&
{frameError &&
DSH 页面加载失败或登录已失效,请重新加载或在新窗口打开。
} -