From 8d57c26fe57a41eafcaef840decd8940e5d54fec Mon Sep 17 00:00:00 2001 From: qiqi Date: Tue, 17 Nov 2026 12:04:36 +0800 Subject: [PATCH] =?UTF-8?q?feat(plugins):=20=E5=86=85=E7=BD=AE=E5=90=8C?= =?UTF-8?q?=E7=89=88=E6=9C=AC=E6=98=BE=E7=A4=BA=E3=80=8C=E5=86=85=E7=BD=AE?= =?UTF-8?q?=E5=B7=B2=E6=8F=90=E4=BE=9B=E3=80=8D=E8=80=8C=E9=9D=9E=E9=87=8D?= =?UTF-8?q?=E5=A4=8D=E5=AE=89=E8=A3=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/ui-settings-sections.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/ui-settings-sections.js b/src/ui-settings-sections.js index 0e358b2..7fc5f5c 100644 --- a/src/ui-settings-sections.js +++ b/src/ui-settings-sections.js @@ -59,6 +59,8 @@ const label = busy === p.id ? '处理中…' : (!have ? '安装' : (need ? '更新' : '移除外部副本')) const kind = !have || need ? 'install' : 'uninstall' 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,7 +72,9 @@ 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, - el('button', { className: 'iwb-btn iwb-btn-sm', disabled: !!busy, onClick: () => act(kind, p.id) }, label), + builtinSame + ? el('span', { className: 'iwb-hint' }, '内置已提供') + : el('button', { className: 'iwb-btn iwb-btn-sm', disabled: !!busy, onClick: () => act(kind, p.id) }, label), ) }), msg ? el('div', { className: 'iwb-hint' }, msg) : null,