Skip to content

Commit b8f27d9

Browse files
committed
[✨ Feat / 🛠️ Fix] Auto hide desktopAssistant & Fix #26
1. [/] 修改了 Header Icon 的隐藏方式, 尝试修复 #26 2. [+] 现在可以隐藏管家助手 (桌面右下角小窗) 了 3. [⇡] Bump version to v0.1.1-beta
1 parent 807ac91 commit b8f27d9

11 files changed

Lines changed: 148 additions & 9 deletions

File tree

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "HugoAura",
3-
"version": "0.1.1-pre-IV",
3+
"version": "0.1.1-beta",
44
"description": "Aura for SeewoHugo",
55
"main": "app.asar/main.js",
66
"dependencies": {},

src/aura/init/shared/default.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,14 @@
2626
"enabled": true
2727
}
2828
},
29+
"ssa": {
30+
"ux": {
31+
"easiAssistant": {
32+
"autoHide": false,
33+
"notDisplay": false
34+
}
35+
}
36+
},
2937
"auraSettings": {
3038
"settingsPasswordEnabled": false,
3139
"settingsPasswordWithSalt": "32703D292460CC9A3B867494D6AD9A8E4A3ADF0FAA4D6867BC4D412CC3927D02E47C6D0B1763BB53E57B2241C6193433561CDA09D7C48CA03983072B876F0965",
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
// @ts-check
2+
3+
/**
4+
* @type {import("../../types/render/uiHook").UIHookConfig}
5+
*/
6+
const def = {
7+
targets: {},
8+
globalStyles: ["ui/css/global.css"],
9+
globalJS: ["ui/js/global.js", "ui/js/pageGlobal/desktopAssistant.js"],
10+
onLoaded: `
11+
console.log('[HugoAura / UI / Hooks / Desktop Assistant] Page loaded.');
12+
`,
13+
};
14+
15+
module.exports = def;
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
// @ts-check
2+
3+
(() => {
4+
const applyHideSettings = () => {
5+
if (global.__HUGO_AURA_CONFIG__.ssa.ux.easiAssistant.autoHide) {
6+
const minimizeBtnEl = document.getElementsByClassName(
7+
"index__button2__2mhwC3oY"
8+
)[0].children[0];
9+
// @ts-expect-error
10+
minimizeBtnEl.click();
11+
} else if (global.__HUGO_AURA_CONFIG__.ssa.ux.easiAssistant.notDisplay) {
12+
const rootEl = document.getElementById("root");
13+
// @ts-expect-error
14+
rootEl.style["display"] = "none";
15+
}
16+
};
17+
18+
const onMounted = () => {
19+
applyHideSettings();
20+
};
21+
22+
onMounted();
23+
})();

src/aura/ui/pages/config/config.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -142,8 +142,8 @@
142142
<div class="aura-config-page-operation-body">
143143
<img src="../../aura/ui/static/config/no_limitations.svg" />
144144
<div>
145-
<p class="config-operation-title">限制解除</p>
146-
<p class="config-operation-description">禁用密码、关闭功能</p>
145+
<p class="config-operation-title">行为改写</p>
146+
<p class="config-operation-description">覆写密码、禁用能力</p>
147147
</div>
148148
</div>
149149
</div>
@@ -155,7 +155,7 @@
155155
<div class="aura-config-page-operation-body">
156156
<img src="../../aura/ui/static/config/behaviour_mon.svg" />
157157
<div>
158-
<p class="config-operation-title">行为管控</p>
158+
<p class="config-operation-title">操作管控</p>
159159
<p class="config-operation-description">窥屏提醒、数据欺骗</p>
160160
</div>
161161
</div>

src/aura/ui/pages/configSubPages/disableLimitations/disableLimitations.html

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,20 @@
3131
上报屏蔽
3232
</button>
3333
</li>
34+
<li class="nav-item" role="presentation">
35+
<button
36+
class="nav-link"
37+
id="appearance-ctl-tab"
38+
data-bs-toggle="pill"
39+
data-bs-target="#appearance-ctl-subpage"
40+
type="button"
41+
role="tab"
42+
aria-controls="appearance-ctl-subpage"
43+
aria-selected="false"
44+
>
45+
外观与体验
46+
</button>
47+
</li>
3448
</ul>
3549
<div class="tab-content">
3650
<div
@@ -45,5 +59,11 @@
4559
role="tabpanel"
4660
aria-labelledby="disable-audit-tab"
4761
></div>
62+
<div
63+
class="tab-pane fade"
64+
id="appearance-ctl-subpage"
65+
role="tabpanel"
66+
aria-labelledby="appearance-ctl-tab"
67+
></div>
4868
</div>
4969
</div>

src/aura/ui/pages/configSubPages/disableLimitations/disableLimitations.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
} = require("../../aura/ui/composables/settingsRenderer");
88
const { authSettings } = require(`${pathBase}/auth`);
99
const { banAuditSettings } = require(`${pathBase}/audit`);
10+
const { uxAndAppearanceSettings } = require(`${pathBase}/uxAppearance`);
1011

1112
const initAuthSubPage = () => {
1213
const authSubPageEl = document.getElementById("auth-subpage");
@@ -18,9 +19,17 @@
1819
settingsRenderer(banAuditSubPageEl, banAuditSettings);
1920
};
2021

22+
const initUxAndAppearanceSubPage = () => {
23+
const uxAndAppearancePageEl = document.getElementById(
24+
"appearance-ctl-subpage"
25+
);
26+
settingsRenderer(uxAndAppearancePageEl, uxAndAppearanceSettings);
27+
};
28+
2129
const onMounted = () => {
2230
initAuthSubPage();
2331
initBanAuditSubPage();
32+
initUxAndAppearanceSubPage();
2433

2534
const rootEl = document.getElementById("acs-disable-limit-root-el");
2635
setTimeout(() => {
Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
const uxAndAppearanceSettings = [
2+
{
3+
id: 0,
4+
categoryName: "管家助手",
5+
child: [
6+
{
7+
index: 0,
8+
id: "autoHideEasiAssistant",
9+
type: "switch",
10+
name: "自动最小化管家助手",
11+
description: "管家启动后, 自动将桌面右下角管家助手最小化至 Fab 形态",
12+
restart: true,
13+
reload: false,
14+
associateVal: ["ssa.ux.easiAssistant.notDisplay"],
15+
auraIf: () => true,
16+
defaultValue: false,
17+
auraDisable: () => {
18+
if (global.__HUGO_AURA_CONFIG__.ssa.ux.easiAssistant.notDisplay) {
19+
return { value: true, tooltip: '禁用 "隐藏管家助手" 以继续' };
20+
} else {
21+
return { value: false };
22+
}
23+
},
24+
valueGetter: () => {
25+
return global.__HUGO_AURA_CONFIG__.ssa.ux.easiAssistant.autoHide;
26+
},
27+
callbackFn: (newVal) => {
28+
if (typeof newVal !== "boolean") return;
29+
global.__HUGO_AURA_CONFIG__.ssa.ux.easiAssistant.autoHide = newVal;
30+
},
31+
},
32+
{
33+
index: 1,
34+
id: "notDisplayEasiAssistant",
35+
type: "switch",
36+
name: "隐藏管家助手",
37+
description: "管家启动后, 管家助手窗口将不再显示",
38+
restart: true,
39+
reload: false,
40+
associateVal: ["ssa.ux.easiAssistant.autoHide"],
41+
auraIf: () => true,
42+
defaultValue: false,
43+
auraDisable: () => {
44+
if (global.__HUGO_AURA_CONFIG__.ssa.ux.easiAssistant.autoHide) {
45+
return { value: true, tooltip: '禁用 "自动最小化管家助手" 以继续' };
46+
} else {
47+
return { value: false };
48+
}
49+
},
50+
valueGetter: () => {
51+
return global.__HUGO_AURA_CONFIG__.ssa.ux.easiAssistant.notDisplay;
52+
},
53+
callbackFn: (newVal) => {
54+
if (typeof newVal !== "boolean") return;
55+
global.__HUGO_AURA_CONFIG__.ssa.ux.easiAssistant.notDisplay = newVal;
56+
},
57+
},
58+
],
59+
},
60+
];
61+
62+
module.exports = { uxAndAppearanceSettings };

src/aura/ui/pages/headerIcon/headerIcon.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
transition: opacity 0.25s;
88
}
99

10-
.aura-header-icon.aura-header-icon-hidden {
10+
#root.aura-header-icon-hidden .aura-header-icon {
1111
display: none;
1212
}
1313

src/aura/ui/pages/headerIcon/headerIcon.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,11 @@ global.__HUGO_AURA_UI_FUNCTIONS__.headerIcon = {
1010
let clickTimeout = null;
1111

1212
const onMounted = () => {
13-
if (!global.__HUGO_AURA_CONFIG__.auraSettings.uiAccessMethod.showEntryIcon) {
14-
const iconEl = document.getElementsByClassName("aura-header-icon")[0];
15-
iconEl.classList.add("aura-header-icon-hidden");
13+
if (
14+
!global.__HUGO_AURA_CONFIG__.auraSettings.uiAccessMethod.showEntryIcon
15+
) {
16+
const rootEl = document.getElementById("root");
17+
rootEl.classList.add("aura-header-icon-hidden");
1618
}
1719

1820
if (

0 commit comments

Comments
 (0)