summaryrefslogtreecommitdiff
path: root/addons/web
diff options
context:
space:
mode:
authorHitesh Trivedi <htr@openerp.com>2014-12-18 14:47:49 +0530
committerRichard Mathot <rim@odoo.com>2015-02-20 16:45:48 +0100
commit4cdc19198ee540299f69b76d5b183464d3ee3579 (patch)
treec6a46cb0c4f06a92f4bd116f224ad95861763f8f /addons/web
parent069e2be87d8250d364711b01912f34b7261ea0ba (diff)
[IMP] web: cleaner indicator when connection get lost
Diffstat (limited to 'addons/web')
-rw-r--r--addons/web/static/src/css/base.css13
-rw-r--r--addons/web/static/src/css/base.sass13
-rw-r--r--addons/web/static/src/js/chrome.js16
3 files changed, 42 insertions, 0 deletions
diff --git a/addons/web/static/src/css/base.css b/addons/web/static/src/css/base.css
index 4b2ff673f29..bf13ccdb012 100644
--- a/addons/web/static/src/css/base.css
+++ b/addons/web/static/src/css/base.css
@@ -35,6 +35,19 @@
border: 0;
}
+.oe_indicator{
+ z-index: 99999;
+ position: absolute;
+ top: 10px;
+ display: inline-block;
+ color: white;
+ background: #a24689;
+ padding: 6px 16px;
+ border-radius: 4px;
+ box-shadow: 0 0 1px black;
+ left: 40%;
+}
+
.oe_notification {
z-index: 1600;
}
diff --git a/addons/web/static/src/css/base.sass b/addons/web/static/src/css/base.sass
index 12741d7675c..368fc53e5fb 100644
--- a/addons/web/static/src/css/base.sass
+++ b/addons/web/static/src/css/base.sass
@@ -144,6 +144,19 @@ $sheet-padding: 16px
border: 0
// Notifications {{{
+
+.oe_indicator
+ z-index: 99999
+ position: absolute
+ top: 10px
+ display: inline-block
+ color: white
+ background: #a24689
+ padding: 6px 16px
+ border-radius: 4px
+ box-shadow: 0 0 1px black
+ left: 40%
+
.oe_notification
z-index: 1600
diff --git a/addons/web/static/src/js/chrome.js b/addons/web/static/src/js/chrome.js
index 3ef2dc5d433..8eabafb5f2d 100644
--- a/addons/web/static/src/js/chrome.js
+++ b/addons/web/static/src/js/chrome.js
@@ -252,6 +252,22 @@ instance.web.CrashManager = instance.web.Class.extend({
if (!this.active) {
return;
}
+ if (error.code == -32098) {
+ $.blockUI({ message: '' , overlayCSS: {'z-index': 9999, backgroundColor: '#FFFFFF', opacity: 0.0, cursor: 'wait'}});
+ var $indicator = $('<div class="oe_indicator">' + _t("Trying to reconnect... ") + '<i class="fa fa-refresh fa-spin"></i></div>');
+ $indicator.prependTo("body");
+ var timeinterval = setInterval(function(){
+ openerp.jsonRpc('/web/webclient/version_info').then(function() {
+ clearInterval(timeinterval);
+ $indicator.html(_t("You are back online"));
+ $indicator.delay(2000).fadeOut('slow',function(){
+ $indicator.remove();
+ });
+ $.unblockUI();
+ });
+ }, 2000);
+ return;
+ }
var handler = instance.web.crash_manager_registry.get_object(error.data.name, true);
if (handler) {
new (handler)(this, error).display();