mirror of
https://github.com/HugoAura/Seewo-HugoAura.git
synced 2026-06-20 23:14:28 +08:00
[✨ 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:
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "HugoAura",
|
"name": "HugoAura",
|
||||||
"version": "0.1.1-pre-IV",
|
"version": "0.1.1-beta",
|
||||||
"description": "Aura for SeewoHugo",
|
"description": "Aura for SeewoHugo",
|
||||||
"main": "app.asar/main.js",
|
"main": "app.asar/main.js",
|
||||||
"dependencies": {},
|
"dependencies": {},
|
||||||
|
|||||||
@@ -26,6 +26,14 @@
|
|||||||
"enabled": true
|
"enabled": true
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"ssa": {
|
||||||
|
"ux": {
|
||||||
|
"easiAssistant": {
|
||||||
|
"autoHide": false,
|
||||||
|
"notDisplay": false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
"auraSettings": {
|
"auraSettings": {
|
||||||
"settingsPasswordEnabled": false,
|
"settingsPasswordEnabled": false,
|
||||||
"settingsPasswordWithSalt": "32703D292460CC9A3B867494D6AD9A8E4A3ADF0FAA4D6867BC4D412CC3927D02E47C6D0B1763BB53E57B2241C6193433561CDA09D7C48CA03983072B876F0965",
|
"settingsPasswordWithSalt": "32703D292460CC9A3B867494D6AD9A8E4A3ADF0FAA4D6867BC4D412CC3927D02E47C6D0B1763BB53E57B2241C6193433561CDA09D7C48CA03983072B876F0965",
|
||||||
|
|||||||
15
src/aura/ui/hookDefinitions/desktopAssistant.js
Normal file
15
src/aura/ui/hookDefinitions/desktopAssistant.js
Normal 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;
|
||||||
23
src/aura/ui/js/pageGlobal/desktopAssistant.js
Normal file
23
src/aura/ui/js/pageGlobal/desktopAssistant.js
Normal 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();
|
||||||
|
})();
|
||||||
@@ -142,8 +142,8 @@
|
|||||||
<div class="aura-config-page-operation-body">
|
<div class="aura-config-page-operation-body">
|
||||||
<img src="../../aura/ui/static/config/no_limitations.svg" />
|
<img src="../../aura/ui/static/config/no_limitations.svg" />
|
||||||
<div>
|
<div>
|
||||||
<p class="config-operation-title">限制解除</p>
|
<p class="config-operation-title">行为改写</p>
|
||||||
<p class="config-operation-description">禁用密码、关闭功能</p>
|
<p class="config-operation-description">覆写密码、禁用能力</p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -155,7 +155,7 @@
|
|||||||
<div class="aura-config-page-operation-body">
|
<div class="aura-config-page-operation-body">
|
||||||
<img src="../../aura/ui/static/config/behaviour_mon.svg" />
|
<img src="../../aura/ui/static/config/behaviour_mon.svg" />
|
||||||
<div>
|
<div>
|
||||||
<p class="config-operation-title">行为管控</p>
|
<p class="config-operation-title">操作管控</p>
|
||||||
<p class="config-operation-description">窥屏提醒、数据欺骗</p>
|
<p class="config-operation-description">窥屏提醒、数据欺骗</p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -31,6 +31,20 @@
|
|||||||
上报屏蔽
|
上报屏蔽
|
||||||
</button>
|
</button>
|
||||||
</li>
|
</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>
|
</ul>
|
||||||
<div class="tab-content">
|
<div class="tab-content">
|
||||||
<div
|
<div
|
||||||
@@ -45,5 +59,11 @@
|
|||||||
role="tabpanel"
|
role="tabpanel"
|
||||||
aria-labelledby="disable-audit-tab"
|
aria-labelledby="disable-audit-tab"
|
||||||
></div>
|
></div>
|
||||||
|
<div
|
||||||
|
class="tab-pane fade"
|
||||||
|
id="appearance-ctl-subpage"
|
||||||
|
role="tabpanel"
|
||||||
|
aria-labelledby="appearance-ctl-tab"
|
||||||
|
></div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -7,6 +7,7 @@
|
|||||||
} = require("../../aura/ui/composables/settingsRenderer");
|
} = require("../../aura/ui/composables/settingsRenderer");
|
||||||
const { authSettings } = require(`${pathBase}/auth`);
|
const { authSettings } = require(`${pathBase}/auth`);
|
||||||
const { banAuditSettings } = require(`${pathBase}/audit`);
|
const { banAuditSettings } = require(`${pathBase}/audit`);
|
||||||
|
const { uxAndAppearanceSettings } = require(`${pathBase}/uxAppearance`);
|
||||||
|
|
||||||
const initAuthSubPage = () => {
|
const initAuthSubPage = () => {
|
||||||
const authSubPageEl = document.getElementById("auth-subpage");
|
const authSubPageEl = document.getElementById("auth-subpage");
|
||||||
@@ -18,9 +19,17 @@
|
|||||||
settingsRenderer(banAuditSubPageEl, banAuditSettings);
|
settingsRenderer(banAuditSubPageEl, banAuditSettings);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const initUxAndAppearanceSubPage = () => {
|
||||||
|
const uxAndAppearancePageEl = document.getElementById(
|
||||||
|
"appearance-ctl-subpage"
|
||||||
|
);
|
||||||
|
settingsRenderer(uxAndAppearancePageEl, uxAndAppearanceSettings);
|
||||||
|
};
|
||||||
|
|
||||||
const onMounted = () => {
|
const onMounted = () => {
|
||||||
initAuthSubPage();
|
initAuthSubPage();
|
||||||
initBanAuditSubPage();
|
initBanAuditSubPage();
|
||||||
|
initUxAndAppearanceSubPage();
|
||||||
|
|
||||||
const rootEl = document.getElementById("acs-disable-limit-root-el");
|
const rootEl = document.getElementById("acs-disable-limit-root-el");
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
|
|||||||
@@ -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 };
|
||||||
@@ -7,7 +7,7 @@
|
|||||||
transition: opacity 0.25s;
|
transition: opacity 0.25s;
|
||||||
}
|
}
|
||||||
|
|
||||||
.aura-header-icon.aura-header-icon-hidden {
|
#root.aura-header-icon-hidden .aura-header-icon {
|
||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -10,9 +10,11 @@ global.__HUGO_AURA_UI_FUNCTIONS__.headerIcon = {
|
|||||||
let clickTimeout = null;
|
let clickTimeout = null;
|
||||||
|
|
||||||
const onMounted = () => {
|
const onMounted = () => {
|
||||||
if (!global.__HUGO_AURA_CONFIG__.auraSettings.uiAccessMethod.showEntryIcon) {
|
if (
|
||||||
const iconEl = document.getElementsByClassName("aura-header-icon")[0];
|
!global.__HUGO_AURA_CONFIG__.auraSettings.uiAccessMethod.showEntryIcon
|
||||||
iconEl.classList.add("aura-header-icon-hidden");
|
) {
|
||||||
|
const rootEl = document.getElementById("root");
|
||||||
|
rootEl.classList.add("aura-header-icon-hidden");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (
|
if (
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
// @ts-check
|
// @ts-check
|
||||||
|
|
||||||
const __AURA_VERSION__ = "0.1.1-pre-IV";
|
const __AURA_VERSION__ = "0.1.1-beta";
|
||||||
|
|
||||||
(() => {
|
(() => {
|
||||||
if (require.main) return; // 如果只是导入 Aura Version, 不运行闭包逻辑
|
if (require.main) return; // 如果只是导入 Aura Version, 不运行闭包逻辑
|
||||||
|
|||||||
Reference in New Issue
Block a user