From 37ab5e937f874f089b46f5475afc5d385a85e6ee Mon Sep 17 00:00:00 2001 From: Shuanglei Tao Date: Sat, 15 Jun 2019 09:24:19 +0800 Subject: [PATCH] html: restore prefix to console message --- html/src/components/terminal/index.tsx | 10 +++++----- src/index.html | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/html/src/components/terminal/index.tsx b/html/src/components/terminal/index.tsx index 0c606e6..4f26257 100644 --- a/html/src/components/terminal/index.tsx +++ b/html/src/components/terminal/index.tsx @@ -110,7 +110,7 @@ export default class Xterm extends Component { @bind private onSocketOpen() { - console.log('Websocket connection opened'); + console.log('[ttyd] Websocket connection opened'); const { socket, textEncoder, fitAddon } = this; socket.send(textEncoder.encode(JSON.stringify({AuthToken: ''}))); @@ -119,7 +119,7 @@ export default class Xterm extends Component { @bind private onSocketClose(event: CloseEvent) { - console.log('Websocket connection closed with code: ' + event.code); + console.log('[ttyd] websocket connection closed with code: ' + event.code); const { overlayAddon, openTerminal, autoReconnect } = this; overlayAddon.showOverlay('Connection Closed', null); @@ -154,16 +154,16 @@ export default class Xterm extends Component { case Command.SET_PREFERENCES: const preferences = JSON.parse(textDecoder.decode(data.buffer)); Object.keys(preferences).forEach((key) => { - console.log('Setting ' + key + ': ' + preferences[key]); + console.log('[ttyd] setting ' + key + ': ' + preferences[key]); terminal.setOption(key, preferences[key]); }); break; case Command.SET_RECONNECT: this.autoReconnect = parseInt(textDecoder.decode(data.buffer)); - console.log('Enabling reconnect: ' + this.autoReconnect + ' seconds'); + console.log('[ttyd] enabling reconnect: ' + this.autoReconnect + ' seconds'); break; default: - console.warn('Unknown command: ' + cmd); + console.warn('[ttyd] unknown command: ' + cmd); break; } } diff --git a/src/index.html b/src/index.html index d15274c..b56c32f 100644 --- a/src/index.html +++ b/src/index.html @@ -1 +1 @@ -ttyd - Terminal \ No newline at end of file +ttyd - Terminal \ No newline at end of file -- 2.43.4