feat: 添加配置面板组件

- 新增 ConfigPanel 组件,支持模型选择、参数调整
- 添加配置 API (getConfig/updateConfig)
- 在 App.tsx 中集成配置按钮和面板
This commit is contained in:
2025-12-12 12:14:39 +08:00
parent 6438ecf2a6
commit b5d3b7df57
3 changed files with 329 additions and 17 deletions
+18
View File
@@ -161,3 +161,21 @@ export async function getFileTree(path: string = '.', depth: number = 3): Promis
const params = new URLSearchParams({ path, depth: String(depth) });
return request('GET', `/files/tree?${params}`);
}
// Config
export interface ServerConfig {
model: string;
maxTokens: number;
temperature: number;
workdir: string;
allowedPaths: string[];
deniedPaths: string[];
}
export async function getConfig(): Promise<{ success: boolean; data: ServerConfig }> {
return request('GET', '/config');
}
export async function updateConfig(config: Partial<ServerConfig>): Promise<{ success: boolean; data: ServerConfig }> {
return request('PATCH', '/config', config);
}