From: Shuanglei Tao Date: Sat, 15 Jun 2019 01:24:19 +0000 (+0800) Subject: html: restore prefix to console message X-Git-Url: http://git.prime8.dev/?a=commitdiff_plain;h=37ab5e937f874f089b46f5475afc5d385a85e6ee;p=ttyd.git html: restore prefix to console message --- 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