refactor: add conditional to prevent access to terminal when is not server

This commit is contained in:
Mauricio Siu
2024-09-20 01:33:06 -06:00
parent ee5516bb91
commit 0b22b694e6
2 changed files with 3 additions and 3 deletions

View File

@@ -38,7 +38,7 @@ export const DockerTerminal: React.FC<Props> = ({
const protocol = window.location.protocol === "https:" ? "wss:" : "ws:";
const wsUrl = `${protocol}//${window.location.host}/docker-container-terminal?containerId=${containerId}&activeWay=${activeWay}&serverId=${serverId}`;
const wsUrl = `${protocol}//${window.location.host}/docker-container-terminal?containerId=${containerId}&activeWay=${activeWay}${serverId ? `&serverId=${serverId}` : ""}`;
const ws = new WebSocket(wsUrl);