feat(desktop): Gateway URL 配置化 + Rust panic hook 崩溃报告
Some checks failed
CI / Lint & TypeCheck (push) Has been cancelled
CI / Unit Tests (push) Has been cancelled
CI / Build Frontend (push) Has been cancelled
CI / Rust Check (push) Has been cancelled
CI / Security Scan (push) Has been cancelled
CI / E2E Tests (push) Has been cancelled

- api-urls.ts: GATEWAY_URLS 读 VITE_GATEWAY_HTTP/WS env
- gateway-storage.ts: DEFAULT_GATEWAY_URL 读 VITE_GATEWAY_WS env
- lib.rs: 添加 tracing_subscriber 初始化 + panic::set_hook
  崩溃时自动写入 crash-reports/ 目录供诊断
- Cargo.toml: 添加 tracing-subscriber workspace 依赖
This commit is contained in:
iven
2026-04-11 02:54:23 +08:00
parent 4e641bd38d
commit db1f8dcbbc
4 changed files with 43 additions and 3 deletions

View File

@@ -50,8 +50,8 @@ export const LLM_PROVIDER_URLS = {
* ZCLAW Gateway default URLs
*/
export const GATEWAY_URLS = {
DEFAULT_HTTP: 'http://127.0.0.1:50051',
DEFAULT_WS: 'ws://127.0.0.1:50051/ws',
DEFAULT_HTTP: import.meta.env.VITE_GATEWAY_HTTP || 'http://127.0.0.1:50051',
DEFAULT_WS: import.meta.env.VITE_GATEWAY_WS || 'ws://127.0.0.1:50051/ws',
FALLBACK_HTTP: 'http://127.0.0.1:4200',
FALLBACK_WS: 'ws://127.0.0.1:4200/ws',
} as const;

View File

@@ -48,7 +48,7 @@ export function isLocalhost(url: string): boolean {
// ZCLAW endpoints (port 50051 - actual running port)
// Note: REST API uses relative path to leverage Vite proxy for CORS bypass
export const DEFAULT_GATEWAY_URL = `${DEFAULT_WS_PROTOCOL}127.0.0.1:50051/ws`;
export const DEFAULT_GATEWAY_URL = import.meta.env.VITE_GATEWAY_WS || `${DEFAULT_WS_PROTOCOL}127.0.0.1:50051/ws`;
export const REST_API_URL = ''; // Empty = use relative path (Vite proxy)
export const FALLBACK_GATEWAY_URLS = [
DEFAULT_GATEWAY_URL,