mirror of
https://github.com/Studio-Saelix/sencho.git
synced 2026-08-28 03:06:57 +00:00
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:
@@ -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 = () => {
|
||||
|
||||
Reference in New Issue
Block a user