mirror of
https://github.com/HugoAura/Seewo-HugoAura.git
synced 2026-06-23 17:34:29 +08:00
[🛠️ Fix] Invalid log dir path (#24) & Remove PLS trust token
1. [-] 删除了 PLS 的 Trust token 认证机制 2. [+] 现在可以在 `偏好设置` - `调试选项` 中直接打开日志文件夹了 3. [/] 日志目录不再使用 `%USERPROFILE%\Documents\HugoAura\logs` 为基准, 而是从注册表获取值 4. [/] 配置文件目录同理, 旧版配置文件将会自动迁移到新位置
This commit is contained in:
@@ -170,6 +170,23 @@ const renderInputArea = (entry, operationArea, descriptionArea) => {
|
||||
operationArea.classList.add("ase-operation-area-expanded");
|
||||
return inputEl;
|
||||
}
|
||||
case "button": {
|
||||
const btnEl = document.createElement("button");
|
||||
btnEl.type = "button";
|
||||
btnEl.classList.add("btn");
|
||||
switch (entry.style) {
|
||||
case "outline":
|
||||
default:
|
||||
btnEl.classList.add("btn-outline-primary");
|
||||
break;
|
||||
}
|
||||
btnEl.innerHTML = entry.buttonContent;
|
||||
btnEl.onclick = entry.callbackFn;
|
||||
(async () => {
|
||||
descriptionArea.innerHTML = await entry.valueGetter();
|
||||
})();
|
||||
return btnEl;
|
||||
}
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -45,8 +45,7 @@
|
||||
};
|
||||
|
||||
const calcFullAuthToken = (/** @type {string} */ authToken) => {
|
||||
const trustToken = window._ACCEPT_DATA.getData("deviceId");
|
||||
const conjToken = authToken + "AuraXAuth" + trustToken + "NeverEnds";
|
||||
const conjToken = authToken + "AuraXAuth 0xFFFFFF NeverEnds";
|
||||
const crypto = require("crypto");
|
||||
return crypto.createHash("sha512").update(conjToken).digest("hex");
|
||||
};
|
||||
|
||||
@@ -17,6 +17,20 @@
|
||||
Aura 设置
|
||||
</button>
|
||||
</li>
|
||||
<li class="nav-item" role="presentation">
|
||||
<button
|
||||
class="nav-link"
|
||||
id="debug-subpage-tab"
|
||||
data-bs-toggle="pill"
|
||||
data-bs-target="#debug-subpage"
|
||||
type="button"
|
||||
role="tab"
|
||||
aria-controls="debug-subpage"
|
||||
aria-selected="false"
|
||||
>
|
||||
调试选项
|
||||
</button>
|
||||
</li>
|
||||
<li class="nav-item" role="presentation">
|
||||
<button
|
||||
class="nav-link"
|
||||
@@ -26,7 +40,7 @@
|
||||
type="button"
|
||||
role="tab"
|
||||
aria-controls="about-subpage"
|
||||
aria-selected="true"
|
||||
aria-selected="false"
|
||||
>
|
||||
关于项目
|
||||
</button>
|
||||
@@ -39,6 +53,12 @@
|
||||
role="tabpanel"
|
||||
aria-labelledby="aura-subpage-tab"
|
||||
></div>
|
||||
<div
|
||||
class="tab-pane fade"
|
||||
id="debug-subpage"
|
||||
role="tabpanel"
|
||||
aria-labelledby="debug-subpage-tab"
|
||||
></div>
|
||||
<div
|
||||
class="tab-pane fade"
|
||||
id="about-subpage"
|
||||
|
||||
@@ -5,13 +5,21 @@
|
||||
settingsRenderer,
|
||||
} = require("../../aura/ui/composables/settingsRenderer");
|
||||
const { auraSettings } = require(`${pathBase}/aura`);
|
||||
const { debugSettings } = require(`${pathBase}/debug`);
|
||||
|
||||
const initAuraSubPage = () => {
|
||||
const auraSettingsSubPageEl = document.getElementById("aura-subpage");
|
||||
settingsRenderer(auraSettingsSubPageEl, auraSettings);
|
||||
};
|
||||
|
||||
const initDebugSubPage = () => {
|
||||
const debugSubPageEl = document.getElementById("debug-subpage");
|
||||
settingsRenderer(debugSubPageEl, debugSettings);
|
||||
};
|
||||
|
||||
const onMounted = () => {
|
||||
initAuraSubPage();
|
||||
initDebugSubPage();
|
||||
|
||||
const rootEl = document.getElementById("acs-preferences-root-el");
|
||||
setTimeout(() => {
|
||||
|
||||
@@ -0,0 +1,40 @@
|
||||
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 };
|
||||
Reference in New Issue
Block a user