feat: v3.26.158 诊断导出带上分进程内存拆解;mac 辅助函数补 cfg(unix)
Verify (Gitea) / gate (build · unit · facts) (push) Failing after 39s

This commit is contained in:
qiqi committed 2026-12-01 11:35:56 +08:00
1 parent 2f9590bcc7
commit b3cfea4715
6 files changed
+16 -4

No files matched your search

+1
View File
@@ -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: () => {
+1 -1
View File
@@ -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",
+1 -1
View File
@@ -1,6 +1,6 @@
[package]
name = "image-workbench"
version = "3.26.157"
version = "3.26.158"
description = "无限画布 · 生图工作台桌面版"
authors = ["malongan"]
license = ""
+3
View File
@@ -331,6 +331,7 @@ fn footprint_mb(pid: u32) -> Option<u64> {
// 注意:无任何写操作,只 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::<u64>().unwrap_or(0);
@@ -342,6 +343,7 @@ fn etime_secs(v: &str) -> u64 {
v.split(':').fold(0u64, |acc, x| acc * 60 + x.trim().parse::<u64>().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<serde_json::Value> {
let out = std::process::Command::new("/usr/bin/footprint")
.args(["-p", &pid.to_string()])
+1 -1
View File
@@ -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",
+9 -1
View File
@@ -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 是否可用(那样每处都要复述一份兜底逻辑)。