From c8e981500bdce6eea9a768ba21c6030b6319ceb4 Mon Sep 17 00:00:00 2001 From: Shuanglei Tao Date: Wed, 15 May 2019 20:37:14 +0800 Subject: [PATCH] html: add ttyd prefix to console log --- html/js/app.js | 10 +++++----- src/index.html | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/html/js/app.js b/html/js/app.js index ff18f70..d17284d 100644 --- a/html/js/app.js +++ b/html/js/app.js @@ -238,7 +238,7 @@ var openWs = function() { ws.binaryType = 'arraybuffer'; ws.onopen = function(event) { - console.log('Websocket connection opened'); + console.log('[ttyd] websocket opened'); wsError = false; sendMessage(JSON.stringify({AuthToken: authToken})); @@ -329,22 +329,22 @@ var openWs = function() { case '2': var preferences = JSON.parse(textDecoder.decode(data)); Object.keys(preferences).forEach(function(key) { - console.log('Setting ' + key + ': ' + preferences[key]); + console.log('[ttyd] xterm option: ' + key + '=' + preferences[key]); term.setOption(key, preferences[key]); }); break; case '3': autoReconnect = JSON.parse(textDecoder.decode(data)); - console.log('Enabling reconnect: ' + autoReconnect + ' seconds'); + console.log('[ttyd] reconnect: ' + autoReconnect + ' seconds'); break; default: - console.log('Unknown command: ' + cmd); + console.log('[ttyd] unknown command: ' + cmd); break; } }; ws.onclose = function(event) { - console.log('Websocket connection closed with code: ' + event.code); + console.log('[ttyd] websocket closed, code: ' + event.code); if (term) { term.off('data'); term.off('resize'); diff --git a/src/index.html b/src/index.html index 9aceb81..7798c61 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