refactor(app): 插件加载/市场/备份抽成 src 模块(app.js 8880→8764 行);备份包含插件
Verify (Gitea) / gate (build · unit · facts) (push) Successful in 1m31s
Verify (Gitea) / gate (build · unit · facts) (push) Successful in 1m31s
This commit is contained in:
1 parent
0ec11bfca8
commit
ce575d2640
11 files changed
+297
-149
No files matched your search
@@ -169,6 +169,8 @@ function BackupModal(props) {
|
||||
items.outputs = ((r && r.files) || []).map((f) => { const o = Object.assign({}, f); delete o.data; return o })
|
||||
}))
|
||||
await Promise.all(jobs)
|
||||
// 插件(清单 + 源码)随备份走:换机器恢复后不用重装
|
||||
try { const pb = (typeof window !== 'undefined') ? window.IWBRuntimePluginBackup : null; if (pb && pb.collect) { const ps = await pb.collect(); if (ps && ps.length) items.plugins = ps } } catch (e) { /* 插件快照失败不影响主备份 */ }
|
||||
// 收集图片(画布引用大图 + 勾选的图库缩略图/原图)并读取数据
|
||||
const refMeta = await collectBackupImages()
|
||||
const galleryMeta = (bk.outputs && items.outputs) ? (await collectBackupOutputImages(items.outputs)) : []
|
||||
@@ -364,6 +366,9 @@ function BackupModal(props) {
|
||||
jobs.push(api('workspaces', { workspaces: mergeById((cur && cur.workspaces) || [], items.workspaces.workspaces || []), activeId: (cur && cur.activeId) || '' }))
|
||||
} else jobs.push(api('workspaces', { workspaces: items.workspaces.workspaces || [], activeId: items.workspaces.activeId || '' }))
|
||||
}
|
||||
if (items.plugins && items.plugins.length) {
|
||||
try { const pb = (typeof window !== 'undefined') ? window.IWBRuntimePluginBackup : null; if (pb && pb.restore) await pb.restore(items.plugins) } catch (e) { /* 插件还原失败不阻塞其它项 */ }
|
||||
}
|
||||
if (restoreSel.outputs && items.outputs) {
|
||||
if (restoreMerge) {
|
||||
const cur = await api('outputs').catch(() => ({ files: [] }))
|
||||
|
||||
Reference in new issue
Block a user