优化:初始设置页面自动创建默认配置文件

当检测到 OpenClaw CLI 已安装但 openclaw.json 不存在时:
1. 自动创建包含合理默认值的配置文件(mode:local, tools:full 等)
2. 如果自动创建失败,显示「一键初始化配置」按钮供手动操作
3. 新增 init_openclaw_config API(dev-api.js + Tauri Rust 后端)
4. 用户不再需要去终端手动执行 openclaw configure
This commit is contained in:
晴天
2026-03-05 23:14:13 +08:00
parent b709b70839
commit bb2c6df8ec
5 changed files with 99 additions and 3 deletions

View File

@@ -286,6 +286,7 @@ export const api = {
// 安装/部署
checkInstallation: () => cachedInvoke('check_installation', {}, 60000),
initOpenclawConfig: () => { invalidate('check_installation'); return invoke('init_openclaw_config') },
checkNode: () => cachedInvoke('check_node', {}, 60000),
checkNodeAtPath: (nodeDir) => invoke('check_node_at_path', { node_dir: nodeDir }),
scanNodePaths: () => invoke('scan_node_paths'),