chore: v0.13.1 release prep — fix fake update, cleanup hot update, version bump

1. main.js: import package.json → __APP_VERSION__ (统一版本来源)
2. dev-api.js: check_panel_update 实现 GitHub/Gitee API 查询
   (与 Rust 端逻辑一致,Web 模式可正常检测新版本)
3. dev-api.js: 移除 check_hermes 中未使用的 enhanced 变量
4. i18n: 清理 14 个废弃的热更新相关翻译键
5. 版本号升级: 0.13.0 → 0.13.1
   (package.json, Cargo.toml, tauri.conf.json)
This commit is contained in:
晴天
2026-04-13 10:20:36 +08:00
parent 2b6f80091a
commit c88a652bc5
7 changed files with 26 additions and 21 deletions

View File

@@ -6289,7 +6289,27 @@ const handlers = {
return true
},
check_panel_update() { return { latest: null, url: 'https://github.com/qingchencloud/clawpanel/releases' } },
async check_panel_update() {
const sources = [
{ api: 'https://api.github.com/repos/qingchencloud/clawpanel/releases/latest', releases: 'https://github.com/qingchencloud/clawpanel/releases', name: 'github' },
{ api: 'https://gitee.com/api/v5/repos/QtCodeCreators/clawpanel/releases/latest', releases: 'https://gitee.com/QtCodeCreators/clawpanel/releases', name: 'gitee' },
]
let lastErr = ''
for (const src of sources) {
try {
const resp = await globalThis.fetch(src.api, {
signal: AbortSignal.timeout(8000),
headers: { 'User-Agent': 'ClawPanel' },
})
if (!resp.ok) { lastErr = `${src.name}: HTTP ${resp.status}`; continue }
const json = await resp.json()
const tag = (json.tag_name || '').replace(/^v/, '').trim()
if (!tag) { lastErr = `${src.name}: 未找到版本号`; continue }
return { latest: tag, url: json.html_url || src.releases, source: src.name, downloadUrl: 'https://claw.qt.cool' }
} catch (e) { lastErr = `${src.name}: ${e.message}`; continue }
}
return { latest: null, url: 'https://github.com/qingchencloud/clawpanel/releases', error: lastErr }
},
write_env_file({ path: p, config }) {
const expanded = p.startsWith('~/') ? path.join(homedir(), p.slice(2)) : p
@@ -6340,7 +6360,6 @@ const handlers = {
},
async check_hermes() {
const enhanced = hermesEnhancedPath()
const home = hermesHome()
const result = {}
// 1. 检测 hermes CLI