feat: multi-OpenClaw CLI detection/binding + i18n infrastructure

Multi-OpenClaw Detection & Binding:
- Add resolve_openclaw_cli_path() and classify_cli_source() in utils.rs
- Support openclawCliPath binding in clawpanel.json (user selects CLI)
- VersionInfo now includes cli_path, cli_source, all_installations
- scan_all_installations() detects all OpenClaw installs on system
- Dashboard shows CLI source label + multi-install warning
- Settings page: CLI binding UI with auto-detect and manual selection
- dev-api.js synced with cli_path/cli_source fields for Web mode

i18n Infrastructure:
- Create src/lib/i18n.js core module (t(), setLang(), initI18n())
- Create src/locales/zh-CN.json and src/locales/en.json
- Sidebar fully i18n-ized (nav labels, sections, instance switcher)
- Dashboard stat cards fully i18n-ized
- Settings page: language switcher UI (live reload)
- initI18n() called in main.js on startup
This commit is contained in:
晴天
2026-03-24 11:57:00 +08:00
parent 7aa13ff7d5
commit 0c062e93e0
12 changed files with 951 additions and 84 deletions

View File

@@ -21,4 +21,18 @@ pub struct VersionInfo {
pub ahead_of_recommended: bool,
pub panel_version: String,
pub source: String,
/// 当前实际使用的 CLI 完整路径
pub cli_path: Option<String>,
/// CLI 安装来源标签: standalone / npm-zh / npm-official / unknown
pub cli_source: Option<String>,
/// 所有检测到的 OpenClaw 安装(路径 + 来源 + 版本)
pub all_installations: Option<Vec<OpenClawInstallation>>,
}
#[derive(Debug, Serialize, Deserialize)]
pub struct OpenClawInstallation {
pub path: String,
pub source: String,
pub version: Option<String>,
pub active: bool,
}