Integrate Docker support into Archipelago and Neode UI

- Added StateManager and data_model modules to manage application state.
- Updated ApiHandler to utilize StateManager for WebSocket connections.
- Enhanced Server initialization to include StateManager.
- Implemented Docker container querying in Neode UI to populate app data dynamically.
- Removed temporary dummy app configurations in favor of real Docker-based applications.
- Improved WebSocket reconnection logic and error handling in the UI.
- Updated package.json and package-lock.json to include dockerode dependency.
This commit is contained in:
Dorian
2026-01-27 23:06:18 +00:00
parent 7afefafec1
commit 3b3f70276f
15 changed files with 1318 additions and 329 deletions

View File

@@ -139,8 +139,8 @@ export class WebSocketClient {
// Always try to reconnect unless we've exceeded max attempts
// Code 1001 (Going Away) happens on HMR reloads - reconnect IMMEDIATELY
if (this.reconnectAttempts < this.maxReconnectAttempts) {
// Immediate reconnection for HMR (code 1001) - no delay
const isHMR = event.code === 1001 || event.code === 1006
// Only code 1001 is HMR, NOT 1006 (1006 is abnormal closure)
const isHMR = event.code === 1001
const delay = isHMR ? 0 : (this.reconnectAttempts === 0 ? 100 : Math.min(this.reconnectDelay * Math.pow(2, this.reconnectAttempts), 5000))
console.log(`[WebSocket] Reconnecting in ${delay}ms (attempt ${this.reconnectAttempts + 1}/${this.maxReconnectAttempts}, code: ${event.code}, HMR: ${isHMR})`)