diff --git a/frontend/src/layouts/MainLayout.vue b/frontend/src/layouts/MainLayout.vue index 1e0fd6c..f6f0d6a 100644 --- a/frontend/src/layouts/MainLayout.vue +++ b/frontend/src/layouts/MainLayout.vue @@ -1,21 +1,37 @@ + +function handleTabClick(tabId: string) { + tabsStore.activate(tabId) + router.push('/terminal') + closeSidebar() +} + +function handleTabClose(tabId: string, event: Event) { + event.stopPropagation() + tabsStore.close(tabId) +} + @@ -38,27 +54,53 @@ function closeSidebar() { SSH 传输控制台 {{ authStore.displayName || authStore.username }} - - - - 传输 - - - - 连接列表 - + + + + 传输 + + + + 连接列表 + + + + + + + 终端 + + + + {{ tab.title }} + handleTabClose(tab.id, e)" + class="p-1 rounded opacity-0 group-hover:opacity-100 hover:bg-slate-600 transition-all duration-200 flex-shrink-0" + aria-label="关闭标签" + > + + + + + import { computed, onMounted } from 'vue' -import { useRouter } from 'vue-router' import { useTerminalTabsStore } from '../stores/terminalTabs' import { useConnectionsStore } from '../stores/connections' import TerminalWidget from '../components/TerminalWidget.vue' -import { ArrowLeft, X } from 'lucide-vue-next' -const router = useRouter() const tabsStore = useTerminalTabsStore() const connectionsStore = useConnectionsStore() @@ -18,69 +15,16 @@ onMounted(() => { connectionsStore.fetchConnections() } }) - -function handleTabClick(tabId: string) { - tabsStore.activate(tabId) -} - -function handleTabClose(tabId: string, event: Event) { - event.stopPropagation() - tabsStore.close(tabId) -} - -function goBack() { - router.push('/connections') -} - - - - - - 终端 - - - - - - {{ tab.title }} - handleTabClose(tab.id, e)" - class="p-1 rounded hover:bg-slate-600 transition-colors duration-200" - aria-label="关闭标签" - > - - - - - - 暂无打开的终端 - - 返回连接列表 - + 暂无打开的终端 + 从左侧连接列表点击"终端"按钮打开
{{ authStore.displayName || authStore.username }}
暂无打开的终端
从左侧连接列表点击"终端"按钮打开