diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/main/resources/TERMINAL/terminal.template b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/main/resources/TERMINAL/terminal.template index 004e8e273bd..4bff7944035 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/main/resources/TERMINAL/terminal.template +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/main/resources/TERMINAL/terminal.template @@ -87,11 +87,25 @@ if (user != null) { url = url + "?user.name=" + encodeURI(user); } + document.title = getQueryVariable("container"); console.log(url); var sock = new WebSocket(url); sock.addEventListener('open', function () { term.attach(sock, true, true); }); + sock.addEventListener('close', function(event) { + switch(event.code) { + case 1000: + term.write('Remote Connection closed.'); + break; + case 1008: + term.write('Remote Connection refused.'); + break; + case 1001: + term.write('Remote Connection going away.'); + break; + } + }); term.open(container); term.winptyCompatInit(); term.fit();