From 18369f277f67aa1d9c4826a3f0a0c10b527916b3 Mon Sep 17 00:00:00 2001 From: Michael Jumper Date: Sun, 23 Mar 2014 18:34:30 -0700 Subject: [PATCH] GUAC-559: Notify when tunnel is disconnected. Ignore explicit disconnection status from Guacamole.Client. --- guacamole/src/main/webapp/client.xhtml | 6 ++++++ guacamole/src/main/webapp/scripts/client-ui.js | 9 +-------- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/guacamole/src/main/webapp/client.xhtml b/guacamole/src/main/webapp/client.xhtml index 417712d3b..d4bf76ead 100644 --- a/guacamole/src/main/webapp/client.xhtml +++ b/guacamole/src/main/webapp/client.xhtml @@ -141,6 +141,12 @@ GuacUI.Client.showError("Connection Error", message); }; + // Notify of disconnections (if not already notified of something else) + tunnel.onstatechange = function(state) { + if (state === Guacamole.Tunnel.State.CLOSED && !GuacUI.Client.visibleStatus) + GuacUI.Client.showStatus("Disconnected", "You have been disconnected. Reload the page to reconnect."); + }; + // Connect guac.connect(connect_string); diff --git a/guacamole/src/main/webapp/scripts/client-ui.js b/guacamole/src/main/webapp/scripts/client-ui.js index bd4f79153..21568a911 100644 --- a/guacamole/src/main/webapp/scripts/client-ui.js +++ b/guacamole/src/main/webapp/scripts/client-ui.js @@ -890,16 +890,9 @@ GuacUI.Client.attach = function(guac) { break; - // Disconnecting + // Disconnecting / disconnected are handled by tunnel instead case 4: - GuacUI.Client.showStatus(null, "Disconnecting..."); - GuacUI.Client.titlePrefix = "[Disconnecting...]"; - break; - - // Disconnected case 5: - GuacUI.Client.showStatus("Disconnected", "Guacamole has been manually disconnected. Reload the page to reconnect."); - GuacUI.Client.titlePrefix = "[Disconnected]"; break; // Unknown status code