feat(ui): 状态栏「检查更新」左边显示当前版本号(v2.6.5)
老板要求:检查更新左侧加入当前版本的版本号。
· index.html:在 UTF-8 和「检查更新」之间加 <span id="st-ver">,
静态值只是兜底(无 JS / Electron 版时的显示)
· main.rs:新增 app_version 命令,直接读 AppHandle 的 package_info,
不联网、不读配置文件 —— 保证显示的版本和程序本体一致
· tauri-bridge.js:启动时 invoke('app_version') 覆盖静态值
状态栏现在是:
0 字 | 0 字符 | 第 1 行, 第 1 列 | UTF-8 | v2.6.5 | 检查更新
官网截图同步重出(旧图的状态栏没有版本号),四张合计 548KB。
已构建发布 2.6.5:xymd_2.6.5.exe + .sig,签名实验通过。
This commit is contained in:
1 parent
b0c3ae4209
commit
580e875be5
13 files changed
+30
-13
No files matched your search
@@ -165,6 +165,14 @@
|
||||
if (updateBtn) updateBtn.addEventListener('click', runUpdate);
|
||||
let updating = false;
|
||||
|
||||
// 状态栏显示当前版本(静态值只是兜底,这里用真实版本覆盖)
|
||||
const verEl = document.getElementById('st-ver');
|
||||
if (verEl) {
|
||||
invoke('app_version')
|
||||
.then((v) => { if (v) verEl.textContent = 'v' + v; })
|
||||
.catch(() => {});
|
||||
}
|
||||
|
||||
/* 升级进度浮层 */
|
||||
function progressUI(title) {
|
||||
const mask = document.createElement('div');
|
||||
|
||||
Reference in new issue
Block a user