From ec4b909f66c1ac5239d346a49c8f922f071f854c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gina=20H=C3=A4u=C3=9Fge?= Date: Sun, 13 Jan 2013 18:28:55 +0100 Subject: [PATCH] New wording and changed behaviour of the "server is offline" dialog --- printer_webui/static/js/ui.js | 12 +++++++++++- printer_webui/templates/index.html | 4 ++-- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/printer_webui/static/js/ui.js b/printer_webui/static/js/ui.js index 73125e16..9cd09790 100644 --- a/printer_webui/static/js/ui.js +++ b/printer_webui/static/js/ui.js @@ -598,10 +598,20 @@ function DataUpdater(connectionViewModel, printerStateViewModel, temperatureView } }) self._socket.on("disconnect", function() { - // if the updated fails to communicate with the backend, we interpret this as a missing backend + $("#offline_overlay_message").html( + "The server appears to be offline, at least I'm not getting any response from it. I'll try to reconnect " + + "automatically over the next couple of minutes, however you are welcome to try a manual reconnect " + + "anytime using the button below." + ); if (!$("#offline_overlay").is(":visible")) $("#offline_overlay").show(); }) + self._socket.on("reconnect_failed", function() { + $("#offline_overlay_message").html( + "The server appears to be offline, at least I'm not getting any response from it. I could not reconnect automatically, " + + "but you may try a manual reconnect using the button below." + ); + }) self._socket.on("history", function(data) { self.connectionViewModel.fromHistoryData(data); self.printerStateViewModel.fromHistoryData(data); diff --git a/printer_webui/templates/index.html b/printer_webui/templates/index.html index d311bb6f..29104785 100644 --- a/printer_webui/templates/index.html +++ b/printer_webui/templates/index.html @@ -268,9 +268,9 @@

Server is offline

-

+

The server appears to be offline, at least I'm not getting any response from it. I'll try to reconnect - automatically every 10 seconds, however you are welcome to try a manual reconnect + automatically over the next couple of minutes, however you are welcome to try a manual reconnect anytime using the button below.