fix: v3.26.178 logPut 兼容单对象入参;plugin-img 同时写 _boot.log
Verify (Gitea) / gate (build · unit · facts) (push) Failing after 2m46s

This commit is contained in:
qiqi committed 2026-12-01 21:01:22 +08:00
1 parent 44073f8d09
commit c3227ce0d5
6 files changed
+20 -7

No files matched your search

+9 -2
View File
@@ -6183,7 +6183,12 @@ const tbCenterSeed = (type, refs) => {
setNodeImage: (id, dataUrl) => {
if (!/^data:/i.test(String(dataUrl || ''))) return false
const t = refs.nodes.find((x) => x.id === id); if (!t) return false
try { wLog('plugin-img', 'set id=' + id + ' len=' + String(dataUrl || '').length + ' prevLocal=' + (t.data && t.data.localRef ? 'Y' : 'N')) } catch (eL) { /* ignore */ }
try {
const line = 'plugin-img set id=' + id + ' len=' + String(dataUrl || '').length + ' prevLocal=' + (t.data && t.data.localRef ? 'Y' : 'N')
const SF = window.IWBStorageFile
if (SF && typeof SF.logLine === 'function') SF.logLine(line)
wLog('plugin-img', line)
} catch (eL) { /* ignore */ }
updateNode(id, origImagePatch(t.data || {}, String(dataUrl)))
// v3.26.174:同步失效这张图的缩略图/URL 缓存并触发重渲染(与 saveNodeImage 同因)
try { const k = wDisplayThumbKeyOf(String(dataUrl || '')); if (k) { displayThumbs.delete(k); displayThumbsSm.delete(k) } } catch (e1) { /* ignore */ }
@@ -6202,7 +6207,9 @@ const tbCenterSeed = (type, refs) => {
const nd = (refs.nodes || []).find((x) => x && x.id === id) || null
const keys = nd && nd.data ? Object.keys(nd.data).join(',') : ''
const hasLocal = nd && nd.data ? (nd.data.localRef ? 'Y' : 'N') : '?'
wLog('plugin-img', 'save id=' + id + ' ok=' + (r && r.ok) + ' err=' + String((r && r.error) || '-') + ' len=' + String(dataUrl || '').length + ' localRef=' + hasLocal + ' keys=' + keys)
const line = 'plugin-img save id=' + id + ' ok=' + (r && r.ok) + ' err=' + String((r && r.error) || '-') + ' len=' + String(dataUrl || '').length + ' localRef=' + hasLocal + ' keys=' + keys
try { const SF = window.IWBStorageFile; if (SF && typeof SF.logLine === 'function') SF.logLine(line) } catch (eB) { /* ignore */ }
wLog('plugin-img', line)
} catch (eL) { /* ignore */ }
try {
if (r && r.ok) showToast('已覆盖原图', 'ok')
+1 -1
View File
@@ -1,7 +1,7 @@
{
"name": "image-workbench-web",
"private": true,
"version": "3.26.177",
"version": "3.26.178",
"description": "Browser-based node canvas image workbench",
"scripts": {
"build": "node scripts/build.js && node scripts/copy-plugins.js",
+1 -1
View File
@@ -2014,7 +2014,7 @@ dependencies = [
[[package]]
name = "image-workbench"
version = "3.26.176"
version = "3.26.177"
dependencies = [
"arboard",
"base64 0.22.1",
+1 -1
View File
@@ -1,6 +1,6 @@
[package]
name = "image-workbench"
version = "3.26.177"
version = "3.26.178"
description = "无限画布 · 生图工作台桌面版"
authors = ["malongan"]
license = ""
+1 -1
View File
@@ -1,7 +1,7 @@
{
"$schema": "../node_modules/@tauri-apps/cli/config.schema.json",
"productName": "image-workbench",
"version": "3.26.177",
"version": "3.26.178",
"identifier": "com.malongan.imageworkbench",
"build": {
"frontendDist": "../dist",
+7 -1
View File
@@ -256,7 +256,13 @@
} catch (e) { return false }
},
async keys() { try { return Object.keys(assets).concat(Object.keys(small)) } catch (e) { return [] } },
async logPut(id, entry) { return kv.put('log:' + id, JSON.stringify(entry)) },
async logPut(id, entry) {
// v3.26.178:兼容两种调用 —— 浏览器端传 (entry),app.js 传 ({id, at, kind, msg, detail})。
// 旧实现只认 (id, entry),桌面端把整个对象当 id ⇒ key 变 log:[object Object]、值变 undefined,
// 所有 wLog 记录互相覆盖成一条垃圾数据。
if (id && typeof id === 'object') { entry = id; id = entry.id || ('log-' + Date.now()) }
return kv.put('log:' + id, JSON.stringify(entry))
},
async logAll() {
const out = []
for (const k of Object.keys(small)) if (k.indexOf('log:') === 0) { try { out.push(JSON.parse(small[k])) } catch (e) { /* ignore */ } }