style(plugins): 插件行改为标题行+右侧操作(省纵向空间),计数区分 已安装/市场/可安装
Verify (Gitea) / gate (build · unit · facts) (push) Failing after 45s
Verify (Gitea) / gate (build · unit · facts) (push) Failing after 45s
This commit is contained in:
1 parent
499d29a8a0
commit
b433653944
2 files changed
+26
-12
No files matched your search
+19
-12
@@ -158,7 +158,7 @@
|
||||
),
|
||||
el('div', { className: 'iwb-row' },
|
||||
el('span', { className: 'iwb-hint', style: { flex: '1 1 auto' } },
|
||||
'已安装 ' + (pluginItems || []).length + ' 个插件' + (mList.length ? (' · 市场 ' + mList.length + ' 个可用') : '') + (updatable ? (' · ' + updatable + ' 个可更新') : '')),
|
||||
'已安装 ' + (pluginItems || []).length + ' 个' + (mList.length ? (' · 市场 ' + mList.length + ' 个 · 可安装 ' + availRows.length + ' 个') : '') + (updatable ? (' · 可更新 ' + updatable + ' 个') : '')),
|
||||
el('button', { className: 'iwb-btn iwb-btn-sm', onClick: refresh }, '检查更新'),
|
||||
),
|
||||
el('div', { className: 'iwb-section-sub' }, '已安装插件'),
|
||||
@@ -167,22 +167,29 @@
|
||||
const extVer = inst[p.id]
|
||||
const newer = extVer && m.version && m.version !== extVer
|
||||
const isExt = (wRuntimePlugins || []).find((r) => r && r.id === p.id && r.source === 'external')
|
||||
return el('div', { key: p.id, className: 'iwb-plugin-row' },
|
||||
el('label', { className: 'iwb-label iwb-grow' },
|
||||
el('span', null, p.name + ' v' + p.version + (p.compatible ? '' : '(不兼容)')),
|
||||
el('div', { className: 'iwb-hint' }, (isExt ? '外部副本' : '内置') + (newer ? (' · 市场有 ' + m.version) : '')),
|
||||
m.desc ? el('div', { className: 'iwb-hint' }, m.desc) : null,
|
||||
return el('div', { key: p.id, className: 'iwb-plugin-item' },
|
||||
el('div', { className: 'iwb-plugin-main' },
|
||||
el('label', { className: 'iwb-plugin-title' },
|
||||
el('input', { type: 'checkbox', checked: p.enabled, disabled: !p.compatible, onChange: (e) => toggle(p, e.target.checked) }),
|
||||
el('span', null, p.name + ' v' + p.version + (p.compatible ? '' : '(不兼容)')),
|
||||
el('span', { className: 'iwb-plugin-tag' }, (isExt ? '外部副本' : '内置') + (newer ? (' · 市场 ' + m.version) : '')),
|
||||
),
|
||||
m.desc ? el('div', { className: 'iwb-plugin-desc' }, m.desc) : null,
|
||||
),
|
||||
el('div', { className: 'iwb-plugin-actions' },
|
||||
el('button', { className: 'iwb-btn iwb-btn-sm', onClick: () => setTab('plugin:' + p.id) }, '设置'),
|
||||
),
|
||||
el('button', { className: 'iwb-btn iwb-btn-sm', onClick: () => setTab('plugin:' + p.id) }, '设置'),
|
||||
el('input', { type: 'checkbox', checked: p.enabled, disabled: !p.compatible, onChange: (e) => toggle(p, e.target.checked) }),
|
||||
)
|
||||
}) : el('div', { className: 'iwb-hint' }, kw ? '没有匹配的插件' : '暂无已安装插件'),
|
||||
availRows.length ? el('div', { className: 'iwb-section-sub' }, '可安装(市场)') : null,
|
||||
availRows.map((m) => el('div', { key: m.id, className: 'iwb-plugin-row' },
|
||||
el('div', { className: 'iwb-label iwb-grow' }, (m.name || m.id) + ' v' + m.version,
|
||||
el('div', { className: 'iwb-hint' }, m.desc || ''),
|
||||
availRows.map((m) => el('div', { key: m.id, className: 'iwb-plugin-item' },
|
||||
el('div', { className: 'iwb-plugin-main' },
|
||||
el('div', { className: 'iwb-plugin-title' }, el('span', null, (m.name || m.id) + ' v' + m.version)),
|
||||
m.desc ? el('div', { className: 'iwb-plugin-desc' }, m.desc) : null,
|
||||
),
|
||||
el('div', { className: 'iwb-plugin-actions' },
|
||||
el('button', { className: 'iwb-btn iwb-btn-sm', disabled: !!busy, onClick: () => act('install', m.id) }, busy === m.id ? '处理中…' : '安装'),
|
||||
),
|
||||
el('button', { className: 'iwb-btn iwb-btn-sm', disabled: !!busy, onClick: () => act('install', m.id) }, busy === m.id ? '处理中…' : '安装'),
|
||||
)),
|
||||
restart ? el('div', { className: 'iwb-row' },
|
||||
el('span', { className: 'iwb-hint', style: { flex: '1 1 auto' } }, '需要重启应用才能生效'),
|
||||
|
||||
@@ -1953,3 +1953,10 @@ html { scrollbar-width: thin; scrollbar-color: var(--iwb-border2) color-mix(in s
|
||||
.iwb-settings-modal .iwb-hint { margin: 4px 0 0; line-height: 1.6; }
|
||||
.iwb-settings-modal .iwb-set-nav { border-right: none; }
|
||||
.iwb-settings-modal .iwb-set-nav-group { margin: 16px 8px 6px; }
|
||||
|
||||
/* 桌面端插件列表:标题行 + 右侧操作(对齐 Obsidian,省纵向空间) */
|
||||
.iwb-plugin-item { display: flex; align-items: flex-start; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--iwb-border); }
|
||||
.iwb-plugin-main { flex: 1 1 auto; min-width: 0; }
|
||||
.iwb-plugin-title { display: flex; align-items: center; gap: 8px; font-weight: 550; }
|
||||
.iwb-plugin-actions { display: flex; align-items: center; gap: 8px; flex: 0 0 auto; }
|
||||
.iwb-plugin-desc { color: var(--iwb-text2); font-size: 13px; line-height: 1.5; margin-top: 2px; }
|
||||
Reference in new issue
Block a user