fix(remote): repair stats, bash exec, and Open App for remote nodes

- Generic WebSockets (stats, exec) now connect to /ws?nodeId= instead of
  the bare root so the upgrade handler detects the remote node and proxies
  the WS connection to the correct remote Sencho instance.
- Vite dev proxy gains ws:true on /api and a new /ws entry so WebSocket
  upgrades reach localhost:3000 during npm run dev.
- Backend WS message handler falls back to the default local node when the
  nodeId in a proxied message doesn't exist in the local DB.
- Open App button now extracts the hostname from the remote node's api_url
  instead of using window.location.hostname.
This commit is contained in:
SaelixCode
2026-03-19 22:45:00 -04:00
parent a467c2faea
commit 94018d167f
5 changed files with 31 additions and 10 deletions
+2 -1
View File
@@ -114,7 +114,8 @@ export default function BashExecModal({ isOpen, onClose, containerId, containerN
// Connect to WebSocket for bash exec
const wsProtocol = window.location.protocol === 'https:' ? 'wss:' : 'ws:';
const ws = new WebSocket(`${wsProtocol}//${window.location.host}`);
const activeNodeId = localStorage.getItem('sencho-active-node') || '';
const ws = new WebSocket(`${wsProtocol}//${window.location.host}/ws${activeNodeId ? `?nodeId=${activeNodeId}` : ''}`);
wsRef.current = ws;
ws.onopen = () => {