feat: add multi-gateway management with auto port detection

- Add GatewayManager for multi-profile gateway lifecycle management
- Auto-detect running gateways on startup via PID + health check
- Port conflict detection: check managed gateways, allocated ports, and
  system-level port availability (TCP bind test)
- Two-phase startup: sequential port resolution, parallel process launch
- Use `gateway start/restart` on normal systems, `gateway run --replace`
  on WSL/Docker
- Wait for health check before returning start/stop responses
- Add Gateways page with card-based layout showing profile status
- Reorganize sidebar navigation into collapsible groups
- Hide API server settings (now auto-managed by GatewayManager)
- Profile switch reloads page; Ctrl+C no longer stops gateways
- Remove redundant ensureApiServerConfig from index.ts and profiles.ts

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
ekko
2026-04-18 13:07:12 +08:00
parent 35481e452d
commit 4b6de351bd
15 changed files with 1170 additions and 467 deletions
+19
View File
@@ -35,6 +35,8 @@ export default {
confirm: 'Confirm',
expand: 'Expand',
collapse: 'Collapse',
start: 'Start',
stop: 'Stop',
},
// Sidebar
@@ -48,7 +50,14 @@ export default {
logs: 'Logs',
usage: 'Usage',
channels: 'Channels',
gateways: 'Gateways',
terminal: 'Terminal',
groupConversation: 'Conversation',
groupPlatform: 'Platform',
groupAgent: 'Agent',
groupSystem: 'System',
groupMonitoring: 'Monitoring',
groupTools: 'Tools',
settings: 'Settings',
connected: 'Connected',
disconnected: 'Disconnected',
@@ -65,6 +74,8 @@ export default {
inputPlaceholder: 'Type a message... (Enter to send, Shift+Enter for new line)',
attachFiles: 'Attach files',
stop: 'Stop',
start: 'Start',
stopGateway: 'Stop Gateway',
send: 'Send',
contextUsed: 'Context used:',
sessions: 'Sessions',
@@ -218,6 +229,14 @@ export default {
},
// Profiles
gateways: {
title: 'Gateways',
running: 'Running',
stopped: 'Stopped',
started: 'Started',
startFailed: 'Failed to start gateway',
stopFailed: 'Failed to stop gateway',
},
profiles: {
title: 'Profiles',
create: 'Create Profile',