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
@@ -394,8 +394,14 @@ function BackupModal(props) {
|
||||
const imgs = (restoreData.images || []).concat(Array.isArray(restoreData.imagesData) ? restoreData.imagesData.map((x) => ({ key: x.key, data: x.data })) : [])
|
||||
let imgOk = 0
|
||||
const imgBad = []
|
||||
const restoreGallery = !!restoreSel.outputs
|
||||
const restoreRefs = !!(restoreSel.nodeGroups || restoreSel.workspaces)
|
||||
for (const im of imgs) {
|
||||
if (!im.key || !im.data) continue
|
||||
// 只恢复与所选项目相关的图片:未选图库时跳过 gallery_*(避免写回孤儿字节),
|
||||
// 只恢复设置/提示词时也不写任何图片。
|
||||
if (!restoreGallery && String(im.name || '').indexOf('gallery_') === 0) continue
|
||||
if (!restoreGallery && !restoreRefs) continue
|
||||
try {
|
||||
// C3:Blob 仓库的键必须写 Blob(备份里是 dataURL/字节)——否则 image-blob-store 读出来不是 Blob
|
||||
let val = im.data
|
||||
@@ -454,7 +460,7 @@ function BackupModal(props) {
|
||||
el('div', { className: 'iwb-backup-sec-title' }, '① 备份(导出所选数据)'),
|
||||
el('label', { className: 'iwb-backup-item iwb-backup-all' },
|
||||
el('input', { type: 'checkbox', checked: bkAll, onChange: (e) => setBkAll(e.target.checked) }, null),
|
||||
el('span', { className: 'iwb-backup-item-name' }, '全部数据'),
|
||||
el('span', { className: 'iwb-backup-item-name' }, '全部基础数据'),
|
||||
el('span', { className: 'iwb-backup-item-count' }, bkAll ? '已全选' : '全选'),
|
||||
),
|
||||
bkCheck('prompts', '提示词库(含分组)', counts.prompts + ' 条'),
|
||||
|
||||
@@ -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