From 9cf4bdd4e52e18a8c14c79a48452d4dc274307e4 Mon Sep 17 00:00:00 2001 From: Lex_q <154044203+Tz-WIND@users.noreply.github.com> Date: Sat, 25 Apr 2026 20:06:17 +0800 Subject: [PATCH 1/6] Change dev script to run custom dev script --- frontend/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frontend/package.json b/frontend/package.json index 75ceecaca..a8c611607 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -7,7 +7,7 @@ "scripts": { "lint": "node scripts/run-eslint.mjs", "lint:fix": "node scripts/run-eslint.mjs --fix", - "dev": "vite", + "dev": "node scripts/dev.mjs", "dev:web": "npx cross-env WEB_ONLY=1 vite", "build": "node scripts/run-build.mjs", "preview": "vite preview", From cf72c2d5842383e3c2b7d2644811e36e6001bfdc Mon Sep 17 00:00:00 2001 From: Lex_q <154044203+Tz-WIND@users.noreply.github.com> Date: Sat, 25 Apr 2026 20:07:09 +0800 Subject: [PATCH 2/6] Enhance backend process environment and logging --- frontend/electron/modules/backend.ts | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/frontend/electron/modules/backend.ts b/frontend/electron/modules/backend.ts index abe9bf567..51fda07c7 100644 --- a/frontend/electron/modules/backend.ts +++ b/frontend/electron/modules/backend.ts @@ -135,7 +135,12 @@ export function startBackend(): void { appendBackendLog(`[Backend] Starting from ${cwd}`) appendBackendLog(`[Backend] Command: ${cmd} ${args.join(' ')}`) - const env: Record = { ...process.env, PYTHONUNBUFFERED: '1' } + const env: Record = { + ...process.env, + PYTHONUNBUFFERED: '1', + PYTHONIOENCODING: 'utf-8', + PYTHONUTF8: '1', + } const useDebugConsole = process.platform === 'win32' && shouldOpenDebugConsole() @@ -200,14 +205,15 @@ export function startBackend(): void { detached: process.platform !== 'win32', }) - backendProcess.stdout?.on('data', (data: Buffer) => { - const text = data.toString() + backendProcess.stdout?.setEncoding('utf-8') + backendProcess.stderr?.setEncoding('utf-8') + + backendProcess.stdout?.on('data', (text: string) => { consumeStdoutChunk(text) console.log(`[Backend] ${text.trimEnd()}`) }) - backendProcess.stderr?.on('data', (data: Buffer) => { - const text = data.toString() + backendProcess.stderr?.on('data', (text: string) => { console.error(`[Backend] ${text.trimEnd()}`) consumeStderrChunk(text) }) From 32e250476470711308b5e9513f509346182cbd0a Mon Sep 17 00:00:00 2001 From: Lex_q <154044203+Tz-WIND@users.noreply.github.com> Date: Sat, 25 Apr 2026 20:09:18 +0800 Subject: [PATCH 3/6] Add files via upload --- frontend/scripts/dev.mjs | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 frontend/scripts/dev.mjs diff --git a/frontend/scripts/dev.mjs b/frontend/scripts/dev.mjs new file mode 100644 index 000000000..7f04ea542 --- /dev/null +++ b/frontend/scripts/dev.mjs @@ -0,0 +1,16 @@ +import { execSync, spawn } from 'node:child_process' +import process from 'node:process' + +if (process.platform === 'win32') { + try { + execSync('chcp 65001', { stdio: 'ignore' }) + } + catch {} +} + +const child = spawn('npx', ['vite'], { + stdio: 'inherit', + shell: true, +}) + +child.on('exit', code => process.exit(code ?? 0)) From ece4244ff550fb52d50e11efb46ac9e6f83b6712 Mon Sep 17 00:00:00 2001 From: Lex_q <154044203+Tz-WIND@users.noreply.github.com> Date: Sat, 25 Apr 2026 20:10:06 +0800 Subject: [PATCH 4/6] Update skip login text in LoginDialog.vue MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Replaced '使用开源版本' with '直接进入' in the skip login option. --- frontend/src/components/LoginDialog.vue | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/frontend/src/components/LoginDialog.vue b/frontend/src/components/LoginDialog.vue index 6d1088791..572b78dc5 100644 --- a/frontend/src/components/LoginDialog.vue +++ b/frontend/src/components/LoginDialog.vue @@ -213,7 +213,7 @@ function handleSkip() { trackTelemetry('login_skip', { mode: mode.value, }) - window.open('https://github.com/RTGS2017/NagaAgent.git', '_blank') + emit('skip') } function openForgotPassword() { @@ -314,7 +314,7 @@ const stopWatch = watch(backendConnected, (connected) => { @@ -407,7 +407,7 @@ const stopWatch = watch(backendConnected, (connected) => { From 8f039b357bc2b55f75788706cc3e9681ba212c84 Mon Sep 17 00:00:00 2001 From: Lex_q <154044203+Tz-WIND@users.noreply.github.com> Date: Sat, 25 Apr 2026 20:10:45 +0800 Subject: [PATCH 5/6] Enhance configuration options in ConfigView.vue Updated ConfigView.vue to enhance configuration options for NagaModel and local modes, including improved connection status indicators and input handling. --- frontend/src/views/ConfigView.vue | 251 ++++++++++++++++++++---------- 1 file changed, 171 insertions(+), 80 deletions(-) diff --git a/frontend/src/views/ConfigView.vue b/frontend/src/views/ConfigView.vue index 03bdee83b..eacb875cc 100644 --- a/frontend/src/views/ConfigView.vue +++ b/frontend/src/views/ConfigView.vue @@ -235,6 +235,27 @@ async function testConnection() {
+ +
+
+ + +
+
+
+ {{ isNagaLoggedIn ? '网关模式' : '本地模式' }} +
+
+ + +
+
+
+ @@ -254,14 +275,21 @@ async function testConnection() {
- - ✓ 已登陆 ({{ nagaUser?.username }}),使用 NagaModel 网关 - - - - ✓ 已登陆 ({{ nagaUser?.username }}),无需输入 - - + + + + @@ -287,31 +315,32 @@ async function testConnection() {
- - ✓ 已登陆,无需填写 - - - - ✓ 已登陆,使用 NagaModel 网关 - - - - ✓ 已登陆,无需输入 - - - - - ✓ 已登陆,无需填写 - - - - ✓ 已登陆,使用 NagaModel 网关 - - - - ✓ 已登陆,无需输入 - - + +
@@ -327,11 +356,15 @@ async function testConnection() {
- - ✓ 已登陆,无需填写 - - -