From 39cf47fb9bbe278381a5efd3d3901f4a7754b0a6 Mon Sep 17 00:00:00 2001 From: cfdaily Date: Sun, 17 May 2026 06:35:53 +0800 Subject: [PATCH] auto-sync: 2026-05-17 06:35:53 --- src/frontend/src/pages/Config.tsx | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/src/frontend/src/pages/Config.tsx b/src/frontend/src/pages/Config.tsx index a7d78f7..7eaa926 100644 --- a/src/frontend/src/pages/Config.tsx +++ b/src/frontend/src/pages/Config.tsx @@ -6,6 +6,7 @@ import * as api from '../api'; export function Config() { const { projects, loading, refresh } = useProjects(); + const [newId, setNewId] = useState(''); const [newName, setNewName] = useState(''); const [newDesc, setNewDesc] = useState(''); const [creating, setCreating] = useState(false); @@ -16,7 +17,8 @@ export function Config() { try { setCreating(true); setError(null); - await api.createProject({ name: newName, description: newDesc || null }); + await api.createProject({ id: newId || undefined, name: newName, description: newDesc || null }); + setNewId(''); setNewName(''); setNewDesc(''); refresh(); @@ -35,6 +37,20 @@ export function Config() {
创建项目
+ setNewId(e.target.value)} + style={{ + width: 200, + padding: '6px 10px', + borderRadius: 'var(--radius)', + border: '1px solid var(--line)', + background: 'var(--bg)', + color: 'var(--fg)', + }} + /> {creating ? '创建中...' : '创建'}