style(settings): F9F9F9 分组底色、统一复选框/按钮 token;修复还原图片范围与内层滚动
Verify (Gitea) / gate (build · unit · facts) (push) Failing after 26s
Verify (Gitea) / gate (build · unit · facts) (push) Failing after 26s
This commit is contained in:
1 parent
c426880c8d
commit
8ba7811ac9
4 files changed
+53
-3
No files matched your search
@@ -163,6 +163,25 @@
|
||||
if (kind === 'install') setRestart(true)
|
||||
} finally { setBusy('') }
|
||||
}
|
||||
// 全部更新:按已安装清单逐个安装市场里的可更新版本;逐个失败不阻断其余
|
||||
const updateAll = async function () {
|
||||
if (!D || !D.market) return
|
||||
const ids = Object.keys(inst).filter(function (id) {
|
||||
const m = findM(id); const iv = inst[id] && inst[id].version
|
||||
return !!(m.version && iv && cmpV(m.version, iv) > 0)
|
||||
})
|
||||
if (!ids.length) { setMsg('没有可更新的插件'); return }
|
||||
setBusy('__updateall__')
|
||||
let ok = 0; const fail = []
|
||||
for (const id of ids) {
|
||||
try { const r = await D.market.install(id); if (r && r.ok) ok++; else fail.push(id) } catch (e) { fail.push(id) }
|
||||
}
|
||||
setBusy('')
|
||||
await refresh()
|
||||
if (ok) setRestart(true)
|
||||
setMsg('已更新 ' + ok + '/' + ids.length + ' 个插件' + (fail.length ? (';失败:' + fail.join('、')) : '') + (ok ? ',重启应用后生效' : ''))
|
||||
}
|
||||
|
||||
// 用 src 模块加载脚本(不引 app.js 全局),成功后再写启用状态
|
||||
const loadRuntimePlugin = async function (id) {
|
||||
const rec = (wRuntimePlugins || []).find(function (r) { return r && r.id === id })
|
||||
@@ -249,6 +268,7 @@
|
||||
el('div', { className: 'iwb-hint' }, (installedRows.length ? ('你目前已经安装了 ' + installedRows.length + ' 个插件') : '还没有安装插件') + (updatable ? (',其中 ' + updatable + ' 个可更新') : '')),
|
||||
),
|
||||
el('button', { className: 'iwb-btn iwb-btn-sm', onClick: refresh }, '检查更新'),
|
||||
updatable ? el('button', { className: 'iwb-btn iwb-btn-sm iwb-btn-primary', disabled: !!busy, title: '更新全部可更新的插件', onClick: function () { updateAll() } }, busy === '__updateall__' ? '更新中…' : '全部更新') : null,
|
||||
),
|
||||
el('div', { className: 'iwb-mk-setrow' },
|
||||
el('div', { className: 'iwb-mk-setrow-main' },
|
||||
|
||||
Reference in new issue
Block a user