mirror of
https://github.com/qingchencloud/clawpanel.git
synced 2026-05-29 20:30:00 +08:00
fix(ui): sync latest upgrade copy in locale bundles
The runtime locale JSON bundles still contained the older About/Services policy copy even after the module-level strings were updated, so the About page could continue to show the old "recommended only" message in Chinese. This syncs the zh-CN/en locale bundles with the latest-upstream upgrade copy and mirrors the suffixed OpenClaw version comparison fix in the Web dev API. ## Verification - npm run build - node --check scripts/dev-api.js - cargo check
This commit is contained in:
@@ -758,15 +758,25 @@ function baseVersion(v) {
|
||||
return String(v || '').split('-')[0]
|
||||
}
|
||||
|
||||
function hasVersionSuffix(v) {
|
||||
return String(v || '').includes('-')
|
||||
}
|
||||
|
||||
// 判断 CLI 版本是否与推荐版匹配(考虑汉化版 -zh.x 后缀差异)
|
||||
function versionsMatch(cliVer, recommended) {
|
||||
if (cliVer === recommended) return true
|
||||
return baseVersion(cliVer) === baseVersion(recommended)
|
||||
if (baseVersion(cliVer) !== baseVersion(recommended)) return false
|
||||
return !hasVersionSuffix(cliVer)
|
||||
}
|
||||
|
||||
// 判断推荐版是否真的比当前版本更新(忽略 -zh.x 后缀)
|
||||
function recommendedIsNewer(recommended, current) {
|
||||
return versionGt(baseVersion(recommended), baseVersion(current))
|
||||
const baseCmp = versionCompare(baseVersion(recommended), baseVersion(current))
|
||||
if (baseCmp !== 0) return baseCmp > 0
|
||||
if (hasVersionSuffix(recommended) && hasVersionSuffix(current)) {
|
||||
return versionGt(recommended, current)
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
function loadVersionPolicy() {
|
||||
|
||||
Reference in New Issue
Block a user