diff --git a/app.js b/app.js index 6b1fe91..b52dae6 100644 --- a/app.js +++ b/app.js @@ -8293,6 +8293,7 @@ const tbCenterSeed = (type, refs) => { diagExtras: () => ({ persist: storagePersist, swallowed: (RuntimeMetrics && RuntimeMetrics.snapshot) ? RuntimeMetrics.snapshot() : null, procRssMB: wProcRssMB, layers: !!(document && document.documentElement && document.documentElement.dataset.layers === 'on'), noblur: (document && document.documentElement && document.documentElement.dataset.noblur === 'on'), dom: (function () { try { return { els: document.getElementsByTagName('*').length, dock: document.querySelectorAll('.iwb-dock *').length, cards: document.querySelectorAll('.iwb-history-item').length } } catch (e) { return null } })() }), // v3.26.121 RSS + v3.26.127 DOM 规模 // 持久化 + 被忽略错误(2026-11-07) ...autoBackupKit, // autoBackup / autoBackupSave / autoBackupRestore / autoBackupRefresh diagText: () => buildRuntimeDiagnosticsText([], (typeof window !== 'undefined' && window.__IWB_BUILD_META__) || {}), + diagDetail: () => wDiagDetail(), onExportDiag: () => exportRuntimeDiagnostics(), onClose: () => setSettingOpen(false), onSaved: () => { diff --git a/package.json b/package.json index f1881ed..8e40f7a 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "image-workbench-web", "private": true, - "version": "3.26.157", + "version": "3.26.158", "description": "Browser-based node canvas image workbench", "scripts": { "build": "node scripts/build.js && node scripts/copy-plugins.js", diff --git a/src-tauri/Cargo.toml b/src-tauri/Cargo.toml index b09a000..01da468 100644 --- a/src-tauri/Cargo.toml +++ b/src-tauri/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "image-workbench" -version = "3.26.157" +version = "3.26.158" description = "无限画布 · 生图工作台桌面版" authors = ["malongan"] license = "" diff --git a/src-tauri/src/lib.rs b/src-tauri/src/lib.rs index 882e272..4231d42 100644 --- a/src-tauri/src/lib.rs +++ b/src-tauri/src/lib.rs @@ -331,6 +331,7 @@ fn footprint_mb(pid: u32) -> Option { // 注意:无任何写操作,只 spawn 只读工具。 // ps 的 etime(DD-HH:MM:SS / HH:MM:SS / MM:SS)→ 秒 +#[cfg(unix)] fn etime_secs(v: &str) -> u64 { if let Some(pos) = v.find('-') { let days = v[..pos].parse::().unwrap_or(0); @@ -342,6 +343,7 @@ fn etime_secs(v: &str) -> u64 { v.split(':').fold(0u64, |acc, x| acc * 60 + x.trim().parse::().unwrap_or(0)) } +#[cfg(unix)] fn size_to_mb(num: f64, unit: &str) -> u64 { let f = match unit { "B" => num / 1048576.0, @@ -354,6 +356,7 @@ fn size_to_mb(num: f64, unit: &str) -> u64 { f.round() as u64 } +#[cfg(unix)] fn parse_footprint(pid: u32) -> Option { let out = std::process::Command::new("/usr/bin/footprint") .args(["-p", &pid.to_string()]) diff --git a/src-tauri/tauri.conf.json b/src-tauri/tauri.conf.json index a0dcf0e..c5d0f9a 100644 --- a/src-tauri/tauri.conf.json +++ b/src-tauri/tauri.conf.json @@ -1,7 +1,7 @@ { "$schema": "../node_modules/@tauri-apps/cli/config.schema.json", "productName": "image-workbench", - "version": "3.26.157", + "version": "3.26.158", "identifier": "com.malongan.imageworkbench", "build": { "frontendDist": "../dist", diff --git a/src/ui-settings-tab-diag.js b/src/ui-settings-tab-diag.js index 1d2cb29..11a5072 100644 --- a/src/ui-settings-tab-diag.js +++ b/src/ui-settings-tab-diag.js @@ -54,7 +54,15 @@ const copyDiag = async () => { let text = '' try { - text = (typeof props.diagText === 'function') ? props.diagText() : JSON.stringify(CrashLog ? CrashLog.report({ version: APP_VERSION }) : {}, null, 2) + const base = (typeof props.diagText === 'function') ? props.diagText() : JSON.stringify(CrashLog ? CrashLog.report({ version: APP_VERSION }) : {}, null, 2) + // v3.26.158:把「设置→诊断」面板里那几块(分进程内存拆解/解码账本/缩略图磁盘/插件源) + // 一起写进剪贴板 JSON —— 否则它们只在面板上,导出与日志都拿不到。 + let obj = null + try { obj = JSON.parse(base) } catch (e2) { obj = null } + if (obj && typeof props.diagDetail === 'function') { + try { obj.diagDetail = await props.diagDetail() } catch (e3) { obj.diagDetailError = String((e3 && e3.message) || e3) } + } + text = obj ? JSON.stringify(obj, null, 2) : base } catch (e) { setMsg({ type: 'err', text: '生成诊断信息失败:' + String((e && e.message) || e) }); return } // 复制统一走 IWBClipboardCopy(2026-11-24):内含 navigator → textarea+execCommand 的降级链, // 不再各处自己判断 clipboard 是否可用(那样每处都要复述一份兜底逻辑)。