feat(market-ui): 已安装同版本也能「转为新格式」重装(单文件→目录)v3.25.47
- 管理页行内动作拆成 安装/更新/转为新格式/重新安装 + 独立「移除」 - 市场卡片页给已安装插件补「重装」 - 已安装状态区分「旧格式」(index 条目只有 file、没有 dir)
This commit is contained in:
1 parent
e4bd818e15
commit
94820d4d7f
6 files changed
+23
-16
No files matched your search
@@ -14,6 +14,14 @@
|
||||
> 3. 核验正式地址版本 → 之后才移动 `stable` / `stable-verified-<日期>` 标签、更新本 CHANGELOG、写 GitHub Release(`gh release create`)。
|
||||
> 测试发现问题 → 改 → 再 `deploy:test`,正式环境不受影响。回滚点 `git reset --hard stable`。
|
||||
|
||||
## v3.25.47(2026-11-20)插件市场:可「转为新格式」重装(单文件 → 目录)
|
||||
|
||||
- 症状:已装 1.7.0(单文件)后,市场里同一版本只显示「移除外部副本」,**没有入口装成新的目录格式**;市场卡片页更是只剩「移除」。
|
||||
- 修复:设置 → 插件 → 市场,行内按钮改为按状态显示 `安装 / 更新 / 转为新格式 / 重新安装`,并单独提供「移除」;
|
||||
市场卡片页给已安装插件补「重装」按钮。
|
||||
- 状态文案区分「已安装」与「已安装(旧格式)」:`plugins/index.json` 里的条目有 `dir` 才是 M3 的目录格式,只有 `file` 就是 M3 前的单文件。
|
||||
- 装成新格式后旧单文件会变成孤儿文件(不加载、仅占空间),可手动删除或等后续「清理残留」。
|
||||
|
||||
## v3.25.46(2026-11-20)插件市场 M3:zip 整包 + 逐文件 sha256 + 桌面解包安装
|
||||
|
||||
- 市场产物升级:每个插件同时产出 `plugins/<id>-<version>.zip`(STORE 不压缩),条目新增 `bundle / bundleSize / bundleSha256 / files[]`;
|
||||
|
||||
+1
-1
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "image-workbench-web",
|
||||
"private": true,
|
||||
"version": "3.25.46",
|
||||
"version": "3.25.47",
|
||||
"description": "Browser-based node canvas image workbench",
|
||||
"scripts": {
|
||||
"build": "node scripts/build.js && node scripts/copy-plugins.js",
|
||||
|
||||
Generated
+1
-1
@@ -1983,7 +1983,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "image-workbench"
|
||||
version = "3.25.46"
|
||||
version = "3.25.47"
|
||||
dependencies = [
|
||||
"arboard",
|
||||
"base64 0.22.1",
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "image-workbench"
|
||||
version = "3.25.46"
|
||||
version = "3.25.47"
|
||||
description = "无限画布 · 生图工作台桌面版"
|
||||
authors = ["malongan"]
|
||||
license = ""
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"$schema": "../node_modules/@tauri-apps/cli/config.schema.json",
|
||||
"productName": "image-workbench",
|
||||
"version": "3.25.46",
|
||||
"version": "3.25.47",
|
||||
"identifier": "com.malongan.imageworkbench",
|
||||
"build": {
|
||||
"frontendDist": "../dist",
|
||||
|
||||
+11
-12
@@ -32,7 +32,7 @@
|
||||
const list = await D.market.list()
|
||||
const cur = await D.market.installed()
|
||||
const map = {}
|
||||
for (const p of (cur || [])) if (p && p.id) map[p.id] = p.version || ''
|
||||
for (const p of (cur || [])) if (p && p.id) map[p.id] = { version: p.version || '', dir: p.dir || '', file: p.file || '' }
|
||||
setRows(list); setInstalled(map); setMsg('')
|
||||
} catch (e) { setRows([]); setMsg('市场加载失败:' + String((e && e.message) || e)) }
|
||||
}, [D])
|
||||
@@ -56,13 +56,12 @@
|
||||
el('button', { className: 'iwb-btn iwb-btn-sm', onClick: refresh }, '刷新'),
|
||||
),
|
||||
rows.map((p) => {
|
||||
const have = installed[p.id]
|
||||
const need = have && have !== p.version
|
||||
const label = busy === p.id ? '处理中…' : (!have ? '安装' : (need ? '更新' : '移除外部副本'))
|
||||
const kind = !have || need ? 'install' : 'uninstall'
|
||||
const entry = installed[p.id] || null
|
||||
const have = entry ? entry.version : ''
|
||||
const need = !!have && have !== p.version
|
||||
const legacy = !!(entry && !entry.dir) // 旧的单文件安装(M3 前):可一键转成新目录格式
|
||||
const label = busy === p.id ? '处理中…' : (!entry ? '安装' : (need ? '更新' : (legacy ? '转为新格式' : '重新安装')))
|
||||
const reg = (pluginItems || []).find((x) => x && x.id === p.id)
|
||||
// 内置已提供同版本 ⇒ 无需再装外部副本(避免「安装」一个本来就有的插件)
|
||||
const builtinSame = !have && reg && reg.version === p.version
|
||||
return el('div', { key: p.id, className: 'iwb-plugin-row' },
|
||||
el('label', { className: 'iwb-label iwb-grow' },
|
||||
reg ? el('input', {
|
||||
@@ -70,13 +69,12 @@
|
||||
onChange: (e) => { const r = PluginHost.setEnabled(reg.id, e.target.checked); setPluginsRev((v) => v + 1); if (!r.ok) setMsg(reg.name + ':' + r.error) },
|
||||
}) : null,
|
||||
el('span', null, (p.name || p.id) + ' v' + p.version),
|
||||
el('span', { className: 'iwb-hint', style: { marginLeft: 8 } }, have ? (need ? ('已装 ' + have) : '已安装') : '未安装'),
|
||||
el('span', { className: 'iwb-hint', style: { marginLeft: 8 } }, entry ? (need ? ('已装 ' + have) : (legacy ? '已安装(旧格式)' : '已安装')) : '未安装'),
|
||||
p.desc ? el('div', { className: 'iwb-hint' }, p.desc) : null,
|
||||
),
|
||||
reg ? el('button', { className: 'iwb-btn iwb-btn-sm', onClick: () => setTab('plugin:' + p.id) }, '设置') : null,
|
||||
builtinSame
|
||||
? el('span', { className: 'iwb-hint' }, '内置已提供')
|
||||
: el('button', { className: 'iwb-btn iwb-btn-sm', disabled: !!busy, onClick: () => act(kind, p.id) }, label),
|
||||
el('button', { className: 'iwb-btn iwb-btn-sm', disabled: !!busy, onClick: () => act('install', p.id) }, label),
|
||||
entry ? el('button', { className: 'iwb-btn iwb-btn-sm iwb-btn-danger', disabled: !!busy, onClick: () => act('uninstall', p.id) }, '移除') : null,
|
||||
)
|
||||
}),
|
||||
msg ? el('div', { className: 'iwb-hint' }, msg) : null,
|
||||
@@ -145,7 +143,7 @@
|
||||
try {
|
||||
const cur = await D.market.installed()
|
||||
const map = {}
|
||||
for (const p of (cur || [])) if (p && p.id) map[p.id] = p.version || ''
|
||||
for (const p of (cur || [])) if (p && p.id) map[p.id] = { version: p.version || '', dir: p.dir || '', file: p.file || '' }
|
||||
setInst(map)
|
||||
} catch (e) { /* 本地清单失败不阻塞市场请求 */ }
|
||||
try {
|
||||
@@ -400,6 +398,7 @@
|
||||
el('div', { className: 'iwb-mk-sub' }, bits.join(' · ')),
|
||||
),
|
||||
el('div', { className: 'iwb-mk-actions' },
|
||||
((m.id in inst) || regById[m.id]) ? el('button', { className: 'iwb-btn iwb-btn-sm', disabled: !!busy, onClick: function () { act('install', m.id) } }, busy === m.id ? '处理中…' : '重装') : null,
|
||||
((m.id in inst) || regById[m.id])
|
||||
? el('button', { className: 'iwb-btn iwb-btn-sm', disabled: !!busy, onClick: function () { act('uninstall', m.id) } }, '移除')
|
||||
: el('button', { className: 'iwb-btn iwb-btn-sm iwb-btn-primary', disabled: !!busy, onClick: function () { act('install', m.id) } }, busy === m.id ? '处理中…' : '安装'),
|
||||
|
||||
Reference in new issue
Block a user