feat(ui): 更新入口移到状态栏右下角「检查更新」,弹窗精简并居中(v2.6.3)
老板看实际界面后提的三点:
1. 升级弹窗里「当前版本 v2.6.2」那行去掉
2. 弹窗按钮居中
3. 工具条右上角的更新图标不要了,改到右下角、蓝色文字链接「检查更新」
改动:
· index.html:删掉 <button id="btn-update">(工具条图标);
在 .statusbar 的 .st-right 末尾加 <a class="st-link" id="btn-update">检查更新</a>
· style.css:.st-link 用主题色 var(--accent)(浅色 #2f6feb / 深色 #4f8ef7),hover 下划线,
.busy 时降透明度并禁用点击
· tauri-bridge.js:
- 「已是最新版本」弹窗不再带 detail(去掉当前版本行)
- 「发现新版本」的说明里也不再写「当前 vX →」,只留发布时间 + 更新说明
- 模态框按钮行 justify-content: flex-end → center(Tauri 下所有模态统一)
- 状态栏是 <a>,没有 disabled,改用 updating 标志 + .busy 类
版本 2.6.2 → 2.6.3,已构建并发布:
· xymd_2.6.3.exe(2.21 MB)+ .sig
· latest.json 指向新包,签名按 minisign 规则实验通过
This commit is contained in:
1 parent
b0e2d91376
commit
9222e79760
8 files changed
+28
-29
No files matched your search
+1
-1
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "xiaoyin-markdown-editor",
|
||||
"productName": "XiaoyinMarkdown",
|
||||
"version": "2.6.2",
|
||||
"version": "2.6.3",
|
||||
"description": "轻量本地 Markdown 编辑器:实时预览、多标签/多窗口、查找高亮、右键复制全文/打开目录、常用快捷键",
|
||||
"main": "src/main.js",
|
||||
"author": "小银",
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
{
|
||||
"version": "2.6.2",
|
||||
"notes": "新增「在线升级」:点一下就能检查新版本并自动覆盖安装、重启。\n官网地址 https://md.wangjinding.com/update/latest.json\n\n本次还包含:\n· 工具条新增升级按钮(发现新版本时弹窗,可看更新说明)\n· 下载走签名校验,安装包被篡改会被拒绝",
|
||||
"pub_date": "2026-11-20T02:29:06Z",
|
||||
"version": "2.6.3",
|
||||
"notes": "更新入口改到状态栏右下角(蓝色「检查更新」文字链接),工具条上的更新图标去掉。\n升级弹窗不再显示当前版本,按钮居中。版本号提示保持简洁。",
|
||||
"pub_date": "2026-11-20T02:42:06Z",
|
||||
"platforms": {
|
||||
"windows-x86_64": {
|
||||
"signature": "dW50cnVzdGVkIGNvbW1lbnQ6IHNpZ25hdHVyZSBmcm9tIHRhdXJpIHNlY3JldCBrZXkKUlVSWWkrQjVjQnNqN2l5cDhYZE1RbW5weXRjUkdsQTdVOS9KL2VDRElIelpZd0trT1pQTG5sZVNWWFJNRExIcWs4R2VDRVFlTWExYk9HQ01LbXJoVzZmMWpRQm9HQU1ZZ0FjPQp0cnVzdGVkIGNvbW1lbnQ6IHRpbWVzdGFtcDoxNzk1MTQxMTUwCWZpbGU6WGlhb3lpbk1hcmtkb3duXzIuNi4yX3g2NC1zZXR1cC5leGUJdmVyc2lvbjoyLjYuMgpJOVZmM0c4bG9sSXE3UlRjRGdtamZkemVnMVZhand3cTBES2VsSFUyS1Zad0gzNWdZU3lIMnVqSHkzZGtkdkdGcThHZUdmUEFJc1d4QVFyeFUrbXdEdz09Cg==",
|
||||
"url": "https://md.wangjinding.com/download/xymd_2.6.2.exe",
|
||||
"size": 2314969,
|
||||
"sha256": "61baa671049fb60886ec11c0d6d086da9cd6cebacfbf2f78c1be574853801223"
|
||||
"signature": "dW50cnVzdGVkIGNvbW1lbnQ6IHNpZ25hdHVyZSBmcm9tIHRhdXJpIHNlY3JldCBrZXkKUlVSWWkrQjVjQnNqN2pDQXcvUEM5WGhyOTluTlB3NTRGMlZ6TEpBTDNFWHQzNXNkcmU3QlY3WHJJSVYvSUUzSjRNZFRGSDdyb1VGZ2R0MkU1UUZ2V1NjYU1FMTNjbEl0d0FZPQp0cnVzdGVkIGNvbW1lbnQ6IHRpbWVzdGFtcDoxNzk1MTQyNDE2CWZpbGU6WGlhb3lpbk1hcmtkb3duXzIuNi4zX3g2NC1zZXR1cC5leGUJdmVyc2lvbjoyLjYuMwp0U2JUdDlvd3Z1MzYxUE41VW10dTJFRjNNeDgvTXhRVWJMSWovdVFKSmtnUG8vM2lFNUxJa3Axa3lWMnd5NmRheEtMWlBJOXVDZGVvWm8yL0J5bGdDZz09Cg==",
|
||||
"url": "https://md.wangjinding.com/download/xymd_2.6.3.exe",
|
||||
"size": 2315317,
|
||||
"sha256": "d50922f3dfc5e7315a6fe8466bcf593fd5adda2a7d10d3211e389e219fc02ce8"
|
||||
}
|
||||
}
|
||||
}
|
||||
Generated
+1
-1
@@ -5368,7 +5368,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "xiaoyin-markdown"
|
||||
version = "2.6.2"
|
||||
version = "2.6.3"
|
||||
dependencies = [
|
||||
"clipboard-win",
|
||||
"serde",
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "xiaoyin-markdown"
|
||||
version = "2.6.2"
|
||||
version = "2.6.3"
|
||||
description = "小银 Markdown —— 轻量本地 Markdown 编辑器"
|
||||
edition = "2021"
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"$schema": "https://schema.tauri.app/config/2",
|
||||
"productName": "XiaoyinMarkdown",
|
||||
"version": "2.6.2",
|
||||
"version": "2.6.3",
|
||||
"identifier": "com.xiaoyin.markdown",
|
||||
"build": {
|
||||
"frontendDist": "../src/renderer"
|
||||
|
||||
@@ -80,9 +80,6 @@
|
||||
<span id="openmode-label">标签</span>
|
||||
</button>
|
||||
|
||||
<button class="tb-icon" id="btn-update" title="检查更新 / 在线升级" hidden>
|
||||
<svg viewBox="0 0 16 16"><path d="M7.25 1.4h1.5v6.15l2.29-2.3 1.06 1.07L8 10.5 3.9 6.32 4.96 5.25l2.29 2.3V1.4zM2 11h1.5v2.5h9V11H14v4H2v-4z"/></svg>
|
||||
</button>
|
||||
|
||||
<button class="tb-icon" id="btn-theme" title="切换深色/浅色 (Ctrl+Shift+L)">
|
||||
<svg viewBox="0 0 16 16"><path d="M8 1a7 7 0 100 14A7 7 0 008 1zm0 1.5v11a5.5 5.5 0 010-11z"/></svg>
|
||||
@@ -164,6 +161,8 @@
|
||||
<span id="st-cursor">第 1 行, 第 1 列</span>
|
||||
<span class="st-div">|</span>
|
||||
<span>UTF-8</span>
|
||||
<span class="st-div">|</span>
|
||||
<a class="st-link" id="btn-update" title="检查更新">检查更新</a>
|
||||
</div>
|
||||
</footer>
|
||||
|
||||
|
||||
@@ -699,6 +699,10 @@ html[data-theme="dark"] .markdown-body code { color: #f0a1c0; }
|
||||
color: var(--text-faint);
|
||||
}
|
||||
.st-left, .st-right { display: flex; align-items: center; gap: 8px; }
|
||||
/* 状态栏里的「检查更新」文字链接 */
|
||||
.st-link { color: var(--accent); cursor: pointer; text-decoration: none; }
|
||||
.st-link:hover { text-decoration: underline; }
|
||||
.st-link.busy { opacity: .5; pointer-events: none; }
|
||||
.st-file { color: var(--text-dim); max-width: 46vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
|
||||
.st-dirty {
|
||||
padding: 1px 6px;
|
||||
|
||||
@@ -38,7 +38,7 @@
|
||||
box.appendChild(d);
|
||||
}
|
||||
const row = document.createElement('div');
|
||||
row.style.cssText = 'display:flex;gap:8px;justify-content:flex-end;';
|
||||
row.style.cssText = 'display:flex;gap:10px;justify-content:center;margin-top:4px;';
|
||||
buttons.forEach((label, i) => {
|
||||
const b = document.createElement('button');
|
||||
b.textContent = label;
|
||||
@@ -161,10 +161,8 @@
|
||||
|
||||
/* ---------- 在线升级(服务端:https://md.wangjinding.com/update/latest.json) ---------- */
|
||||
const updateBtn = document.getElementById('btn-update');
|
||||
if (updateBtn) {
|
||||
updateBtn.hidden = false;
|
||||
updateBtn.addEventListener('click', runUpdate);
|
||||
}
|
||||
if (updateBtn) updateBtn.addEventListener('click', runUpdate);
|
||||
let updating = false;
|
||||
|
||||
/* 升级进度浮层 */
|
||||
function progressUI(title) {
|
||||
@@ -207,21 +205,18 @@
|
||||
}
|
||||
|
||||
async function runUpdate() {
|
||||
if (!updateBtn || updateBtn.disabled) return;
|
||||
updateBtn.disabled = true;
|
||||
if (!updateBtn || updating) return;
|
||||
updating = true;
|
||||
updateBtn.classList.add('busy');
|
||||
try {
|
||||
const st = await invoke('check_update');
|
||||
if (!st || !st.available) {
|
||||
await modalDialog({
|
||||
message: '已是最新版本',
|
||||
detail: `当前版本 v${(st && st.current) || ''}`,
|
||||
buttons: ['好'],
|
||||
});
|
||||
await modalDialog({ message: '已是最新版本', buttons: ['好'] });
|
||||
return;
|
||||
}
|
||||
const lines = [`当前 v${st.current} → 新版本 v${st.version}`];
|
||||
const lines = [];
|
||||
if (st.date) lines.push(`发布时间:${st.date}`);
|
||||
if (st.notes) lines.push('', '更新说明:', st.notes);
|
||||
if (st.notes) lines.push('', st.notes);
|
||||
const pick = await modalDialog({
|
||||
message: `发现新版本 v${st.version}`,
|
||||
detail: lines.join('\n'),
|
||||
@@ -243,7 +238,8 @@
|
||||
} catch (e) {
|
||||
await modalDialog({ message: '检查更新失败', detail: String((e && e.message) || e), buttons: ['好'] });
|
||||
} finally {
|
||||
updateBtn.disabled = false;
|
||||
updating = false;
|
||||
updateBtn.classList.remove('busy');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user