From e3e1ab5586a0434b9c3a55b4e52686107aaaffed Mon Sep 17 00:00:00 2001 From: lpf Date: Sat, 7 Mar 2026 22:28:20 +0800 Subject: [PATCH] fix: simplify dashboard and agents canvas panel --- webui/src/index.css | 19 ------------ webui/src/pages/Dashboard.tsx | 55 ++--------------------------------- webui/src/pages/Subagents.tsx | 4 +-- 3 files changed, 5 insertions(+), 73 deletions(-) diff --git a/webui/src/index.css b/webui/src/index.css index 8c912ea..1659476 100644 --- a/webui/src/index.css +++ b/webui/src/index.css @@ -332,25 +332,6 @@ html.theme-dark .brand-button { border-radius: var(--radius-panel); } -.topology-stream-panel { - left: 1rem; - right: 1rem; - bottom: 1rem; - height: 48vh; -} - -@media (min-width: 768px) { - .topology-stream-panel { - left: auto; - right: 1rem; - top: 1rem; - bottom: 1rem; - width: 360px; - max-width: calc(100% - 2rem); - height: auto; - } -} - .rounded-xl { border-radius: var(--radius-button) !important; } diff --git a/webui/src/pages/Dashboard.tsx b/webui/src/pages/Dashboard.tsx index 6a776b9..fcc4a8c 100644 --- a/webui/src/pages/Dashboard.tsx +++ b/webui/src/pages/Dashboard.tsx @@ -1,5 +1,5 @@ import React, { useMemo } from 'react'; -import { RefreshCw, Activity, MessageSquare, Clock, Server, Wrench, Sparkles, AlertTriangle, Workflow } from 'lucide-react'; +import { RefreshCw, Activity, MessageSquare, Wrench, Sparkles, AlertTriangle, Workflow } from 'lucide-react'; import { useTranslation } from 'react-i18next'; import { useAppContext } from '../context/AppContext'; import StatCard from '../components/StatCard'; @@ -9,8 +9,6 @@ const Dashboard: React.FC = () => { const { isGatewayOnline, sessions, - cron, - nodes, refreshAll, gatewayVersion, webuiVersion, @@ -20,30 +18,6 @@ const Dashboard: React.FC = () => { ekgSummary, } = useAppContext(); - const parsedNodes = useMemo(() => { - try { - const arr = JSON.parse(nodes); - return Array.isArray(arr) ? arr : []; - } catch { - return []; - } - }, [nodes]); - - const onlineNodes = useMemo( - () => parsedNodes.filter((n: any) => n?.online).length, - [parsedNodes], - ); - - const pausedCron = useMemo( - () => cron.filter((job) => !job.enabled).length, - [cron], - ); - - const enabledCron = useMemo( - () => cron.filter((job) => job.enabled).length, - [cron], - ); - const subagentCount = useMemo(() => { const subagents = (cfg as any)?.agents?.subagents || {}; return Object.keys(subagents).length; @@ -79,13 +53,12 @@ const Dashboard: React.FC = () => { -
+
} /> } /> - } /> - } /> } /> } /> + } />
@@ -115,28 +88,6 @@ const Dashboard: React.FC = () => {
-
-
-
- -

{t('recentCron')}

-
-
-
-
{t('active')}
-
{enabledCron}
-
-
-
{t('paused')}
-
{pausedCron}
-
-
-
- {cron.length === 0 ? t('noCronJobs') : `${cron.length} ${t('cronJobs')}`} -
-
-
-
diff --git a/webui/src/pages/Subagents.tsx b/webui/src/pages/Subagents.tsx index 68ee0c8..594fac4 100644 --- a/webui/src/pages/Subagents.tsx +++ b/webui/src/pages/Subagents.tsx @@ -1174,7 +1174,7 @@ const Subagents: React.FC = () => { {selectedAgentID && (
event.stopPropagation()} - className="topology-stream-panel radius-panel absolute z-20 brand-card border border-zinc-800 shadow-2xl shadow-black/40 backdrop-blur-md overflow-hidden flex flex-col" + className="absolute bottom-4 left-4 right-4 z-20 flex h-[46vh] flex-col overflow-hidden border border-zinc-800 brand-card radius-panel shadow-2xl shadow-black/40 backdrop-blur-md md:left-auto md:top-4 md:right-4 md:bottom-4 md:h-auto md:w-[360px] md:max-w-[calc(100%-2rem)] xl:w-[380px]" >
@@ -1189,7 +1189,7 @@ const Subagents: React.FC = () => { setStreamTask(null); setStreamItems([]); }} - className="px-2 py-1 rounded-xl bg-zinc-800 hover:bg-zinc-700 text-[11px] text-zinc-200" + className="px-2 py-1 rounded-xl text-[11px] control-chip" > {t('close')}