mirror of
https://github.com/qingchencloud/clawpanel.git
synced 2026-05-06 20:02:49 +08:00
发布 v0.4.5:修复 nvm 兼容性 + 自动初始化配置
修复: - nvm 用户 Node.js/CLI 检测失败(扫描 nvm 版本目录) - Tauri v2 参数名 snake_case → camelCase 不匹配 - Windows CLI 检测遗漏(增加 PATH 兜底) - Agent/记忆文件页面晦涩 os error 2 → 中文提示 - cargo fmt + clippy 修复 新增: - 初始设置自动创建配置文件 + 一键初始化按钮 - ClawPanel Web 版部署文档 + 文档中心
This commit is contained in:
15
CHANGELOG.md
15
CHANGELOG.md
@@ -5,6 +5,21 @@
|
||||
格式遵循 [Keep a Changelog](https://keepachangelog.com/zh-CN/1.1.0/),
|
||||
版本号遵循 [语义化版本](https://semver.org/lang/zh-CN/)。
|
||||
|
||||
## [0.4.5] - 2026-03-06
|
||||
|
||||
### 修复 (Bug Fixes)
|
||||
|
||||
- **nvm 用户 Node.js/CLI 检测失败** — `enhanced_path()` 新增扫描 `~/.nvm/versions/node/*/bin`(macOS/Linux)和 `%APPDATA%\nvm\*`(Windows),从 Finder/桌面启动也能找到 nvm 安装的 Node.js
|
||||
- **Tauri v2 参数名不匹配** — `check_node_at_path`、`save_custom_node_path` 及所有 memory 函数的 snake_case 参数改为 camelCase,修复手动指定 Node.js 路径报 `missing required key` 的问题
|
||||
- **Windows OpenClaw CLI 检测遗漏** — `is_cli_installed()` 仅检查 `%APPDATA%\npm\openclaw.cmd`,新增通过 PATH 运行 `openclaw --version` 兜底,兼容 nvm、自定义 prefix 等安装方式
|
||||
- **Agent 管理/记忆文件页面晦涩错误** — `No such file or directory (os error 2)` 替换为中文提示「OpenClaw CLI 未找到,请确认已安装并重启 ClawPanel」
|
||||
|
||||
### 新增 (Features)
|
||||
|
||||
- **初始设置自动创建配置文件** — 检测到 CLI 已装但 `openclaw.json` 不存在时,自动创建含合理默认值的配置文件(mode:local, tools:full 等),无需手动执行 `openclaw configure`
|
||||
- **一键初始化配置按钮** — 自动创建失败时,设置页第三步显示「一键初始化配置」按钮作为手动备选
|
||||
- **ClawPanel Web 版部署文档** — 新增 Linux 一键部署脚本和 Docker 部署指南,官网增加文档中心
|
||||
|
||||
## [0.4.4] - 2026-03-06
|
||||
|
||||
### 新增 (Features)
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "clawpanel",
|
||||
"version": "0.4.4",
|
||||
"version": "0.4.5",
|
||||
"private": true,
|
||||
"description": "ClawPanel - OpenClaw 可视化管理面板,基于 Tauri v2 的跨平台桌面应用",
|
||||
"type": "module",
|
||||
|
||||
2
src-tauri/Cargo.lock
generated
2
src-tauri/Cargo.lock
generated
@@ -328,7 +328,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "clawpanel"
|
||||
version = "0.4.4"
|
||||
version = "0.4.5"
|
||||
dependencies = [
|
||||
"base64 0.22.1",
|
||||
"chrono",
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "clawpanel"
|
||||
version = "0.4.4"
|
||||
version = "0.4.5"
|
||||
edition = "2021"
|
||||
description = "ClawPanel - OpenClaw 可视化管理面板"
|
||||
authors = ["qingchencloud"]
|
||||
|
||||
@@ -514,10 +514,20 @@ pub async fn upgrade_openclaw(app: tauri::AppHandle, source: String) -> Result<S
|
||||
// 自动配置 git 使用 HTTPS 替代 SSH,避免用户没配 SSH Key 导致依赖安装失败
|
||||
let _ = app.emit("upgrade-log", "配置 Git HTTPS 模式...");
|
||||
let _ = Command::new("git")
|
||||
.args(["config", "--global", "url.https://github.com/.insteadOf", "ssh://git@github.com/"])
|
||||
.args([
|
||||
"config",
|
||||
"--global",
|
||||
"url.https://github.com/.insteadOf",
|
||||
"ssh://git@github.com/",
|
||||
])
|
||||
.output();
|
||||
let _ = Command::new("git")
|
||||
.args(["config", "--global", "url.https://github.com/.insteadOf", "git@github.com:"])
|
||||
.args([
|
||||
"config",
|
||||
"--global",
|
||||
"url.https://github.com/.insteadOf",
|
||||
"git@github.com:",
|
||||
])
|
||||
.output();
|
||||
|
||||
let _ = app.emit("upgrade-log", format!("$ npm install -g {pkg}"));
|
||||
@@ -658,8 +668,8 @@ pub fn init_openclaw_config() -> Result<Value, String> {
|
||||
"tools": { "profile": "full", "sessions": { "visibility": "all" } }
|
||||
});
|
||||
|
||||
let content = serde_json::to_string_pretty(&default_config)
|
||||
.map_err(|e| format!("序列化失败: {e}"))?;
|
||||
let content =
|
||||
serde_json::to_string_pretty(&default_config).map_err(|e| format!("序列化失败: {e}"))?;
|
||||
std::fs::write(&config_path, content).map_err(|e| format!("写入失败: {e}"))?;
|
||||
|
||||
result.insert("created".into(), Value::Bool(true));
|
||||
@@ -749,8 +759,8 @@ pub fn scan_node_paths() -> Result<Value, String> {
|
||||
#[cfg(target_os = "windows")]
|
||||
{
|
||||
let pf = std::env::var("ProgramFiles").unwrap_or_else(|_| r"C:\Program Files".into());
|
||||
let pf86 = std::env::var("ProgramFiles(x86)")
|
||||
.unwrap_or_else(|_| r"C:\Program Files (x86)".into());
|
||||
let pf86 =
|
||||
std::env::var("ProgramFiles(x86)").unwrap_or_else(|_| r"C:\Program Files (x86)".into());
|
||||
let localappdata = std::env::var("LOCALAPPDATA").unwrap_or_default();
|
||||
let appdata = std::env::var("APPDATA").unwrap_or_default();
|
||||
|
||||
|
||||
@@ -17,6 +17,7 @@ pub fn openclaw_dir() -> PathBuf {
|
||||
/// Tauri 应用启动时 PATH 可能不完整:
|
||||
/// - macOS 从 Finder 启动时 PATH 只有 /usr/bin:/bin:/usr/sbin:/sbin
|
||||
/// - Windows 上安装 Node.js 到非默认路径、或安装后未重启进程
|
||||
///
|
||||
/// 补充 Node.js / npm 常见安装路径
|
||||
pub fn enhanced_path() -> String {
|
||||
let current = std::env::var("PATH").unwrap_or_default();
|
||||
@@ -71,14 +72,12 @@ pub fn enhanced_path() -> String {
|
||||
#[cfg(target_os = "windows")]
|
||||
{
|
||||
let pf = std::env::var("ProgramFiles").unwrap_or_else(|_| r"C:\Program Files".into());
|
||||
let pf86 = std::env::var("ProgramFiles(x86)").unwrap_or_else(|_| r"C:\Program Files (x86)".into());
|
||||
let pf86 =
|
||||
std::env::var("ProgramFiles(x86)").unwrap_or_else(|_| r"C:\Program Files (x86)".into());
|
||||
let localappdata = std::env::var("LOCALAPPDATA").unwrap_or_default();
|
||||
let appdata = std::env::var("APPDATA").unwrap_or_default();
|
||||
|
||||
let mut extra: Vec<String> = vec![
|
||||
format!(r"{}\nodejs", pf),
|
||||
format!(r"{}\nodejs", pf86),
|
||||
];
|
||||
let mut extra: Vec<String> = vec![format!(r"{}\nodejs", pf), format!(r"{}\nodejs", pf86)];
|
||||
if !localappdata.is_empty() {
|
||||
extra.push(format!(r"{}\Programs\nodejs", localappdata));
|
||||
extra.push(format!(r"{}\fnm_multishells", localappdata));
|
||||
|
||||
@@ -206,6 +206,7 @@ mod platform {
|
||||
|
||||
#[cfg(target_os = "windows")]
|
||||
mod platform {
|
||||
use std::os::windows::process::CommandExt;
|
||||
use tokio::process::Command as TokioCommand;
|
||||
|
||||
/// Windows 不需要 UID
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"$schema": "https://raw.githubusercontent.com/tauri-apps/tauri/dev/crates/tauri-config-schema/schema.json",
|
||||
"productName": "ClawPanel",
|
||||
"version": "0.4.4",
|
||||
"version": "0.4.5",
|
||||
"identifier": "ai.openclaw.clawpanel",
|
||||
"build": {
|
||||
"frontendDist": "../dist",
|
||||
|
||||
Reference in New Issue
Block a user