[ Feat / 🛠️ Fix] Auto hide desktopAssistant & Fix #26

1. [/] 修改了 Header Icon 的隐藏方式, 尝试修复 #26
2. [+] 现在可以隐藏管家助手 (桌面右下角小窗) 了
3. [⇡] Bump version to v0.1.1-beta
This commit is contained in:
Minoricew
2025-06-20 00:45:11 +08:00
parent 807ac913da
commit b8f27d9f7c
11 changed files with 148 additions and 9 deletions

View File

@@ -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": {},

View File

@@ -26,6 +26,14 @@
"enabled": true
}
},
"ssa": {
"ux": {
"easiAssistant": {
"autoHide": false,
"notDisplay": false
}
}
},
"auraSettings": {
"settingsPasswordEnabled": false,
"settingsPasswordWithSalt": "32703D292460CC9A3B867494D6AD9A8E4A3ADF0FAA4D6867BC4D412CC3927D02E47C6D0B1763BB53E57B2241C6193433561CDA09D7C48CA03983072B876F0965",

View File

@@ -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;

View File

@@ -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();
})();

View File

@@ -142,8 +142,8 @@
<div class="aura-config-page-operation-body">
<img src="../../aura/ui/static/config/no_limitations.svg" />
<div>
<p class="config-operation-title">限制解除</p>
<p class="config-operation-description">禁用密码、关闭功能</p>
<p class="config-operation-title">行为改写</p>
<p class="config-operation-description">覆写密码、禁用能力</p>
</div>
</div>
</div>
@@ -155,7 +155,7 @@
<div class="aura-config-page-operation-body">
<img src="../../aura/ui/static/config/behaviour_mon.svg" />
<div>
<p class="config-operation-title">行为管控</p>
<p class="config-operation-title">操作管控</p>
<p class="config-operation-description">窥屏提醒、数据欺骗</p>
</div>
</div>

View File

@@ -31,6 +31,20 @@
上报屏蔽
</button>
</li>
<li class="nav-item" role="presentation">
<button
class="nav-link"
id="appearance-ctl-tab"
data-bs-toggle="pill"
data-bs-target="#appearance-ctl-subpage"
type="button"
role="tab"
aria-controls="appearance-ctl-subpage"
aria-selected="false"
>
外观与体验
</button>
</li>
</ul>
<div class="tab-content">
<div
@@ -45,5 +59,11 @@
role="tabpanel"
aria-labelledby="disable-audit-tab"
></div>
<div
class="tab-pane fade"
id="appearance-ctl-subpage"
role="tabpanel"
aria-labelledby="appearance-ctl-tab"
></div>
</div>
</div>

View File

@@ -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(() => {

View File

@@ -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 };

View File

@@ -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;
}

View File

@@ -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 (

View File

@@ -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, 不运行闭包逻辑