diff --git a/package.json b/package.json index 7bfe722..02835b4 100755 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "HugoAura", - "version": "0.1.1-pre-IV", + "version": "0.1.1-beta", "description": "Aura for SeewoHugo", "main": "app.asar/main.js", "dependencies": {}, diff --git a/src/aura/init/shared/default.json b/src/aura/init/shared/default.json index 6966007..eb210b9 100755 --- a/src/aura/init/shared/default.json +++ b/src/aura/init/shared/default.json @@ -26,6 +26,14 @@ "enabled": true } }, + "ssa": { + "ux": { + "easiAssistant": { + "autoHide": false, + "notDisplay": false + } + } + }, "auraSettings": { "settingsPasswordEnabled": false, "settingsPasswordWithSalt": "32703D292460CC9A3B867494D6AD9A8E4A3ADF0FAA4D6867BC4D412CC3927D02E47C6D0B1763BB53E57B2241C6193433561CDA09D7C48CA03983072B876F0965", diff --git a/src/aura/ui/hookDefinitions/desktopAssistant.js b/src/aura/ui/hookDefinitions/desktopAssistant.js new file mode 100644 index 0000000..2a274d7 --- /dev/null +++ b/src/aura/ui/hookDefinitions/desktopAssistant.js @@ -0,0 +1,15 @@ +// @ts-check + +/** + * @type {import("../../types/render/uiHook").UIHookConfig} + */ +const def = { + targets: {}, + globalStyles: ["ui/css/global.css"], + globalJS: ["ui/js/global.js", "ui/js/pageGlobal/desktopAssistant.js"], + onLoaded: ` + console.log('[HugoAura / UI / Hooks / Desktop Assistant] Page loaded.'); + `, +}; + +module.exports = def; diff --git a/src/aura/ui/js/pageGlobal/desktopAssistant.js b/src/aura/ui/js/pageGlobal/desktopAssistant.js new file mode 100644 index 0000000..cae268f --- /dev/null +++ b/src/aura/ui/js/pageGlobal/desktopAssistant.js @@ -0,0 +1,23 @@ +// @ts-check + +(() => { + const applyHideSettings = () => { + if (global.__HUGO_AURA_CONFIG__.ssa.ux.easiAssistant.autoHide) { + const minimizeBtnEl = document.getElementsByClassName( + "index__button2__2mhwC3oY" + )[0].children[0]; + // @ts-expect-error + minimizeBtnEl.click(); + } else if (global.__HUGO_AURA_CONFIG__.ssa.ux.easiAssistant.notDisplay) { + const rootEl = document.getElementById("root"); + // @ts-expect-error + rootEl.style["display"] = "none"; + } + }; + + const onMounted = () => { + applyHideSettings(); + }; + + onMounted(); +})(); diff --git a/src/aura/ui/pages/config/config.html b/src/aura/ui/pages/config/config.html index 881151c..9da9827 100755 --- a/src/aura/ui/pages/config/config.html +++ b/src/aura/ui/pages/config/config.html @@ -142,8 +142,8 @@
-

限制解除

-

禁用密码、关闭功能

+

行为改写

+

覆写密码、禁用能力

@@ -155,7 +155,7 @@
-

行为管控

+

操作管控

窥屏提醒、数据欺骗

diff --git a/src/aura/ui/pages/configSubPages/disableLimitations/disableLimitations.html b/src/aura/ui/pages/configSubPages/disableLimitations/disableLimitations.html index d7a5c24..65cd706 100755 --- a/src/aura/ui/pages/configSubPages/disableLimitations/disableLimitations.html +++ b/src/aura/ui/pages/configSubPages/disableLimitations/disableLimitations.html @@ -31,6 +31,20 @@ 上报屏蔽 +
+
diff --git a/src/aura/ui/pages/configSubPages/disableLimitations/disableLimitations.js b/src/aura/ui/pages/configSubPages/disableLimitations/disableLimitations.js index 02e9f16..ceef46d 100755 --- a/src/aura/ui/pages/configSubPages/disableLimitations/disableLimitations.js +++ b/src/aura/ui/pages/configSubPages/disableLimitations/disableLimitations.js @@ -7,6 +7,7 @@ } = require("../../aura/ui/composables/settingsRenderer"); const { authSettings } = require(`${pathBase}/auth`); const { banAuditSettings } = require(`${pathBase}/audit`); + const { uxAndAppearanceSettings } = require(`${pathBase}/uxAppearance`); const initAuthSubPage = () => { const authSubPageEl = document.getElementById("auth-subpage"); @@ -18,9 +19,17 @@ settingsRenderer(banAuditSubPageEl, banAuditSettings); }; + const initUxAndAppearanceSubPage = () => { + const uxAndAppearancePageEl = document.getElementById( + "appearance-ctl-subpage" + ); + settingsRenderer(uxAndAppearancePageEl, uxAndAppearanceSettings); + }; + const onMounted = () => { initAuthSubPage(); initBanAuditSubPage(); + initUxAndAppearanceSubPage(); const rootEl = document.getElementById("acs-disable-limit-root-el"); setTimeout(() => { diff --git a/src/aura/ui/pages/configSubPages/disableLimitations/settings/uxAppearance.js b/src/aura/ui/pages/configSubPages/disableLimitations/settings/uxAppearance.js new file mode 100644 index 0000000..9126ce9 --- /dev/null +++ b/src/aura/ui/pages/configSubPages/disableLimitations/settings/uxAppearance.js @@ -0,0 +1,62 @@ +const uxAndAppearanceSettings = [ + { + id: 0, + categoryName: "管家助手", + child: [ + { + index: 0, + id: "autoHideEasiAssistant", + type: "switch", + name: "自动最小化管家助手", + description: "管家启动后, 自动将桌面右下角管家助手最小化至 Fab 形态", + restart: true, + reload: false, + associateVal: ["ssa.ux.easiAssistant.notDisplay"], + auraIf: () => true, + defaultValue: false, + auraDisable: () => { + if (global.__HUGO_AURA_CONFIG__.ssa.ux.easiAssistant.notDisplay) { + return { value: true, tooltip: '禁用 "隐藏管家助手" 以继续' }; + } else { + return { value: false }; + } + }, + valueGetter: () => { + return global.__HUGO_AURA_CONFIG__.ssa.ux.easiAssistant.autoHide; + }, + callbackFn: (newVal) => { + if (typeof newVal !== "boolean") return; + global.__HUGO_AURA_CONFIG__.ssa.ux.easiAssistant.autoHide = newVal; + }, + }, + { + index: 1, + id: "notDisplayEasiAssistant", + type: "switch", + name: "隐藏管家助手", + description: "管家启动后, 管家助手窗口将不再显示", + restart: true, + reload: false, + associateVal: ["ssa.ux.easiAssistant.autoHide"], + auraIf: () => true, + defaultValue: false, + auraDisable: () => { + if (global.__HUGO_AURA_CONFIG__.ssa.ux.easiAssistant.autoHide) { + return { value: true, tooltip: '禁用 "自动最小化管家助手" 以继续' }; + } else { + return { value: false }; + } + }, + valueGetter: () => { + return global.__HUGO_AURA_CONFIG__.ssa.ux.easiAssistant.notDisplay; + }, + callbackFn: (newVal) => { + if (typeof newVal !== "boolean") return; + global.__HUGO_AURA_CONFIG__.ssa.ux.easiAssistant.notDisplay = newVal; + }, + }, + ], + }, +]; + +module.exports = { uxAndAppearanceSettings }; diff --git a/src/aura/ui/pages/headerIcon/headerIcon.css b/src/aura/ui/pages/headerIcon/headerIcon.css index 492a0d8..abc3abe 100755 --- a/src/aura/ui/pages/headerIcon/headerIcon.css +++ b/src/aura/ui/pages/headerIcon/headerIcon.css @@ -7,7 +7,7 @@ transition: opacity 0.25s; } -.aura-header-icon.aura-header-icon-hidden { +#root.aura-header-icon-hidden .aura-header-icon { display: none; } diff --git a/src/aura/ui/pages/headerIcon/headerIcon.js b/src/aura/ui/pages/headerIcon/headerIcon.js index 2ce7d92..6330c0a 100755 --- a/src/aura/ui/pages/headerIcon/headerIcon.js +++ b/src/aura/ui/pages/headerIcon/headerIcon.js @@ -10,9 +10,11 @@ global.__HUGO_AURA_UI_FUNCTIONS__.headerIcon = { let clickTimeout = null; const onMounted = () => { - if (!global.__HUGO_AURA_CONFIG__.auraSettings.uiAccessMethod.showEntryIcon) { - const iconEl = document.getElementsByClassName("aura-header-icon")[0]; - iconEl.classList.add("aura-header-icon-hidden"); + if ( + !global.__HUGO_AURA_CONFIG__.auraSettings.uiAccessMethod.showEntryIcon + ) { + const rootEl = document.getElementById("root"); + rootEl.classList.add("aura-header-icon-hidden"); } if ( diff --git a/src/core/preload.js b/src/core/preload.js index 14ee2b0..35ffaf5 100755 --- a/src/core/preload.js +++ b/src/core/preload.js @@ -1,6 +1,6 @@ // @ts-check -const __AURA_VERSION__ = "0.1.1-pre-IV"; +const __AURA_VERSION__ = "0.1.1-beta"; (() => { if (require.main) return; // 如果只是导入 Aura Version, 不运行闭包逻辑