From 433a867d3f111e1eb873a69e2961436c090105b2 Mon Sep 17 00:00:00 2001 From: DBT Date: Sat, 28 Feb 2026 09:00:27 +0000 Subject: [PATCH] webui split: separate task management page from task audit (audit-only) --- webui/src/App.tsx | 2 + webui/src/components/Sidebar.tsx | 3 +- webui/src/i18n/index.ts | 2 + webui/src/pages/TaskAudit.tsx | 35 +------------ webui/src/pages/Tasks.tsx | 90 ++++++++++++++++++++++++++++++++ 5 files changed, 98 insertions(+), 34 deletions(-) create mode 100644 webui/src/pages/Tasks.tsx diff --git a/webui/src/App.tsx b/webui/src/App.tsx index 935a941..a52f129 100644 --- a/webui/src/App.tsx +++ b/webui/src/App.tsx @@ -12,6 +12,7 @@ import Logs from './pages/Logs'; import Skills from './pages/Skills'; import Memory from './pages/Memory'; import TaskAudit from './pages/TaskAudit'; +import Tasks from './pages/Tasks'; export default function App() { return ( @@ -29,6 +30,7 @@ export default function App() { } /> } /> } /> + } /> diff --git a/webui/src/components/Sidebar.tsx b/webui/src/components/Sidebar.tsx index e220102..d87003a 100644 --- a/webui/src/components/Sidebar.tsx +++ b/webui/src/components/Sidebar.tsx @@ -1,5 +1,5 @@ import React from 'react'; -import { LayoutDashboard, MessageSquare, Settings, Clock, Server, Terminal, Zap, FolderOpen, ClipboardList } from 'lucide-react'; +import { LayoutDashboard, MessageSquare, Settings, Clock, Server, Terminal, Zap, FolderOpen, ClipboardList, ListTodo } from 'lucide-react'; import { useTranslation } from 'react-i18next'; import { useAppContext } from '../context/AppContext'; import NavItem from './NavItem'; @@ -22,6 +22,7 @@ const Sidebar: React.FC = () => { } label={t('nodes')} to="/nodes" /> } label={t('memory')} to="/memory" /> } label={t('taskAudit')} to="/task-audit" /> + } label={t('tasks')} to="/tasks" />
diff --git a/webui/src/i18n/index.ts b/webui/src/i18n/index.ts index d5c64b1..7e7e9fb 100644 --- a/webui/src/i18n/index.ts +++ b/webui/src/i18n/index.ts @@ -14,6 +14,7 @@ const resources = { skills: 'Skills', memory: 'Memory', taskAudit: 'Task Audit', + tasks: 'Tasks', taskList: 'Task List', taskDetail: 'Task Detail', taskQueue: 'Task Queue', @@ -183,6 +184,7 @@ const resources = { skills: '技能管理', memory: '记忆文件', taskAudit: '任务审计', + tasks: '任务管理', taskList: '任务列表', taskDetail: '任务详情', taskQueue: '任务队列', diff --git a/webui/src/pages/TaskAudit.tsx b/webui/src/pages/TaskAudit.tsx index 043ba7f..e00c2bf 100644 --- a/webui/src/pages/TaskAudit.tsx +++ b/webui/src/pages/TaskAudit.tsx @@ -32,7 +32,6 @@ const TaskAudit: React.FC = () => { const [loading, setLoading] = useState(false); const [sourceFilter, setSourceFilter] = useState('all'); const [statusFilter, setStatusFilter] = useState('all'); - const [draft, setDraft] = useState({ id: '', content: '', priority: 'normal', status: 'todo', source: 'manual', due_at: '' }); const [dailyReport, setDailyReport] = useState(''); const [reportDate, setReportDate] = useState(new Date().toISOString().slice(0,10)); @@ -101,20 +100,6 @@ const TaskAudit: React.FC = () => { setSelected(null); setDraft({ id: '', content: '', priority: 'normal', status: 'todo', source: 'manual', due_at: '' }); }; - const saveTask = async (action: 'create'|'update'|'delete') => { - try { - const url = `/webui/api/tasks${q}`; - const payload: any = { action }; - if (action === 'create') payload.item = draft; - if (action === 'update') { payload.id = draft.id; payload.item = draft; } - if (action === 'delete') payload.id = draft.id; - const r = await fetch(url, { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify(payload) }); - if (!r.ok) throw new Error(await r.text()); - await fetchData(); - } catch (e) { - console.error(e); - } - }; const selectedPretty = useMemo(() => selected ? JSON.stringify(selected, null, 2) : '', [selected]); return ( @@ -138,7 +123,6 @@ const TaskAudit: React.FC = () => { -
@@ -165,7 +149,7 @@ const TaskAudit: React.FC = () => { return ( )} -
-
{t('taskCrud')} {selected ? `(${selected.task_id || selected.id || ''})` : '(new)'}
- setDraft({ ...draft, id: e.target.value })} placeholder="id" className="w-full px-2 py-1 text-xs bg-zinc-900 border border-zinc-700 rounded" /> -