Files
Seewo-HugoAura/src/aura/ui/pages/configSubPages/preferences/settings/debug.js

41 lines
1.1 KiB
JavaScript
Raw Normal View History

const IPC_METHOD_BASE = "$aura.debug";
const debugSettings = [
{
id: 0,
categoryName: "日志与输出",
child: [
{
index: 0,
id: "openHugoAuraLogDir",
type: "button",
style: "outline",
name: "HugoAura 日志目录",
description: "",
restart: false,
reload: false,
associateVal: null,
auraIf: () => true,
buttonContent: "打开",
valueGetter: async () => {
const ipcRendererRet = await ipcRenderer.invoke(
`${IPC_METHOD_BASE}.getLogDirAsync`
);
if (ipcRendererRet.success && ipcRendererRet.data !== "") {
global.__HUGO_AURA__.logDir = ipcRendererRet.data;
return "目录位置: " + ipcRendererRet.data;
} else {
return "未能获取日志目录位置";
}
},
callbackFn: async (event) => {
const childProc = require("child_process");
childProc.spawn(`explorer.exe`, [`${global.__HUGO_AURA__.logDir}`]);
},
},
],
},
];
module.exports = { debugSettings };