From 5795e85079cb93bef4c877d980f6fb0c7cec2e2a Mon Sep 17 00:00:00 2001 From: Jari Kolehmainen Date: Sun, 29 Mar 2020 20:03:46 +0300 Subject: [PATCH] Silence terminal websocket connection errors (#172) Signed-off-by: Jari Kolehmainen --- dashboard/client/api/terminal-api.ts | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) diff --git a/dashboard/client/api/terminal-api.ts b/dashboard/client/api/terminal-api.ts index 46337cccd7..aec97f34af 100644 --- a/dashboard/client/api/terminal-api.ts +++ b/dashboard/client/api/terminal-api.ts @@ -66,7 +66,7 @@ export class TerminalApi extends WebSocketApi { const token = await configStore.getToken(); const apiUrl = await this.getUrl(token); const { colorTheme } = this.options; - this.emitStatus("Connecting...", { + this.emitStatus("Connecting ...", { color: colorTheme == "light" ? TerminalColor.GRAY : TerminalColor.LIGHT_GRAY }); this.onData.addListener(this._onReady, { prepend: true }); @@ -109,12 +109,6 @@ export class TerminalApi extends WebSocketApi { reconnect() { const { reconnectDelaySeconds } = this.params; - if (reconnectDelaySeconds) { - this.emitStatus(`Reconnect in ${reconnectDelaySeconds} seconds`, { - color: TerminalColor.YELLOW, - showTime: true, - }); - } super.reconnect(); } @@ -143,11 +137,6 @@ export class TerminalApi extends WebSocketApi { } protected _onClose(evt: CloseEvent) { - const { code, reason, wasClean } = evt; - if (code !== 1000 || !wasClean) { - this.emitStatus("\r\n"); - this.emitError(`Closed by "${reason}" (code: ${code}) at ${new Date()}.`); - } super._onClose(evt); this.isReady = false; }