mirror of
https://github.com/HugoAura/Seewo-HugoAura.git
synced 2026-08-20 09:23:23 +08:00
[Feat] Bump version to 0.1.0-beta && 1st rel
This commit is contained in:
@@ -0,0 +1,9 @@
|
||||
.aura-config-subpage-disable-limit-root {
|
||||
opacity: 1;
|
||||
|
||||
transition: opacity 0.5s;
|
||||
}
|
||||
|
||||
.aura-config-subpage-disable-limit-root.acs-disable-limit-root-hidden {
|
||||
opacity: 0;
|
||||
}
|
||||
@@ -0,0 +1,49 @@
|
||||
<div
|
||||
id="acs-disable-limit-root-el"
|
||||
class="aura-config-subpage-disable-limit-root acs-disable-limit-root-hidden"
|
||||
>
|
||||
<ul class="nav nav-underline mb-3" role="tablist">
|
||||
<li class="nav-item" role="presentation">
|
||||
<button
|
||||
class="nav-link active"
|
||||
id="auth-subpage-tab"
|
||||
data-bs-toggle="pill"
|
||||
data-bs-target="#auth-subpage"
|
||||
type="button"
|
||||
role="tab"
|
||||
aria-controls="auth-subpage"
|
||||
aria-selected="true"
|
||||
>
|
||||
认证与基础设施
|
||||
</button>
|
||||
</li>
|
||||
<li class="nav-item" role="presentation">
|
||||
<button
|
||||
class="nav-link"
|
||||
id="disable-audit-tab"
|
||||
data-bs-toggle="pill"
|
||||
data-bs-target="#disable-audit-subpage"
|
||||
type="button"
|
||||
role="tab"
|
||||
aria-controls="disable-audit-subpage"
|
||||
aria-selected="false"
|
||||
>
|
||||
上报屏蔽
|
||||
</button>
|
||||
</li>
|
||||
</ul>
|
||||
<div class="tab-content">
|
||||
<div
|
||||
class="tab-pane fade show active"
|
||||
id="auth-subpage"
|
||||
role="tabpanel"
|
||||
aria-labelledby="auth-subpage-tab"
|
||||
></div>
|
||||
<div
|
||||
class="tab-pane fade"
|
||||
id="disable-audit-subpage"
|
||||
role="tabpanel"
|
||||
aria-labelledby="disable-audit-tab"
|
||||
></div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -0,0 +1,32 @@
|
||||
(() => {
|
||||
const pathBase =
|
||||
"../../aura/ui/pages/configSubPages/disableLimitations/settings";
|
||||
|
||||
const {
|
||||
settingsRenderer,
|
||||
} = require("../../aura/ui/composables/settingsRenderer");
|
||||
const { authSettings } = require(`${pathBase}/auth`);
|
||||
const { banAuditSettings } = require(`${pathBase}/audit`);
|
||||
|
||||
const initAuthSubPage = () => {
|
||||
const authSubPageEl = document.getElementById("auth-subpage");
|
||||
settingsRenderer(authSubPageEl, authSettings);
|
||||
};
|
||||
|
||||
const initBanAuditSubPage = () => {
|
||||
const banAuditSubPageEl = document.getElementById("disable-audit-subpage");
|
||||
settingsRenderer(banAuditSubPageEl, banAuditSettings);
|
||||
};
|
||||
|
||||
const onMounted = () => {
|
||||
initAuthSubPage();
|
||||
initBanAuditSubPage();
|
||||
|
||||
const rootEl = document.getElementById("acs-disable-limit-root-el");
|
||||
setTimeout(() => {
|
||||
rootEl.classList.remove("acs-disable-limit-root-hidden");
|
||||
}, 500);
|
||||
};
|
||||
|
||||
onMounted();
|
||||
})();
|
||||
@@ -0,0 +1,60 @@
|
||||
const banAuditSettings = [
|
||||
{
|
||||
id: 0,
|
||||
categoryName: "数据收集与分析",
|
||||
child: [
|
||||
{
|
||||
index: 0,
|
||||
id: "disableFridayReport",
|
||||
type: "switch",
|
||||
name: "禁用 Friday 错误统计",
|
||||
description: "重置 CVTE 的 Friday 错误收集服务载入 URL, 避免意外的信息上传",
|
||||
restart: true,
|
||||
reload: false,
|
||||
associateVal: null,
|
||||
auraIf: () => true,
|
||||
defaultValue: false,
|
||||
valueGetter: () => {
|
||||
return global.__HUGO_AURA_CONFIG__.networkRewrite.disableFriday
|
||||
.enabled;
|
||||
},
|
||||
callbackFn: (newVal) => {
|
||||
if (typeof newVal !== "boolean") return;
|
||||
global.__HUGO_AURA_CONFIG__.networkRewrite.disableFriday.enabled =
|
||||
newVal;
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
id: 1,
|
||||
categoryName: "行为上报",
|
||||
child: [
|
||||
{
|
||||
index: 0,
|
||||
id: "disableBehaviorAudit",
|
||||
type: "switch",
|
||||
name: "禁用行为上报",
|
||||
description: "禁止希沃管家前端在进行敏感操作时, 向希沃基础服务上报行为",
|
||||
restart: true,
|
||||
reload: false,
|
||||
tip: true,
|
||||
tipTitle: '启用后, 可能造成部分操作出现较长延迟 (如冰点操作)。希沃管家会尝试五次上报, 均失败后才会进行下一步操作',
|
||||
associateVal: null,
|
||||
auraIf: () => true,
|
||||
defaultValue: false,
|
||||
valueGetter: () => {
|
||||
return global.__HUGO_AURA_CONFIG__.networkRewrite.disableBehaviorAudit
|
||||
.enabled;
|
||||
},
|
||||
callbackFn: (newVal) => {
|
||||
if (typeof newVal !== "boolean") return;
|
||||
global.__HUGO_AURA_CONFIG__.networkRewrite.disableBehaviorAudit.enabled =
|
||||
newVal;
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
];
|
||||
|
||||
module.exports = { banAuditSettings };
|
||||
@@ -0,0 +1,161 @@
|
||||
const authSettings = [
|
||||
{
|
||||
id: 0,
|
||||
categoryName: "身份验证",
|
||||
child: [
|
||||
{
|
||||
index: 0,
|
||||
id: "enableAuthOverride",
|
||||
type: "switch",
|
||||
name: "启用身份验证覆写功能",
|
||||
description: "覆写希沃管家的身份验证组件, 实现限制解除",
|
||||
restart: false,
|
||||
reload: true,
|
||||
associateVal: null,
|
||||
auraIf: () => true,
|
||||
defaultValue: false,
|
||||
valueGetter: () => {
|
||||
return global.__HUGO_AURA_CONFIG__.rewrite[
|
||||
"vendor/passwordValidation"
|
||||
].enabled;
|
||||
},
|
||||
callbackFn: (newVal) => {
|
||||
if (typeof newVal !== "boolean") return;
|
||||
global.__HUGO_AURA_CONFIG__.rewrite[
|
||||
"vendor/passwordValidation"
|
||||
].enabled = newVal;
|
||||
},
|
||||
},
|
||||
{
|
||||
index: 1,
|
||||
id: "authOverrideType",
|
||||
type: "radio",
|
||||
name: "密码覆写模式",
|
||||
description: "自定义密码 / 完全解除密码 / 仅使用学校密码",
|
||||
restart: false,
|
||||
reload: false,
|
||||
tip: true,
|
||||
tipTitle: '使用 "任意" 选项后, 仍需输入至少一位密码才能继续操作',
|
||||
associateVal: ["rewrite.vendor/passwordValidation.enabled"],
|
||||
auraIf: () => {
|
||||
return global.__HUGO_AURA_CONFIG__.rewrite[
|
||||
"vendor/passwordValidation"
|
||||
].enabled;
|
||||
},
|
||||
defaultValue: "none",
|
||||
templates: ["customPassword", "bypass", "none"],
|
||||
templateLabels: ["自定义", "任意", "不修改"],
|
||||
valueGetter: () => {
|
||||
return global.__HUGO_AURA_CONFIG__.rewrite[
|
||||
"vendor/passwordValidation"
|
||||
].type;
|
||||
},
|
||||
callbackFn: (newVal) => {
|
||||
global.__HUGO_AURA_CONFIG__.rewrite[
|
||||
"vendor/passwordValidation"
|
||||
].type = newVal;
|
||||
},
|
||||
},
|
||||
{
|
||||
index: 2,
|
||||
id: "customPassword",
|
||||
type: "input",
|
||||
subType: "password",
|
||||
name: "自定义密码",
|
||||
description: "设置一个自定义密码, 可与原管理密码共用",
|
||||
restart: false,
|
||||
reload: false,
|
||||
associateVal: [
|
||||
"rewrite.vendor/passwordValidation.enabled",
|
||||
"rewrite.vendor/passwordValidation.type",
|
||||
],
|
||||
auraIf: () => {
|
||||
return (
|
||||
global.__HUGO_AURA_CONFIG__.rewrite["vendor/passwordValidation"]
|
||||
.enabled &&
|
||||
global.__HUGO_AURA_CONFIG__.rewrite["vendor/passwordValidation"]
|
||||
.type === "customPassword"
|
||||
);
|
||||
},
|
||||
defaultValue: "",
|
||||
placeHolder: "留空表示不修改, 保留已设置值",
|
||||
valueGetter: () => {
|
||||
return "";
|
||||
},
|
||||
callbackFn: (newVal) => {
|
||||
if (newVal === "" || !newVal) return { valid: true };
|
||||
if (newVal.length < 6)
|
||||
return { valid: false, hint: "请输入至少 6 位密码" };
|
||||
const __config =
|
||||
global.__HUGO_AURA_CONFIG__.rewrite["vendor/passwordValidation"];
|
||||
const crypto = require("crypto");
|
||||
const result = crypto
|
||||
.createHash("md5")
|
||||
.update(newVal + __config.customPassword.salt)
|
||||
.digest("hex");
|
||||
__config.customPassword.passwordWithSalt = result;
|
||||
return { valid: true };
|
||||
},
|
||||
},
|
||||
{
|
||||
index: 3,
|
||||
id: "authModeRewriteType",
|
||||
type: "radio",
|
||||
name: "验证方式覆写",
|
||||
description: "密码 + 二维码混合 / 仅二维码 / 仅密码",
|
||||
restart: false,
|
||||
reload: false,
|
||||
tip: true,
|
||||
tipTitle: '一般选择 "混合" 或 "仅密码" 即可',
|
||||
associateVal: ["rewrite.vendor/passwordValidation.enabled"],
|
||||
auraIf: () => {
|
||||
return global.__HUGO_AURA_CONFIG__.rewrite[
|
||||
"vendor/passwordValidation"
|
||||
].enabled;
|
||||
},
|
||||
defaultValue: "hybrid",
|
||||
templates: ["hybrid", "remoteOnly", "passwordOnly"],
|
||||
templateLabels: ["混合", "仅二维码", "仅密码"],
|
||||
valueGetter: () => {
|
||||
return global.__HUGO_AURA_CONFIG__.rewrite[
|
||||
"vendor/passwordValidation"
|
||||
].authModeRewrite;
|
||||
},
|
||||
callbackFn: (newVal) => {
|
||||
global.__HUGO_AURA_CONFIG__.rewrite[
|
||||
"vendor/passwordValidation"
|
||||
].authModeRewrite = newVal;
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
id: 1,
|
||||
categoryName: "基础设施",
|
||||
child: [
|
||||
{
|
||||
index: 0,
|
||||
id: "enableDevTools",
|
||||
type: "switch",
|
||||
name: "启用开发者工具",
|
||||
description: "修改希沃管家的全局配置, 允许打开 DevTools",
|
||||
restart: true,
|
||||
reload: false,
|
||||
tip: true,
|
||||
tipTitle: "启用后, 按下 Ctrl + Shift + I 即可打开 DevTools",
|
||||
associateVal: null,
|
||||
auraIf: () => true,
|
||||
defaultValue: false,
|
||||
valueGetter: () => {
|
||||
return global.__HUGO_AURA_CONFIG__.devTools;
|
||||
},
|
||||
callbackFn: (newVal) => {
|
||||
if (typeof newVal !== "boolean") return;
|
||||
global.__HUGO_AURA_CONFIG__.devTools = newVal;
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
];
|
||||
|
||||
module.exports = { authSettings };
|
||||
Reference in New Issue
Block a user