2 Commits

Author SHA1 Message Date
Minoricew
ef0e39dd8c [🔁 Chore] Auto upload release for workflow 2025-06-14 16:51:28 +08:00
Minoricew
9a2a335742 [ Feat] {#21} Add AppBar window oper icons
1. [+] {#21} 增加了应用栏 (顶栏) 上的窗口操作按钮
2. [-] 删掉了几个调试时留下的 console.debug
2025-06-14 16:07:10 +08:00
7 changed files with 186 additions and 5 deletions

View File

@@ -7,6 +7,8 @@ on:
branches: [dev, stable, main, master] branches: [dev, stable, main, master]
workflow_dispatch: workflow_dispatch:
permissions: write-all
jobs: jobs:
pack: pack:
name: Patch & Pack name: Patch & Pack
@@ -123,6 +125,30 @@ jobs:
echo "[DEBUG] Files in <Working DIR>/Artifacts directory:" echo "[DEBUG] Files in <Working DIR>/Artifacts directory:"
ls -la Artifacts/ ls -la Artifacts/
- name: Get short commit hash
run: |
cd ./HugoAura-Code
SHORT_HASH=$(git rev-parse --short=7 HEAD)
echo "SHORT_HASH=$SHORT_HASH" >> $GITHUB_ENV
- name: Create release content
run: |
cat > rel_msg.txt << EOF
## 这是 HugoAura 的 CI 自动构建版本
### 版本类型: 🔁 自动构建版
### 版本号: `vAutoBuild-${{ env.SHORT_HASH }}`
### 对应 Commit: [`${{ env.SHORT_HASH }}`](https://github.com/HugoAura/Seewo-HugoAura/commit/${{ env.GITHUB_SHA }})
---
### ⚠ 注意: CI 自动构建版本可能不稳定 / 存在较多 Bug, 更新时请留意
**🕘 构建时间: ${{ env.BUILDTIME }}**
EOF
- name: Upload patched ASAR - name: Upload patched ASAR
uses: actions/upload-artifact@v4 uses: actions/upload-artifact@v4
with: with:
@@ -134,3 +160,16 @@ jobs:
with: with:
name: aura-code name: aura-code
path: Artifacts/aura.zip path: Artifacts/aura.zip
- name: Upload release
uses: softprops/action-gh-release@v2
with:
tag_name: vAutoBuild
name: "[CI] HugoAura Auto Build Release"
body_path: rel_msg.txt
prerelease: true
generate_release_notes: false
token: ${{ secrets.GITHUB_TOKEN }}
file: |
Artifacts/app-patched.asar
Artifacts/aura.zip

View File

@@ -76,6 +76,7 @@ const buildIpcMain = (electron) => {
} }
}; };
const { applyBaseIpcHandler } = require("./ipcModules/baseIpcHandler");
const { applyConfigIpcHandler } = require("./ipcModules/configIpcHandler"); const { applyConfigIpcHandler } = require("./ipcModules/configIpcHandler");
const { applyFsIpcHandler } = require("./ipcModules/fsIpcHandler"); const { applyFsIpcHandler } = require("./ipcModules/fsIpcHandler");
const { applyPlsIpcHandler } = require("./ipcModules/plsIpcHandler"); const { applyPlsIpcHandler } = require("./ipcModules/plsIpcHandler");
@@ -85,6 +86,7 @@ const buildIpcMain = (electron) => {
app.exit(0); app.exit(0);
}); });
applyBaseIpcHandler(ipcMain);
applyConfigIpcHandler(ipcMain); applyConfigIpcHandler(ipcMain);
applyFsIpcHandler(ipcMain); applyFsIpcHandler(ipcMain);
applyPlsIpcHandler(ipcMain); applyPlsIpcHandler(ipcMain);

View File

@@ -0,0 +1,59 @@
// @ts-check
const { BrowserWindow } = require("electron");
const composables = {
getBrowserWindowInstance: (windowKey) => {
if (!global.__HUGO_AURA__.hookedWindows) return null;
const hookedWindowIns = global.__HUGO_AURA__.hookedWindows.get(windowKey);
if (!hookedWindowIns) return undefined;
const browserWindowIns = BrowserWindow.fromWebContents(
hookedWindowIns.webContents
);
return browserWindowIns;
},
};
/**
*
* @param {import("electron").IpcMain} ipcMain
*/
const applyBaseIpcHandler = (ipcMain) => {
const methodBase = "$aura.base";
ipcMain.on(
`${methodBase}.minimizeWindow`,
/**
*
* @param {import("electron").IpcMainEvent} _event
* @param {{ targetWindowKey: string }} arg
*/
(_event, arg) => {
const browserWindowIns = composables.getBrowserWindowInstance(
arg.targetWindowKey
);
if (!browserWindowIns) return;
browserWindowIns.minimize();
}
);
ipcMain.on(
`${methodBase}.closeWindow`,
/**
*
* @param {import("electron").IpcMainEvent} _event
* @param {{ targetWindowKey: string }} arg
*/
(_event, arg) => {
const browserWindowIns = composables.getBrowserWindowInstance(
arg.targetWindowKey
);
if (!browserWindowIns) return;
browserWindowIns.close();
}
);
};
module.exports = { applyBaseIpcHandler };

View File

@@ -7,11 +7,48 @@
<div class="aura-config-page-app-bar" style="-webkit-app-region: drag"> <div class="aura-config-page-app-bar" style="-webkit-app-region: drag">
<div <div
onclick="global.__HUGO_AURA_UI_FUNCTIONS__.config.handleNavBack()" onclick="global.__HUGO_AURA_UI_FUNCTIONS__.config.handleNavBack()"
style="-webkit-app-region: no-drag; z-index: 2000" style="-webkit-app-region: no-drag; z-index: 2000; margin-right: 0.1rem"
> >
<i class="iconfont"></i> <i class="iconfont"></i>
<!-- Chevron Left Icon -->
</div> </div>
<p>雨光之环</p> <p>雨光之环</p>
<div class="aura-config-page-app-bar-hr-vertical"></div>
<div
onclick="global.__HUGO_AURA_UI_FUNCTIONS__.config.handleNavHome()"
style="-webkit-app-region: no-drag; z-index: 2000; margin-left: 6px"
>
<svg
xmlns="http://www.w3.org/2000/svg"
width="21"
height="21"
viewBox="0 0 24 24"
class="iconfont"
style="margin-top: -1.5px"
>
<path
fill="currentColor"
d="M6 19h3.692v-5.884h4.616V19H18v-9l-6-4.538L6 10zm-1 1V9.5l7-5.288L19 9.5V20h-5.692v-5.884h-2.616V20zm7-7.77"
stroke-width="0.5"
stroke="currentColor"
/>
</svg>
</div>
<div class="aura-config-page-app-bar-spacer"></div>
<div
onclick="global.__HUGO_AURA_UI_FUNCTIONS__.config.minimizeWindow()"
style="-webkit-app-region: no-drag; z-index: 2000"
>
<i class="iconfont"></i>
<!-- Minimize Icon -->
</div>
<div
onclick="global.__HUGO_AURA_UI_FUNCTIONS__.config.closeWindow()"
style="-webkit-app-region: no-drag; z-index: 2000; margin-left: 0.5rem"
>
<i class="iconfont"></i>
<!-- Failed / Cancel Icon -->
</div>
</div> </div>
</div> </div>

View File

@@ -6,6 +6,22 @@ global.__HUGO_AURA_UI_REACTIVES__.config = {
}; };
global.__HUGO_AURA_UI_FUNCTIONS__.config = { global.__HUGO_AURA_UI_FUNCTIONS__.config = {
closeWindow: async () => {
if (global.__HUGO_AURA_UI_REACTIVES__.config.isConfigPendingWrite) {
await global.__HUGO_AURA_UI_FUNCTIONS__.config.handleSaveConfig();
}
global.ipcRenderer.send("$aura.base.closeWindow", {
targetWindowKey: "assistant",
});
},
minimizeWindow: () => {
global.ipcRenderer.send("$aura.base.minimizeWindow", {
targetWindowKey: "assistant",
});
},
handleNavBack: () => { handleNavBack: () => {
if (global.__HUGO_AURA_UI_REACTIVES__.config.isInSubPage) { if (global.__HUGO_AURA_UI_REACTIVES__.config.isInSubPage) {
const acsDialogAreaEl = document.getElementsByClassName( const acsDialogAreaEl = document.getElementsByClassName(
@@ -30,6 +46,19 @@ global.__HUGO_AURA_UI_FUNCTIONS__.config = {
} }
}, },
handleNavHome: async () => {
if (global.__HUGO_AURA_UI_REACTIVES__.config.isConfigPendingWrite) {
global.__HUGO_AURA_UI_FUNCTIONS__.config.handleSaveConfig();
}
global.__HUGO_AURA_UI_FUNCTIONS__.config.hideConfigPage();
setTimeout(() => {
const onLeaveEvent = new CustomEvent("onCurConfigPageLeave");
document.dispatchEvent(onLeaveEvent);
}, 500);
},
hideConfigPage: async () => { hideConfigPage: async () => {
const defaultHeader = document.getElementsByClassName( const defaultHeader = document.getElementsByClassName(
"index__header__16DmR2a5" "index__header__16DmR2a5"

View File

@@ -19,6 +19,11 @@
color: rgba(0, 0, 0, 0.8); color: rgba(0, 0, 0, 0.8);
} }
.aura-config-page-header-area.color-reverse
.aura-config-page-app-bar-hr-vertical {
background: rgba(0, 0, 0, 0.5);
}
.aura-config-page-header-area .iconfont { .aura-config-page-header-area .iconfont {
font-size: 24px; font-size: 24px;
} }
@@ -33,7 +38,7 @@
} }
.aura-config-page-header-area p { .aura-config-page-header-area p {
margin-top: -1px; margin-top: -2px;
} }
.aura-config-page-header-area.header-collapsed { .aura-config-page-header-area.header-collapsed {
@@ -48,3 +53,16 @@
align-items: center; align-items: center;
width: 100%; width: 100%;
} }
.aura-config-page-app-bar-spacer {
flex-grow: 1;
}
.aura-config-page-app-bar-hr-vertical {
position: relative;
margin-left: 8px;
width: 1px;
background: rgba(255, 255, 255, 0.5);
height: 12px;
transition: background 0.5s;
}

View File

@@ -96,12 +96,9 @@ const functions = {
const handleExit = async () => { const handleExit = async () => {
const result = await awaitCompletePromise; const result = await awaitCompletePromise;
console.debug(result);
if (result) { if (result) {
console.debug("ret true");
return { valid: true }; return { valid: true };
} else { } else {
console.debug("ret false");
const inputEl = document.getElementById("auraSettingsPasswd"); const inputEl = document.getElementById("auraSettingsPasswd");
// @ts-expect-error // @ts-expect-error
inputEl.value = ""; inputEl.value = "";