mirror of
https://github.com/qingchencloud/clawpanel.git
synced 2026-06-28 19:21:30 +08:00
fix(setup): 完善 Node 版本检测与升级引导
This commit is contained in:
@@ -23,6 +23,11 @@
|
||||
import { t } from './i18n.js'
|
||||
|
||||
const PATTERNS = [
|
||||
// Node.js 版本不满足当前 OpenClaw 要求
|
||||
{
|
||||
key: 'nodeVersion',
|
||||
re: /(node\.?js.*(版本过低|too old)|requires node|要求\s*[><=^~]*\d|node.*version.*(too old|unsupported))/i,
|
||||
},
|
||||
// 网络
|
||||
{
|
||||
key: 'network',
|
||||
@@ -90,6 +95,7 @@ function toRawString(e) {
|
||||
|
||||
// 不同错误类型默认对应的行动按钮(label 走 i18n,route 直接跳转)
|
||||
const DEFAULT_ACTIONS = {
|
||||
nodeVersion: { labelKey: 'common.errorAction.checkNode', route: '/setup' },
|
||||
gatewayDown: { labelKey: 'common.errorAction.startGateway', route: '/services' },
|
||||
cmdMissing: { labelKey: 'common.errorAction.openSettings', route: '/settings' },
|
||||
permission: { labelKey: 'common.errorAction.openSettings', route: '/settings' },
|
||||
|
||||
@@ -397,6 +397,7 @@ export const api = {
|
||||
checkGit: () => cachedInvoke('check_git', {}, 60000),
|
||||
scanGitPaths: () => invoke('scan_git_paths'),
|
||||
autoInstallGit: () => invoke('auto_install_git'),
|
||||
autoInstallNode: () => invoke('auto_install_node').then(r => { invalidate('check_node', 'get_services_status'); invoke('invalidate_path_cache').catch(() => {}); return r }),
|
||||
configureGitHttps: () => invoke('configure_git_https'),
|
||||
getDeployConfig: () => cachedInvoke('get_deploy_config'),
|
||||
patchModelVision: () => invoke('patch_model_vision'),
|
||||
|
||||
Reference in New Issue
Block a user