mirror of
https://github.com/Dokploy/dokploy
synced 2025-06-26 18:27:59 +00:00
refactor: update ref
This commit is contained in:
parent
4cde1a8a7d
commit
651bf3a303
@ -21,13 +21,21 @@ export const DockerLogsId: React.FC<Props> = ({
|
||||
const wsRef = useRef<WebSocket | null>(null); // Ref to hold WebSocket instance
|
||||
|
||||
useEffect(() => {
|
||||
if (containerId === "select-a-containe") {
|
||||
return;
|
||||
}
|
||||
// if (containerId === "select-a-container") {
|
||||
// return;
|
||||
// }
|
||||
const container = document.getElementById(id);
|
||||
if (container) {
|
||||
container.innerHTML = "";
|
||||
}
|
||||
|
||||
if (wsRef.current) {
|
||||
console.log(wsRef.current);
|
||||
if (wsRef.current.readyState === WebSocket.OPEN) {
|
||||
wsRef.current.close();
|
||||
}
|
||||
wsRef.current = null;
|
||||
}
|
||||
const termi = new Terminal({
|
||||
cursorBlink: true,
|
||||
cols: 80,
|
||||
|
@ -33,6 +33,8 @@ export const setupDockerContainerLogsWebSocketServer = (
|
||||
const tail = url.searchParams.get("tail");
|
||||
const serverId = url.searchParams.get("serverId");
|
||||
const { user, session } = await validateWebSocketRequest(req);
|
||||
console.log(wssTerm.clients);
|
||||
console.log(wssTerm.clients.size);
|
||||
|
||||
if (!containerId) {
|
||||
ws.close(4000, "containerId no provided");
|
||||
|
Loading…
Reference in New Issue
Block a user