mirror of
https://github.com/DayuanJiang/next-ai-draw-io.git
synced 2026-01-11 02:28:30 +08:00
feat: add proxy settings to Settings dialog (Desktop only) (#537)
* feat: add proxy settings to Settings dialog (Desktop only) Fixes #535 - Desktop app now respects HTTP/HTTPS proxy configuration. - Add proxy-manager.ts to handle proxy config storage (JSON file in userData) - Load proxy settings on app startup before Next.js server starts - Add IPC handlers for get-proxy and set-proxy - Add proxy settings UI in Settings dialog (Electron only) - Add translations for en/zh/ja * fix: improve proxy settings reliability and simplify UI - Fix server restart race condition (wait for process exit before starting new server) - Add URL validation (must include http:// or https:// prefix) - Enable Node.js built-in proxy support (NODE_USE_ENV_PROXY=1) - Remove "Proxy Exceptions" field (unnecessary for this app) - Add debug logging for proxy env vars * refactor: remove duplicate ProxyConfig interface, import from electron.d.ts
This commit is contained in:
@@ -4,6 +4,7 @@ import { getCurrentPresetEnv } from "./config-manager"
|
||||
import { loadEnvFile } from "./env-loader"
|
||||
import { registerIpcHandlers } from "./ipc-handlers"
|
||||
import { startNextServer, stopNextServer } from "./next-server"
|
||||
import { applyProxyToEnv } from "./proxy-manager"
|
||||
import { registerSettingsWindowHandlers } from "./settings-window"
|
||||
import { createWindow, getMainWindow } from "./window-manager"
|
||||
|
||||
@@ -24,6 +25,9 @@ if (!gotTheLock) {
|
||||
// Load environment variables from .env files
|
||||
loadEnvFile()
|
||||
|
||||
// Apply proxy settings from saved config
|
||||
applyProxyToEnv()
|
||||
|
||||
// Apply saved preset environment variables (overrides .env)
|
||||
const presetEnv = getCurrentPresetEnv()
|
||||
for (const [key, value] of Object.entries(presetEnv)) {
|
||||
|
||||
Reference in New Issue
Block a user