Refactor WebSocket connection handlers: streamline logs and switch to warnings for closure events
Signed-off-by: YoungSoo Shin <shinys000114@gmail.com>
This commit is contained in:
@@ -55,16 +55,12 @@ const confirmPasswordInput = document.getElementById('confirm-password');
|
|||||||
|
|
||||||
function onWsOpen() {
|
function onWsOpen() {
|
||||||
updateWebsocketStatus(true);
|
updateWebsocketStatus(true);
|
||||||
if (term) {
|
console.log('Connected to WebSocket Server');
|
||||||
term.write('\x1b[32mConnected to WebSocket Server\x1b[0m\r\n');
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function onWsClose() {
|
function onWsClose() {
|
||||||
updateWebsocketStatus(false);
|
updateWebsocketStatus(false);
|
||||||
if (term) {
|
console.warn('Connection closed. Reconnecting...');
|
||||||
term.write('\r\n\x1b[31mConnection closed. Reconnecting...\x1b[0m\r\n');
|
|
||||||
}
|
|
||||||
setTimeout(connect, 2000);
|
setTimeout(connect, 2000);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user