From ae93ef37b6d8e9b1e5c6c7b4b7f43d9286c9b1a1 Mon Sep 17 00:00:00 2001 From: goulustis Date: Thu, 5 Mar 2026 15:19:10 +0800 Subject: [PATCH] update UI --- frontend/src/App.tsx | 37 ++++++++++++++++++++++------ frontend/src/styles.css | 53 +++++++++++++++++++++++++++++++++++++++++ 2 files changed, 83 insertions(+), 7 deletions(-) diff --git a/frontend/src/App.tsx b/frontend/src/App.tsx index 8848d68..5329e68 100644 --- a/frontend/src/App.tsx +++ b/frontend/src/App.tsx @@ -148,18 +148,29 @@ export default function App() { () => chooseDisplayItemsByPipeline(visibleConfigItems), [visibleConfigItems] ); + const runningPipelineIdSet = useMemo(() => { + const ids = new Set(); + for (const run of running) { + if (run.enabled) { + ids.add(run.pipeline_id); + } + } + return ids; + }, [running]); const selectedRuns = useMemo(() => { - if (!editor?.pipelineId) { + const pipelineId = editor?.pipelineId.trim(); + if (!pipelineId) { return []; } return running.filter((run) => { - if (run.pipeline_id !== editor.pipelineId) { + if (run.pipeline_id !== pipelineId) { return false; } - return true; + return run.enabled; }); }, [editor, running]); + const isEditorRunning = selectedRuns.length > 0; async function refreshConfigs(): Promise { const resp = await listGraphConfigs(); @@ -532,12 +543,14 @@ export default function App() { id: d.id, label: d.pipelineId || "(new agent)", graphId: d.graphId, + isRunning: d.pipelineId ? runningPipelineIdSet.has(d.pipelineId.trim()) : false, isDraft: true, })), ...displayConfigItems.map((item) => ({ id: makeAgentKey(item.pipeline_id), label: item.pipeline_id, graphId: item.graph_id || item.pipeline_id, + isRunning: runningPipelineIdSet.has(item.pipeline_id), isDraft: false, })), ]; @@ -573,7 +586,12 @@ export default function App() { } }} > - {row.label} + + {row.label} + + {row.isRunning ? "Running" : "Stopped"} + + {row.graphId} ))} @@ -612,10 +630,10 @@ export default function App() { - -