Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 27 additions & 14 deletions llmdoc/dashboard/canvas-architecture.mdx

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion llmdoc/meta.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
"validatedRevision": "2b45dc99c607f59351d214845fe8e0c6b912f478"
},
"dashboard/canvas-architecture.mdx": {
"validatedRevision": "2b45dc99c607f59351d214845fe8e0c6b912f478"
"validatedRevision": "41c39bccb8055f2d3bffa904b5cc2e30c0b43c5b"
},
"device/device-daemon.mdx": {
"validatedRevision": "2b45dc99c607f59351d214845fe8e0c6b912f478"
Expand Down
2 changes: 1 addition & 1 deletion packages/dashboard/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@tool-bridge/dashboard",
"version": "0.28.0",
"version": "0.29.0",
"description": "Tool Bridge self-hosted Dashboard as prebuilt static assets",
"type": "module",
"license": "MIT",
Expand Down
18 changes: 15 additions & 3 deletions packages/dashboard/src/App.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Navigate, Route, Routes, useLocation } from 'react-router'
import { Navigate, Route, Routes, useLocation, useSearchParams } from 'react-router'
import { lazy, type ReactNode, Suspense } from 'react'
import { useSession } from '@/lib/session-context'

Expand All @@ -13,6 +13,15 @@ const LoginPage = lazy(() =>
const CanvasPage = lazy(() =>
import('@/canvas/CanvasPage').then(module => ({ default: module.CanvasPage })),
)
const WorkspacePage = lazy(() => import('@/pages/WorkspacePage').then(module => ({ default: module.WorkspacePage })))
const ToolsPage = lazy(() => import('@/pages/ToolsPage').then(module => ({ default: module.ToolsPage })))
const ToolPage = lazy(() => import('@/pages/ToolPage').then(module => ({ default: module.ToolPage })))

function ToolsIndex() {
const [params] = useSearchParams()
return params.has('tool') ? <ToolPage /> : <ToolsPage />
}

const SearchPage = lazy(() =>
import('@/pages/SearchPage').then(module => ({ default: module.SearchPage })),
)
Expand Down Expand Up @@ -53,7 +62,7 @@ function AppBooting() {
<div className="grid h-svh place-items-center bg-background text-foreground">
<div className="flex items-center gap-3 font-mono text-xs text-muted-foreground">
<span className="size-2 animate-pulse rounded-full bg-primary shadow-[0_0_12px_var(--primary)]" />
control plane / loading
正在打开工作区
</div>
</div>
)
Expand Down Expand Up @@ -91,6 +100,9 @@ export default function App() {
<Suspense fallback={<AppBooting />}>
<Routes>
<Route element={<WorkspaceShell />}>
<Route element={<DeferredPage><ToolsIndex /></DeferredPage>} path="tools" />
<Route element={<DeferredPage><ToolPage /></DeferredPage>} path="tools/*" />
<Route element={<DeferredPage><CanvasPage /></DeferredPage>} path="canvas" />
<Route element={<DeferredPage><KeysPage /></DeferredPage>} path="manage/keys" />
<Route element={<DeferredPage><MaintenancePage /></DeferredPage>} path="manage/maintenance" />
<Route element={<DeferredPage><DeploymentPage /></DeferredPage>} path="manage/deployment" />
Expand All @@ -115,7 +127,7 @@ export default function App() {
<Route
element={(
<DeferredPage>
<CanvasPage />
<WorkspacePage />
</DeferredPage>
)}
index
Expand Down
4 changes: 2 additions & 2 deletions packages/dashboard/src/canvas/CanvasPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ export function CanvasPage() {
(path: string) => navigate(`/nodes/${encodeTreePath(path)}`),
[navigate],
)
const close = useCallback(() => navigate('/'), [navigate])
const close = useCallback(() => navigate('/canvas'), [navigate])
const openCommand = useCallback(
(path: string, commandName: string) => {
navigate(`/nodes/${encodeTreePath(path)}?tool=${encodeURIComponent(commandName)}`)
Expand All @@ -100,7 +100,7 @@ export function CanvasPage() {
const onUnmounted = useCallback(
(path: string) => {
const parent = parentPath(path)
navigate(parent === '' ? '/' : `/nodes/${encodeTreePath(parent)}`)
navigate(parent === '' ? '/canvas' : `/nodes/${encodeTreePath(parent)}`)
},
[navigate],
)
Expand Down
Loading
Loading