feat: 添加配置面板组件
- 新增 ConfigPanel 组件,支持模型选择、参数调整 - 添加配置 API (getConfig/updateConfig) - 在 App.tsx 中集成配置按钮和面板
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user