From fd0759e4736aee3c3c3f6c91fdef053ffbdc09af Mon Sep 17 00:00:00 2001 From: Ben Ford Date: Thu, 10 Dec 2015 08:53:04 -0800 Subject: [PATCH 1/4] Add a reconnect button on logout Prior to this, the only way to return to a session after logging out or login timeout was to manually reload the page. This gives you a nice button to do it for you. Ping @joshsamuelson --- app.js | 3 ++- public/wetty/index.html | 15 +++++++++++++++ public/wetty/wetty.js | 5 +++++ 3 files changed, 22 insertions(+), 1 deletion(-) diff --git a/app.js b/app.js index d00e6a4..0cc895b 100644 --- a/app.js +++ b/app.js @@ -120,7 +120,8 @@ io.on('connection', function(socket){ socket.emit('output', data); }); term.on('exit', function(code) { - console.log((new Date()) + " PID=" + term.pid + " ENDED") + console.log((new Date()) + " PID=" + term.pid + " ENDED"); + socket.emit('logout'); }); socket.on('resize', function(data) { term.resize(data.col, data.row); diff --git a/public/wetty/index.html b/public/wetty/index.html index f28eb79..ddd0f70 100644 --- a/public/wetty/index.html +++ b/public/wetty/index.html @@ -14,6 +14,20 @@ width: 100%; margin: 0px; } + #overlay { + position: absolute; + height: 100%; + width: 100%; + background-color: rgba(0,0,0,0.75);; + display: none; + } + #overlay input { + display: block; + margin: auto; + position: relative; + top: 50%; + transform: translateY(-50%); + } #terminal { display: block; position: relative; @@ -24,6 +38,7 @@ +
diff --git a/public/wetty/wetty.js b/public/wetty/wetty.js index d7068a8..96048e5 100644 --- a/public/wetty/wetty.js +++ b/public/wetty/wetty.js @@ -59,6 +59,11 @@ socket.on('output', function(data) { term.io.writeUTF16(data); }); +socket.on('logout', function(data) { + console.log("user logout"); + document.getElementById("overlay").style.display = "block"; +}); + socket.on('disconnect', function() { console.log("Socket.io connection closed"); }); From 6ceef0611b499401601aea039434b6e5f9f6c7a0 Mon Sep 17 00:00:00 2001 From: Ben Ford Date: Tue, 5 Jan 2016 08:34:06 -0800 Subject: [PATCH 2/4] Forgot the z-index --- public/wetty/index.html | 1 + 1 file changed, 1 insertion(+) diff --git a/public/wetty/index.html b/public/wetty/index.html index ddd0f70..95c0566 100644 --- a/public/wetty/index.html +++ b/public/wetty/index.html @@ -20,6 +20,7 @@ width: 100%; background-color: rgba(0,0,0,0.75);; display: none; + z-index: 100; } #overlay input { display: block; From 954a8287f883f1b1aa2c1fdfa9ea490c150b9ed9 Mon Sep 17 00:00:00 2001 From: Ben Ford Date: Tue, 5 Jan 2016 12:13:48 -0800 Subject: [PATCH 3/4] Whoa, there's two copies? Not sure why there are two index.html files, but... --- public/index.html | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/public/index.html b/public/index.html index f28eb79..ddd0f70 100644 --- a/public/index.html +++ b/public/index.html @@ -14,6 +14,20 @@ width: 100%; margin: 0px; } + #overlay { + position: absolute; + height: 100%; + width: 100%; + background-color: rgba(0,0,0,0.75);; + display: none; + } + #overlay input { + display: block; + margin: auto; + position: relative; + top: 50%; + transform: translateY(-50%); + } #terminal { display: block; position: relative; @@ -24,6 +38,7 @@ +
From 33535fde9b90928bdaf28e9629d9fa8bb35dbb56 Mon Sep 17 00:00:00 2001 From: Ben Ford Date: Tue, 5 Jan 2016 08:34:06 -0800 Subject: [PATCH 4/4] Forgot the z-index --- public/wetty/index.html | 1 + 1 file changed, 1 insertion(+) diff --git a/public/wetty/index.html b/public/wetty/index.html index ddd0f70..95c0566 100644 --- a/public/wetty/index.html +++ b/public/wetty/index.html @@ -20,6 +20,7 @@ width: 100%; background-color: rgba(0,0,0,0.75);; display: none; + z-index: 100; } #overlay input { display: block;