[Feat] Refactor UI loader & Add freeze report override

This commit is contained in:
Minoricew
2025-06-10 00:28:53 +08:00
parent ed29f1b86f
commit a639ae0ac6
17 changed files with 861 additions and 167 deletions

View File

@@ -37,16 +37,6 @@ const { genRandomHex } = require("../../utils/crypto");
*/
const updatePlsConfigToRemote = async (configKey, configValue) => {
const configLevels = configKey.split(".");
/** @type {Record<any, any>} */
// @ts-expect-error
let localUpdateTarget =
configLevels[0] === "ruleSettings"
? global.__HUGO_AURA__.plsRules
: global.__HUGO_AURA__.plsSettings;
for (const level of configLevels.slice(0, -1)) {
localUpdateTarget = localUpdateTarget[level];
}
localUpdateTarget[configLevels.slice(-1)[0]] = configValue;
const plsConfigUpdateEvent = new CustomEvent("onPLSConfigUpdate", {
detail: {
@@ -55,6 +45,14 @@ const updatePlsConfigToRemote = async (configKey, configValue) => {
},
});
document.dispatchEvent(plsConfigUpdateEvent);
const settingsEntries = document.getElementsByClassName(
"aura-settings-entry"
);
if (settingsEntries.length > 0) {
Array.from(settingsEntries).forEach((entry) => {
entry.dispatchEvent(plsConfigUpdateEvent);
});
}
/**
* @type {ClientPLSRequest}