@huaqiu/dsh-tool-plugin-update 0.6.12 → 0.6.16
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/client.js +2434 -1781
- package/lib/client.js.map +1 -1
- package/lib/index.mjs +10 -0
- package/package.json +3 -3
- package/src/client/api.ts +19 -0
- package/src/client/badge.ts +59 -0
- package/src/client/copy.ts +171 -101
- package/src/client/icons.ts +45 -0
- package/src/client/index.ts +1159 -988
- package/src/client/update-view.ts +1397 -1175
- package/src/client/version.ts +36 -3
- package/src/routes.ts +23 -0
package/lib/index.mjs
CHANGED
|
@@ -138,6 +138,14 @@ function routeFor(sub, method) {
|
|
|
138
138
|
method: "POST",
|
|
139
139
|
path: "/api/v1/plugin-updates/unignore"
|
|
140
140
|
} : null;
|
|
141
|
+
if (sub === "/plugin-ignore") return method === "POST" ? {
|
|
142
|
+
method: "POST",
|
|
143
|
+
path: "/api/v1/plugin-updates/plugin-ignore"
|
|
144
|
+
} : null;
|
|
145
|
+
if (sub === "/plugin-unignore") return method === "POST" ? {
|
|
146
|
+
method: "POST",
|
|
147
|
+
path: "/api/v1/plugin-updates/plugin-unignore"
|
|
148
|
+
} : null;
|
|
141
149
|
return null;
|
|
142
150
|
}
|
|
143
151
|
/** Every static sub-path this forwarder serves — used to tell a 404 from a
|
|
@@ -149,6 +157,8 @@ const STATIC_SUB_PATHS = /* @__PURE__ */ new Set([
|
|
|
149
157
|
"/install",
|
|
150
158
|
"/ignore",
|
|
151
159
|
"/unignore",
|
|
160
|
+
"/plugin-ignore",
|
|
161
|
+
"/plugin-unignore",
|
|
152
162
|
"/runtime",
|
|
153
163
|
"/runtime-request",
|
|
154
164
|
"/runtime-source",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@huaqiu/dsh-tool-plugin-update",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.16",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "./lib/index.mjs",
|
|
6
6
|
"types": "./lib/index.d.mts",
|
|
@@ -31,8 +31,8 @@
|
|
|
31
31
|
"@deepseek-ai/dsh-host-webserver": "^0.2.1-rc.2"
|
|
32
32
|
},
|
|
33
33
|
"dependencies": {
|
|
34
|
-
"@huaqiu/dsh-plugin-log": "0.6.
|
|
35
|
-
"@huaqiu/dsh-sidebar-entry": "0.6.
|
|
34
|
+
"@huaqiu/dsh-plugin-log": "0.6.16",
|
|
35
|
+
"@huaqiu/dsh-sidebar-entry": "0.6.16"
|
|
36
36
|
},
|
|
37
37
|
"files": [
|
|
38
38
|
"lib",
|
package/src/client/api.ts
CHANGED
|
@@ -148,6 +148,25 @@ export function runtimeLatestVersion(
|
|
|
148
148
|
return null
|
|
149
149
|
}
|
|
150
150
|
|
|
151
|
+
/**
|
|
152
|
+
* Whether the report offers an HQ Edge runtime update the user can act on:
|
|
153
|
+
* hq-edge reports that a newer distribution exists AND it actually named one.
|
|
154
|
+
*
|
|
155
|
+
* Both halves matter, and sharing one predicate keeps the sidebar badge and the
|
|
156
|
+
* runtime card from disagreeing: the card can only render its 升级核心 row when
|
|
157
|
+
* it knows the target version, so an `updateAvailable` without a `latest` entry
|
|
158
|
+
* must not add a count anywhere. hq-edge already fails closed here (it only
|
|
159
|
+
* sets the flag when `semver.gt(latest, current)` holds on a comparable pair),
|
|
160
|
+
* so this is a shape guard, not a second compatibility decision.
|
|
161
|
+
*/
|
|
162
|
+
export function runtimeUpdateOffered(
|
|
163
|
+
runtime: RuntimeUpdateInfo | null | undefined,
|
|
164
|
+
): boolean {
|
|
165
|
+
if (runtime === null || runtime === undefined) return false
|
|
166
|
+
if (runtime.updateAvailable !== true) return false
|
|
167
|
+
return runtimeLatestVersion(runtime) !== null
|
|
168
|
+
}
|
|
169
|
+
|
|
151
170
|
/**
|
|
152
171
|
* Set-level release metadata from a schemaVersion-2 plugin manifest. ALL
|
|
153
172
|
* fields optional: v1 manifests send none, and the panel must fall back to
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The sidebar toolbutton's numeric badge — one pure function, no DOM, no
|
|
3
|
+
* store, so the rule can be tested on its own.
|
|
4
|
+
*
|
|
5
|
+
* It answers one question: how many updates does this EDA install still have
|
|
6
|
+
* for the user? That is every actionable plugin item plus the HQ Edge runtime
|
|
7
|
+
* offer when hq-edge reports one:
|
|
8
|
+
*
|
|
9
|
+
* - **plugin items** — compatible `update` + `install`, minus whatever the
|
|
10
|
+
* user muted ({@link actionableUpdateCount});
|
|
11
|
+
* - **the HQ Edge runtime update, as one** — a different deliverable with its
|
|
12
|
+
* own card and its own confirm flow, but still an available update, and
|
|
13
|
+
* leaving it out of the only number on the sidebar hid a pending runtime
|
|
14
|
+
* upgrade until the panel was opened. It counts as ONE (a runtime swap is a
|
|
15
|
+
* single action, however many manifest entries it was picked from) and it
|
|
16
|
+
* survives a muted plugin offer, because the two offers are independent —
|
|
17
|
+
* ignoring this release set must not hide a newer runtime.
|
|
18
|
+
*
|
|
19
|
+
* What is NOT counted: the durable job history. It is permanent
|
|
20
|
+
* (`listRecent(20)`, survives restarts), so turning any settled job — even a
|
|
21
|
+
* successful install — into a "1" latched the badge on forever. That was the
|
|
22
|
+
* original bug; a job is only allowed to speak while it is still RUNNING.
|
|
23
|
+
*
|
|
24
|
+
* @module
|
|
25
|
+
*/
|
|
26
|
+
import {
|
|
27
|
+
TERMINAL_PHASES,
|
|
28
|
+
runtimeUpdateOffered,
|
|
29
|
+
type PluginUpdateReport,
|
|
30
|
+
type UpdateJob,
|
|
31
|
+
} from './api.js'
|
|
32
|
+
import { actionableUpdateCount } from './version.js'
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* The badge value for one snapshot of `(report, active job)`.
|
|
36
|
+
*
|
|
37
|
+
* @param report - the latest plugin-update report, or null before the first
|
|
38
|
+
* read. Null contributes nothing (never a placeholder count).
|
|
39
|
+
* @param activeJob - the job the server reports as active, or null when idle.
|
|
40
|
+
* A RUNNING job counts as 1 only when there is nothing actionable to show,
|
|
41
|
+
* so the row still signals in-flight work; a TERMINAL job contributes
|
|
42
|
+
* nothing — it is history.
|
|
43
|
+
* @returns the number to render; 0 means "no badge at all".
|
|
44
|
+
*/
|
|
45
|
+
export function badgeCountFor(
|
|
46
|
+
report: PluginUpdateReport | null,
|
|
47
|
+
activeJob: UpdateJob | null,
|
|
48
|
+
): number {
|
|
49
|
+
if (report !== null) {
|
|
50
|
+
// Plugin items already collapse to 0 when the offer is muted; the runtime
|
|
51
|
+
// is an independent offer and keeps its own count.
|
|
52
|
+
const plugin = actionableUpdateCount(report)
|
|
53
|
+
const runtime = runtimeUpdateOffered(report.runtime) ? 1 : 0
|
|
54
|
+
const total = plugin + runtime
|
|
55
|
+
if (total > 0) return total
|
|
56
|
+
}
|
|
57
|
+
if (activeJob !== null && !TERMINAL_PHASES.has(activeJob.phase)) return 1
|
|
58
|
+
return 0
|
|
59
|
+
}
|
package/src/client/copy.ts
CHANGED
|
@@ -6,37 +6,46 @@
|
|
|
6
6
|
* helpers). The wording follows the shell's own plugin manager
|
|
7
7
|
* (`ui-plugin-manager/src/client/locales.ts`) so both read as one product.
|
|
8
8
|
*
|
|
9
|
+
* Two vocabulary rules hold throughout, and both come from the redesign brief:
|
|
10
|
+
*
|
|
11
|
+
* - **日志 means the JOB log** (安装日志与记录, the header's drawer). What a
|
|
12
|
+
* plugin release changed is 更新内容 / 版本日志 — never 日志 — so the two
|
|
13
|
+
* affordances can never be confused for one another.
|
|
14
|
+
* - **Counts are plugin-set counts.** "3 项插件可更新" counts compatible
|
|
15
|
+
* `update` + `install` items; the runtime is always named separately
|
|
16
|
+
* ("1 项运行时可升级") because it is a different, riskier action.
|
|
17
|
+
*
|
|
9
18
|
* @module
|
|
10
19
|
*/
|
|
11
20
|
|
|
12
21
|
const zh = {
|
|
13
22
|
entryLabel: '插件更新',
|
|
14
|
-
entryTooltip: '
|
|
23
|
+
entryTooltip: '查看可用的插件与运行时更新',
|
|
15
24
|
viewTitle: '插件更新',
|
|
16
|
-
viewIntro: '检查并安装可用的插件更新',
|
|
17
|
-
viewInfo: '在这里查看插件集的更新;已是最新的插件无需操作。',
|
|
18
25
|
refresh: '刷新',
|
|
19
26
|
close: '关闭',
|
|
27
|
+
cancel: '取消',
|
|
20
28
|
loading: '正在读取插件更新…',
|
|
21
29
|
empty: '没有可用的插件更新',
|
|
22
30
|
checkFailed: '检查更新失败,请重试',
|
|
23
|
-
|
|
24
|
-
// it honestly rather than per-plugin.
|
|
25
|
-
installAll: (count: number) => `安装整套更新(${count} 项)`,
|
|
26
|
-
installOne: '安装整套',
|
|
27
|
-
installOneTip: '将安装整套 N 项更新并自动重启 DSH,而不仅是此插件',
|
|
28
|
-
installing: '正在安装…(DSH 将自动重启)',
|
|
29
|
-
retry: '重试',
|
|
30
|
-
checkedAt: (when: string) => `上次检查:${when}`,
|
|
31
|
+
checkFailedTitle: '检查更新失败',
|
|
31
32
|
checkFailedBanner: (message: string) => `检查更新失败:${message}`,
|
|
32
|
-
staleNote: '
|
|
33
|
-
|
|
33
|
+
staleNote: '以下为上次成功检查的结果(可能已过期)',
|
|
34
|
+
retry: '重试',
|
|
35
|
+
retryNow: '重新尝试',
|
|
34
36
|
ignore: '忽略此版本',
|
|
35
37
|
unignore: '恢复提醒',
|
|
36
|
-
|
|
37
|
-
|
|
38
|
+
installError: '安装失败',
|
|
39
|
+
installSuccess: '更新已安装,正在重启 DSH…',
|
|
40
|
+
ignoreError: '忽略失败',
|
|
41
|
+
confirmInstall: '确认安装',
|
|
42
|
+
lastError: '上次检查失败',
|
|
43
|
+
// Origin tags, shared by both source editors (hq-edge serves one type).
|
|
44
|
+
originOverride: '自定义',
|
|
45
|
+
originConfig: '默认配置',
|
|
46
|
+
originUnset: '未配置',
|
|
38
47
|
group: {
|
|
39
|
-
actionable: '
|
|
48
|
+
actionable: '待处理更新',
|
|
40
49
|
ignored: '已忽略',
|
|
41
50
|
current: '已是最新',
|
|
42
51
|
},
|
|
@@ -53,7 +62,7 @@ const zh = {
|
|
|
53
62
|
sizeLabel: '包大小',
|
|
54
63
|
update: '安装运行时更新',
|
|
55
64
|
updateConfirm: (version: string) =>
|
|
56
|
-
|
|
65
|
+
`确认升级 HQ Edge 运行时至 v${version}?升级将自动关闭后台服务并完成替换,随后重启。`,
|
|
57
66
|
// No fixed "takes one minute" claim: duration depends on download speed
|
|
58
67
|
// and package size (the bundle is hundreds of MB).
|
|
59
68
|
updating: '正在下载并校验运行时包…',
|
|
@@ -89,16 +98,7 @@ const zh = {
|
|
|
89
98
|
inputLabel: '插件更新清单地址',
|
|
90
99
|
placeholder: 'https://gitee.com/huaqiu-electronics/dsh-pcb-eda/raw/main/plugins-release-manifest.json',
|
|
91
100
|
},
|
|
92
|
-
//
|
|
93
|
-
originOverride: '自定义',
|
|
94
|
-
originConfig: '默认配置',
|
|
95
|
-
originUnset: '未配置',
|
|
96
|
-
lastError: '上次检查失败',
|
|
97
|
-
installError: '安装失败',
|
|
98
|
-
installSuccess: '更新已安装,正在重启 DSH…',
|
|
99
|
-
confirmInstall: '确认安装',
|
|
100
|
-
cancel: '取消',
|
|
101
|
-
// ── Durable update job (active / result / recent) ──
|
|
101
|
+
// ── Durable update job (active / result / log drawer) ──
|
|
102
102
|
job: {
|
|
103
103
|
kindPluginSet: '插件集更新',
|
|
104
104
|
kindRuntime: 'HQ Edge 运行时更新',
|
|
@@ -129,7 +129,8 @@ const zh = {
|
|
|
129
129
|
resultFailed: '更新失败',
|
|
130
130
|
resultRolledBack: '更新已回滚',
|
|
131
131
|
resultAbandoned: '更新未完成',
|
|
132
|
-
retry: '
|
|
132
|
+
retry: '重新尝试',
|
|
133
|
+
retryNote: '将发起一次新的更新',
|
|
133
134
|
recentTitle: '最近更新',
|
|
134
135
|
stepsTitle: '各组件进度',
|
|
135
136
|
logHint: (hint: string) => `日志标识:${hint}`,
|
|
@@ -143,26 +144,80 @@ const zh = {
|
|
|
143
144
|
advanced: '高级:更新源',
|
|
144
145
|
publishedAt: (when: string) => `发布于 ${when}`,
|
|
145
146
|
},
|
|
146
|
-
// ──
|
|
147
|
+
// ── Update-centre panel ──
|
|
147
148
|
ui: {
|
|
148
149
|
title: '更新中心',
|
|
149
|
-
gearTooltip: '
|
|
150
|
+
gearTooltip: '更新源配置',
|
|
151
|
+
// Header sub-line: "版本集 v0.6.14 · 14 分钟前".
|
|
152
|
+
setVersion: (v: string) => `版本集 v${v}`,
|
|
153
|
+
subJoined: (set: string, ago: string) => `${set} · ${ago}`,
|
|
154
|
+
checkedAgo: (ago: string) => `上次检查:${ago}`,
|
|
155
|
+
checkedUnknown: '尚未检查更新',
|
|
156
|
+
checkedNever: '尚未检查',
|
|
157
|
+
agoJust: '刚刚',
|
|
158
|
+
agoMinutes: (n: number) => `${n} 分钟前`,
|
|
159
|
+
agoHours: (n: number) => `${n} 小时前`,
|
|
160
|
+
agoDays: (n: number) => `${n} 天前`,
|
|
161
|
+
// Decision band
|
|
162
|
+
summaryPlugins: (n: number) => `${n} 项插件可更新`,
|
|
163
|
+
summaryRuntime: '1 项运行时可升级',
|
|
164
|
+
// Section disclosures
|
|
165
|
+
expandLogs: '展开版本日志',
|
|
166
|
+
collapseLogs: '折叠版本日志',
|
|
167
|
+
upToDateNote: '全部正常运行',
|
|
168
|
+
upToDateRow: (v: string) => `${v} · 已是最新`,
|
|
169
|
+
ignoredNote: '已忽略,不再提醒',
|
|
170
|
+
releaseTitle: '版本说明',
|
|
171
|
+
// Cards
|
|
172
|
+
singleUpdate: '单独更新',
|
|
173
|
+
singleInstall: '单独安装',
|
|
174
|
+
singleUpdateTip: '仅安装此插件并重启 DSH,不影响其他插件',
|
|
175
|
+
ignorePlugin: '忽略此插件',
|
|
176
|
+
restorePlugin: '恢复此插件',
|
|
177
|
+
changesToggle: '更新内容',
|
|
178
|
+
changesTitle: (v: string) => `v${v} 变更明细`,
|
|
179
|
+
// Footer
|
|
180
|
+
cta: (n: number) => `一键更新选中的 ${n} 项插件`,
|
|
181
|
+
ctaInstalling: '正在更新插件集中…',
|
|
182
|
+
ctaFailed: '检查更新失败,请重试',
|
|
183
|
+
ctaUpToDate: '已是最新版本',
|
|
184
|
+
ctaNoPlugins: '插件均已是最新',
|
|
185
|
+
ctaNoSet: '暂无可安装的更新',
|
|
186
|
+
footerCount: (n: number) => `准备安装 ${n} 项兼容插件`,
|
|
187
|
+
footerBusy: '后台处理中,请勿关闭 DSH',
|
|
188
|
+
footerFailed: '无法确认插件版本兼容性',
|
|
189
|
+
footerAllGood: '所有插件与运行时均正常',
|
|
190
|
+
footerRuntimeOnly: '运行时更新需在上方单独确认',
|
|
191
|
+
ignoreBtn: '忽略此版本',
|
|
192
|
+
unignoreBtn: '恢复版本提醒',
|
|
193
|
+
footnote: '更新将自动应用并重启 DSH 视图,不影响 EDA 图纸数据',
|
|
194
|
+
// Settings drawer
|
|
150
195
|
settingsTitle: '更新源配置 (高级)',
|
|
151
196
|
originDefault: '默认源',
|
|
152
197
|
originCustom: '自定义源',
|
|
153
198
|
pluginUrlLabel: '插件 Manifest URL',
|
|
154
199
|
runtimeUrlLabel: '运行时 Manifest URL',
|
|
155
200
|
saveAndRefresh: '保存并刷新',
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
201
|
+
resetSource: '恢复默认',
|
|
202
|
+
// Log drawer
|
|
203
|
+
logShow: '查看任务日志',
|
|
204
|
+
logHide: '收起任务日志',
|
|
205
|
+
logNone: '暂无可查看的更新日志',
|
|
206
|
+
logBusy: '更新进行中,完成后方可查看日志',
|
|
207
|
+
logTitle: '安装日志与记录',
|
|
208
|
+
jobIdLabel: 'JOB_ID',
|
|
209
|
+
copyLogId: '复制日志 ID',
|
|
210
|
+
logCopied: '日志 ID 已复制到剪贴板',
|
|
211
|
+
logCopyFailed: '复制失败,请手动记录日志 ID',
|
|
212
|
+
viewLog: '查看日志',
|
|
213
|
+
stepSkipped: '已跳过',
|
|
214
|
+
stepPending: '待处理',
|
|
215
|
+
confirmRuntime: '确认升级并重启',
|
|
216
|
+
// Active job
|
|
217
|
+
jobPluginTitle: (v: string) => `正在升级插件集 (v${v})`,
|
|
164
218
|
jobRuntimeTitle: (v: string) => `正在升级 HQ Edge 运行时 (v${v})`,
|
|
165
219
|
jobSteps: ['下载', '校验', '替换', '重启'],
|
|
220
|
+
activeCloseNote: '关闭此面板不会取消更新,完成后将自动重启。',
|
|
166
221
|
// Runtime result alert
|
|
167
222
|
rollbackTitle: '上次 HQ Edge 运行时更新已自动回滚',
|
|
168
223
|
failedTitle: '上次 HQ Edge 运行时更新失败',
|
|
@@ -173,27 +228,16 @@ const zh = {
|
|
|
173
228
|
successInline: '上次运行时更新成功',
|
|
174
229
|
// Runtime engine card
|
|
175
230
|
runtimeEngine: 'HQ Edge 核心运行时',
|
|
176
|
-
currentChip: (v: string) => `v${v}
|
|
177
|
-
newVersion: (v: string) =>
|
|
231
|
+
currentChip: (v: string) => `v${v} 当前`,
|
|
232
|
+
newVersion: (v: string) => `v${v} 可用`,
|
|
178
233
|
breakingTag: '关键修复',
|
|
179
|
-
sizeLine: (size: string, summary: string) =>
|
|
234
|
+
sizeLine: (size: string, summary: string) => `体积 ${size}${summary ? ` • ${summary}` : ''}`,
|
|
180
235
|
upgradeCore: '升级核心',
|
|
181
236
|
runtimeRestartNote: '升级运行时需自动重启 KiCad 进程服务',
|
|
182
|
-
// Plugin list
|
|
183
|
-
pendingTitle: '待更新插件',
|
|
184
|
-
allChangelog: '展开全部更新日志',
|
|
185
|
-
changelogBtn: '日志',
|
|
186
|
-
changelogTitle: '更新内容:',
|
|
187
|
-
// Footer
|
|
188
|
-
footerCount: (n: number) => `准备安装 ${n} 项兼容插件`,
|
|
189
|
-
footerSet: (v: string) => `版本集: v${v}`,
|
|
190
|
-
installAllSet: (v: string) => `一键更新全套插件 (v${v})`,
|
|
191
|
-
ignoreBtn: '忽略',
|
|
192
|
-
footnote: '更新将自动应用并重启 DSH 视图,不影响 EDA 图纸数据',
|
|
193
237
|
},
|
|
194
238
|
}
|
|
195
239
|
|
|
196
|
-
/** Compact a byte count for display: "
|
|
240
|
+
/** Compact a byte count for display: "12.3 MB" / "480 MB". */
|
|
197
241
|
export function formatMb(bytes: number): string {
|
|
198
242
|
if (!Number.isFinite(bytes) || bytes <= 0) return ''
|
|
199
243
|
const mb = bytes / (1024 * 1024)
|
|
@@ -205,30 +249,31 @@ export type UpdateCopy = typeof zh
|
|
|
205
249
|
|
|
206
250
|
const en: UpdateCopy = {
|
|
207
251
|
entryLabel: 'Plugin Updates',
|
|
208
|
-
entryTooltip: 'Review available plugin updates',
|
|
252
|
+
entryTooltip: 'Review available plugin and runtime updates',
|
|
209
253
|
viewTitle: 'Plugin Updates',
|
|
210
|
-
viewIntro: 'Check for and install available plugin updates',
|
|
211
|
-
viewInfo: 'Review the plugin set updates here. Plugins that are up to date need no action.',
|
|
212
254
|
refresh: 'Refresh',
|
|
213
255
|
close: 'Close',
|
|
256
|
+
cancel: 'Cancel',
|
|
214
257
|
loading: 'Reading plugin updates…',
|
|
215
258
|
empty: 'No plugin updates available',
|
|
216
259
|
checkFailed: 'Failed to check for updates — please retry',
|
|
217
|
-
|
|
218
|
-
installOne: 'Install set',
|
|
219
|
-
installOneTip: 'Installs the whole set of N updates and restarts DSH — not just this plugin',
|
|
220
|
-
installing: 'Installing… (DSH will restart)',
|
|
221
|
-
retry: 'Retry',
|
|
222
|
-
checkedAt: (when: string) => `Last checked: ${when}`,
|
|
260
|
+
checkFailedTitle: 'Update check failed',
|
|
223
261
|
checkFailedBanner: (message: string) => `Update check failed: ${message}`,
|
|
224
262
|
staleNote: 'Showing the last successful check — it may be stale',
|
|
225
|
-
|
|
263
|
+
retry: 'Retry',
|
|
264
|
+
retryNow: 'Try again',
|
|
226
265
|
ignore: 'Ignore this release',
|
|
227
266
|
unignore: 'Show again',
|
|
228
|
-
|
|
229
|
-
|
|
267
|
+
installError: 'Install failed',
|
|
268
|
+
installSuccess: 'Update installed — restarting DSH…',
|
|
269
|
+
ignoreError: 'Ignore failed',
|
|
270
|
+
confirmInstall: 'Confirm install',
|
|
271
|
+
lastError: 'Last check failed',
|
|
272
|
+
originOverride: 'Custom',
|
|
273
|
+
originConfig: 'Configured',
|
|
274
|
+
originUnset: 'Not configured',
|
|
230
275
|
group: {
|
|
231
|
-
actionable: '
|
|
276
|
+
actionable: 'Needs action',
|
|
232
277
|
ignored: 'Ignored',
|
|
233
278
|
current: 'Up to date',
|
|
234
279
|
},
|
|
@@ -245,7 +290,7 @@ const en: UpdateCopy = {
|
|
|
245
290
|
sizeLabel: 'Package size',
|
|
246
291
|
update: 'Install runtime update',
|
|
247
292
|
updateConfirm: (version: string) =>
|
|
248
|
-
`
|
|
293
|
+
`Upgrade the HQ Edge runtime to v${version}? The background service shuts down so the runtime can be swapped, then restarts.`,
|
|
249
294
|
updating: 'Downloading and verifying the runtime bundle…',
|
|
250
295
|
durationNote: 'Duration depends on download speed and package size; the runtime bundle is large, and HQ Edge restarts after the swap.',
|
|
251
296
|
updateAccepted: 'Runtime update accepted — HQ Edge is restarting…',
|
|
@@ -257,7 +302,6 @@ const en: UpdateCopy = {
|
|
|
257
302
|
rolledBack: 'Runtime update rolled back (previous version restored)',
|
|
258
303
|
elevation: 'A system-wide install may show a UAC elevation prompt; declining it fails the swap and rolls back to the previous version.',
|
|
259
304
|
},
|
|
260
|
-
// ── Update-source editor ──
|
|
261
305
|
sourceHint: 'Where the runtime update manifest is fetched from; saved changes take effect immediately',
|
|
262
306
|
sourceEdit: 'Edit',
|
|
263
307
|
sourceSave: 'Save',
|
|
@@ -267,7 +311,6 @@ const en: UpdateCopy = {
|
|
|
267
311
|
sourceInputLabel: 'Runtime update manifest URL',
|
|
268
312
|
sourcePlaceholder: 'https://gitee.com/huaqiu-electronics/dsh-pcb-eda/raw/main/edge-headless-release-manifest.json',
|
|
269
313
|
},
|
|
270
|
-
// ── Plugin release-manifest source editor ──
|
|
271
314
|
pluginSource: {
|
|
272
315
|
title: 'Plugin update source',
|
|
273
316
|
hint: 'Where the plugin update manifest is fetched from; saved changes take effect immediately',
|
|
@@ -280,16 +323,6 @@ const en: UpdateCopy = {
|
|
|
280
323
|
placeholder:
|
|
281
324
|
'https://gitee.com/huaqiu-electronics/dsh-pcb-eda/raw/main/plugins-release-manifest.json',
|
|
282
325
|
},
|
|
283
|
-
// Origin tags, shared by both source editors (hq-edge serves one type).
|
|
284
|
-
originOverride: 'Custom',
|
|
285
|
-
originConfig: 'Configured',
|
|
286
|
-
originUnset: 'Not configured',
|
|
287
|
-
lastError: 'Last check failed',
|
|
288
|
-
installError: 'Install failed',
|
|
289
|
-
installSuccess: 'Update installed — restarting DSH…',
|
|
290
|
-
confirmInstall: 'Confirm install',
|
|
291
|
-
cancel: 'Cancel',
|
|
292
|
-
// ── Durable update job (active / result / recent) ──
|
|
293
326
|
job: {
|
|
294
327
|
kindPluginSet: 'Plugin-set update',
|
|
295
328
|
kindRuntime: 'HQ Edge runtime update',
|
|
@@ -319,12 +352,12 @@ const en: UpdateCopy = {
|
|
|
319
352
|
resultFailed: 'Update failed',
|
|
320
353
|
resultRolledBack: 'Update rolled back',
|
|
321
354
|
resultAbandoned: 'Update did not complete',
|
|
322
|
-
retry: 'Retry
|
|
355
|
+
retry: 'Retry',
|
|
356
|
+
retryNote: 'Starts a new update',
|
|
323
357
|
recentTitle: 'Recent updates',
|
|
324
358
|
stepsTitle: 'Per-component progress',
|
|
325
359
|
logHint: (hint: string) => `Log id: ${hint}`,
|
|
326
360
|
},
|
|
327
|
-
// ── Release metadata ──
|
|
328
361
|
release: {
|
|
329
362
|
summaryTitle: 'Release notes',
|
|
330
363
|
notesLink: 'View release notes',
|
|
@@ -333,25 +366,71 @@ const en: UpdateCopy = {
|
|
|
333
366
|
advanced: 'Advanced: update sources',
|
|
334
367
|
publishedAt: (when: string) => `Published ${when}`,
|
|
335
368
|
},
|
|
336
|
-
// ── Refactored dock layout (interactive_refactored_ui_mockup.html) ──
|
|
337
369
|
ui: {
|
|
338
370
|
title: 'Update Center',
|
|
339
|
-
gearTooltip: '
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
originCustom: 'Custom source',
|
|
343
|
-
pluginUrlLabel: 'Plugin manifest URL',
|
|
344
|
-
runtimeUrlLabel: 'Runtime manifest URL',
|
|
345
|
-
saveAndRefresh: 'Save & refresh',
|
|
371
|
+
gearTooltip: 'Update sources',
|
|
372
|
+
setVersion: (v: string) => `Set v${v}`,
|
|
373
|
+
subJoined: (set: string, ago: string) => `${set} · ${ago}`,
|
|
346
374
|
checkedAgo: (ago: string) => `Last checked: ${ago}`,
|
|
347
375
|
checkedUnknown: 'No check yet',
|
|
376
|
+
checkedNever: 'never',
|
|
348
377
|
agoJust: 'just now',
|
|
349
378
|
agoMinutes: (n: number) => `${n} min ago`,
|
|
350
379
|
agoHours: (n: number) => `${n} h ago`,
|
|
351
380
|
agoDays: (n: number) => `${n} d ago`,
|
|
381
|
+
summaryPlugins: (n: number) => `${n} plugin${n === 1 ? '' : 's'} can be updated`,
|
|
382
|
+
summaryRuntime: '1 runtime can be upgraded',
|
|
383
|
+
expandLogs: 'Expand changelogs',
|
|
384
|
+
collapseLogs: 'Collapse changelogs',
|
|
385
|
+
upToDateNote: 'All running normally',
|
|
386
|
+
upToDateRow: (v: string) => `${v} · up to date`,
|
|
387
|
+
ignoredNote: 'Ignored, no longer offered',
|
|
388
|
+
releaseTitle: 'Release notes',
|
|
389
|
+
singleUpdate: 'Update this one',
|
|
390
|
+
singleInstall: 'Install this one',
|
|
391
|
+
singleUpdateTip: 'Installs only this plugin and restarts DSH — the rest of the set is untouched',
|
|
392
|
+
ignorePlugin: 'Ignore this plugin',
|
|
393
|
+
restorePlugin: 'Offer this plugin again',
|
|
394
|
+
changesToggle: 'What changed',
|
|
395
|
+
changesTitle: (v: string) => `v${v} changes`,
|
|
396
|
+
cta: (n: number) => `Update the ${n} selected plugin${n === 1 ? '' : 's'}`,
|
|
397
|
+
ctaInstalling: 'Updating the plugin set…',
|
|
398
|
+
ctaFailed: 'Check failed — retry first',
|
|
399
|
+
ctaUpToDate: 'Everything up to date',
|
|
400
|
+
ctaNoPlugins: 'All plugins are current',
|
|
401
|
+
ctaNoSet: 'Nothing to install yet',
|
|
402
|
+
footerCount: (n: number) => `Ready to install ${n} compatible plugin${n === 1 ? '' : 's'}`,
|
|
403
|
+
footerBusy: 'Running in the background — keep DSH open',
|
|
404
|
+
footerFailed: 'Cannot confirm plugin compatibility',
|
|
405
|
+
footerAllGood: 'All plugins and the runtime are current',
|
|
406
|
+
footerRuntimeOnly: 'Confirm the runtime upgrade on its card',
|
|
407
|
+
ignoreBtn: 'Ignore this release',
|
|
408
|
+
unignoreBtn: 'Offer it again',
|
|
409
|
+
footnote: 'Updates apply automatically and restart the DSH view — your EDA schematic data is untouched',
|
|
410
|
+
settingsTitle: 'Update source (advanced)',
|
|
411
|
+
originDefault: 'Default source',
|
|
412
|
+
originCustom: 'Custom source',
|
|
413
|
+
pluginUrlLabel: 'Plugin manifest URL',
|
|
414
|
+
runtimeUrlLabel: 'Runtime manifest URL',
|
|
415
|
+
saveAndRefresh: 'Save & refresh',
|
|
416
|
+
resetSource: 'Reset to default',
|
|
417
|
+
logShow: 'Show the job log',
|
|
418
|
+
logHide: 'Hide the job log',
|
|
419
|
+
logNone: 'No update log to show',
|
|
420
|
+
logBusy: 'Update in progress — the log is available when it finishes',
|
|
421
|
+
logTitle: 'Install log & history',
|
|
422
|
+
jobIdLabel: 'JOB_ID',
|
|
423
|
+
copyLogId: 'Copy log id',
|
|
424
|
+
logCopied: 'Log id copied to the clipboard',
|
|
425
|
+
logCopyFailed: 'Could not copy — please note the log id',
|
|
426
|
+
viewLog: 'View log',
|
|
427
|
+
stepSkipped: 'skipped',
|
|
428
|
+
stepPending: 'pending',
|
|
429
|
+
confirmRuntime: 'Confirm & restart',
|
|
352
430
|
jobPluginTitle: (v: string) => `Updating plugin set (v${v})`,
|
|
353
431
|
jobRuntimeTitle: (v: string) => `Upgrading HQ Edge runtime (v${v})`,
|
|
354
432
|
jobSteps: ['Download', 'Verify', 'Swap', 'Restart'],
|
|
433
|
+
activeCloseNote: 'Closing this panel does not cancel the update; DSH restarts when it finishes.',
|
|
355
434
|
rollbackTitle: 'Last HQ Edge runtime update rolled back automatically',
|
|
356
435
|
failedTitle: 'Last HQ Edge runtime update failed',
|
|
357
436
|
rollbackBody: (oldVer: string, code: string) =>
|
|
@@ -360,21 +439,12 @@ const en: UpdateCopy = {
|
|
|
360
439
|
dismiss: 'Dismiss',
|
|
361
440
|
successInline: 'Last runtime update succeeded',
|
|
362
441
|
runtimeEngine: 'HQ Core Runtime',
|
|
363
|
-
currentChip: (v: string) => `v${v}
|
|
364
|
-
newVersion: (v: string) => `
|
|
442
|
+
currentChip: (v: string) => `v${v} current`,
|
|
443
|
+
newVersion: (v: string) => `v${v} available`,
|
|
365
444
|
breakingTag: 'Critical fix',
|
|
366
|
-
sizeLine: (size: string, summary: string) => `Size
|
|
445
|
+
sizeLine: (size: string, summary: string) => `Size ${size}${summary ? ` • ${summary}` : ''}`,
|
|
367
446
|
upgradeCore: 'Upgrade core',
|
|
368
447
|
runtimeRestartNote: 'Upgrading the runtime restarts the KiCad process service',
|
|
369
|
-
pendingTitle: 'Plugins to update',
|
|
370
|
-
allChangelog: 'Expand all changelogs',
|
|
371
|
-
changelogBtn: 'Log',
|
|
372
|
-
changelogTitle: 'What changed:',
|
|
373
|
-
footerCount: (n: number) => `Ready to install ${n} compatible plugin${n === 1 ? '' : 's'}`,
|
|
374
|
-
footerSet: (v: string) => `Set: v${v}`,
|
|
375
|
-
installAllSet: (v: string) => `Update all plugins (v${v})`,
|
|
376
|
-
ignoreBtn: 'Ignore',
|
|
377
|
-
footnote: 'Updates apply automatically and restart the DSH view — your EDA schematic data is untouched',
|
|
378
448
|
},
|
|
379
449
|
}
|
|
380
450
|
|
package/src/client/icons.ts
CHANGED
|
@@ -51,6 +51,20 @@ export const REFRESH_ICON = (size = 16): string =>
|
|
|
51
51
|
'M14.4999 1.5V5.1H10.8999',
|
|
52
52
|
])
|
|
53
53
|
|
|
54
|
+
/**
|
|
55
|
+
* The toolbar's log toggle: a page with ruled lines — "the update log".
|
|
56
|
+
*
|
|
57
|
+
* Not a shell primitive (the shell has no equivalent glyph), so it is drawn to
|
|
58
|
+
* the same 16×16 / 1px-stroke contract as the rest of this module.
|
|
59
|
+
*/
|
|
60
|
+
export const LOG_ICON = (size = 16): string =>
|
|
61
|
+
glyph(size, REGULAR, [
|
|
62
|
+
'M9.5 1.5H4.5C3.94772 1.5 3.5 1.94772 3.5 2.5V13.5C3.5 14.0523 3.94772 14.5 4.5 14.5H11.5C12.0523 14.5 12.5 14.0523 12.5 13.5V4.5L9.5 1.5Z',
|
|
63
|
+
'M9.5 1.5V4.5H12.5',
|
|
64
|
+
'M6 8.25H10',
|
|
65
|
+
'M6 10.75H10',
|
|
66
|
+
])
|
|
67
|
+
|
|
54
68
|
/** The panel's close action (`IconCloseOutlineMedium`). */
|
|
55
69
|
export const CLOSE_ICON = (size = 16): string =>
|
|
56
70
|
glyph(size, MEDIUM, ['M2.5 2.5L13.5 13.5', 'M13.5 2.5L2.5 13.5'])
|
|
@@ -89,3 +103,34 @@ export const INFO_ICON = (size = 11): string =>
|
|
|
89
103
|
/** A folded section's chevron (`IconChevronDownOutlineRegular`). */
|
|
90
104
|
export const CHEVRON_DOWN_ICON = (size = 14): string =>
|
|
91
105
|
glyph(size, REGULAR, ['M4 6L7.29289 9.29289C7.68342 9.68342 8.31658 9.68342 8.70711 9.29289L12 6'])
|
|
106
|
+
|
|
107
|
+
/** A right-pointing chevron — a collapsed row, rotated by CSS when it opens. */
|
|
108
|
+
export const CHEVRON_RIGHT_ICON = (size = 14): string =>
|
|
109
|
+
glyph(size, REGULAR, ['M6 4L9.29289 7.29289C9.68342 7.68342 9.68342 8.31658 9.29289 8.70711L6 12'])
|
|
110
|
+
|
|
111
|
+
/**
|
|
112
|
+
* The per-card mute action: an eye with a slash (忽略此插件).
|
|
113
|
+
*
|
|
114
|
+
* Drawn here rather than borrowed: the shell's icon set has no
|
|
115
|
+
* "stop offering this" glyph, and a bare 忽略 text button competed with the
|
|
116
|
+
* card's primary action for the same 40 px.
|
|
117
|
+
*/
|
|
118
|
+
export const EYE_OFF_ICON = (size = 14): string =>
|
|
119
|
+
glyph(size, REGULAR, [
|
|
120
|
+
'M1.5 8C3 4.6 5.4 3 8 3C10.6 3 13 4.6 14.5 8C13 11.4 10.6 13 8 13C5.4 13 3 11.4 1.5 8Z',
|
|
121
|
+
'M10 8C10 9.10457 9.10457 10 8 10C6.89543 10 6 9.10457 6 8C6 6.89543 6.89543 6 8 6C9.10457 6 10 6.89543 10 8Z',
|
|
122
|
+
'M2.5 2.5L13.5 13.5',
|
|
123
|
+
])
|
|
124
|
+
|
|
125
|
+
/**
|
|
126
|
+
* Copy-to-clipboard (the log drawer's 复制日志 ID): two offset rounded frames.
|
|
127
|
+
*/
|
|
128
|
+
export const COPY_ICON = (size = 14): string =>
|
|
129
|
+
glyph(size, REGULAR, [
|
|
130
|
+
'M5.5 5.5V2.5C5.5 2.22386 5.72386 2 6 2H13C13.2761 2 13.5 2.22386 13.5 2.5V9.5C13.5 9.77614 13.2761 10 13 10H10',
|
|
131
|
+
'M2.5 6C2.5 5.72386 2.72386 5.5 3 5.5H10C10.2761 5.5 10.5 5.72386 10.5 6V13C10.5 13.2761 10.2761 13.5 10 13.5H3C2.72386 13.5 2.5 13.2761 2.5 13V6Z',
|
|
132
|
+
])
|
|
133
|
+
|
|
134
|
+
/** The runtime card's badge: a bolt (the HQ Edge core distribution). */
|
|
135
|
+
export const BOLT_ICON = (size = 14): string =>
|
|
136
|
+
glyph(size, REGULAR, ['M9.33333 2L4.66667 8H8L6.66667 14L11.33333 8H8L9.33333 2Z'])
|