From ed8d71c7cd5a8c3e4eed9ea101abd2467e967582 Mon Sep 17 00:00:00 2001 From: Paul Fauchon Date: Sun, 21 Jul 2019 14:06:39 +0800 Subject: [PATCH] version 2019.07.1 remove full screen page when connection to socket stops, instead it will retry to connect --- models/pom.xml | 2 +- notifications/pom.xml | 2 +- plugins/couchpotato/pom.xml | 2 +- plugins/docker/pom.xml | 2 +- plugins/dockercompose/pom.xml | 2 +- plugins/dynamicdns/pom.xml | 2 +- plugins/googlepubliccalendar/pom.xml | 2 +- plugins/harddisk/pom.xml | 2 +- plugins/kvm/pom.xml | 2 +- plugins/logreader/pom.xml | 2 +- plugins/mma/pom.xml | 2 +- plugins/networkmonitor/pom.xml | 2 +- plugins/pihole/pom.xml | 2 +- plugins/plex/pom.xml | 2 +- plugins/pom.xml | 2 +- plugins/portmapper/pom.xml | 2 +- plugins/sonarrtv/pom.xml | 2 +- plugins/spotify/pom.xml | 2 +- plugins/systeminfo/pom.xml | 2 +- plugins/transmission/pom.xml | 2 +- plugins/unifi/pom.xml | 2 +- pom.xml | 2 +- updater/pom.xml | 2 +- web/pom.xml | 10 +++-- web/src/main/java/assets/js/websocket.js | 20 ++++++++-- web/src/main/java/assets/less/main.less | 41 ++++++++------------ web/src/main/resources/templates/layout.jade | 9 ++--- 27 files changed, 66 insertions(+), 60 deletions(-) diff --git a/models/pom.xml b/models/pom.xml index 53353109..7d67152d 100644 --- a/models/pom.xml +++ b/models/pom.xml @@ -6,7 +6,7 @@ com.ftpix.homedash homedash - 2019.01.3 + 2019.07.1 models diff --git a/notifications/pom.xml b/notifications/pom.xml index 3c3c2a62..42252d27 100644 --- a/notifications/pom.xml +++ b/notifications/pom.xml @@ -4,7 +4,7 @@ homedash com.ftpix.homedash - 2019.01.3 + 2019.07.1 4.0.0 diff --git a/plugins/couchpotato/pom.xml b/plugins/couchpotato/pom.xml index 88316334..d0ab003b 100644 --- a/plugins/couchpotato/pom.xml +++ b/plugins/couchpotato/pom.xml @@ -7,7 +7,7 @@ com.ftpix.homedash.plugins plugins - 2019.01.3 + 2019.07.1 couchpotato diff --git a/plugins/docker/pom.xml b/plugins/docker/pom.xml index ad724be7..5d78e82c 100644 --- a/plugins/docker/pom.xml +++ b/plugins/docker/pom.xml @@ -7,7 +7,7 @@ com.ftpix.homedash.plugins plugins - 2019.01.3 + 2019.07.1 docker diff --git a/plugins/dockercompose/pom.xml b/plugins/dockercompose/pom.xml index 0e219d6e..10eb04d7 100644 --- a/plugins/dockercompose/pom.xml +++ b/plugins/dockercompose/pom.xml @@ -5,7 +5,7 @@ plugins com.ftpix.homedash.plugins - 2019.01.3 + 2019.07.1 4.0.0 diff --git a/plugins/dynamicdns/pom.xml b/plugins/dynamicdns/pom.xml index 8d355046..5464d53c 100644 --- a/plugins/dynamicdns/pom.xml +++ b/plugins/dynamicdns/pom.xml @@ -7,7 +7,7 @@ com.ftpix.homedash.plugins plugins - 2019.01.3 + 2019.07.1 dynamicdns diff --git a/plugins/googlepubliccalendar/pom.xml b/plugins/googlepubliccalendar/pom.xml index a6bbcbe1..f45626bf 100644 --- a/plugins/googlepubliccalendar/pom.xml +++ b/plugins/googlepubliccalendar/pom.xml @@ -7,7 +7,7 @@ com.ftpix.homedash.plugins plugins - 2019.01.3 + 2019.07.1 googlepubliccalendar googlepubliccalendar diff --git a/plugins/harddisk/pom.xml b/plugins/harddisk/pom.xml index f72a9cda..62a9d2ac 100644 --- a/plugins/harddisk/pom.xml +++ b/plugins/harddisk/pom.xml @@ -7,7 +7,7 @@ com.ftpix.homedash.plugins plugins - 2019.01.3 + 2019.07.1 harddisk diff --git a/plugins/kvm/pom.xml b/plugins/kvm/pom.xml index c18fd851..7562c7c5 100644 --- a/plugins/kvm/pom.xml +++ b/plugins/kvm/pom.xml @@ -5,7 +5,7 @@ plugins com.ftpix.homedash.plugins - 2019.01.3 + 2019.07.1 4.0.0 diff --git a/plugins/logreader/pom.xml b/plugins/logreader/pom.xml index 2107a2fd..63860a17 100644 --- a/plugins/logreader/pom.xml +++ b/plugins/logreader/pom.xml @@ -5,7 +5,7 @@ plugins com.ftpix.homedash.plugins - 2019.01.3 + 2019.07.1 4.0.0 diff --git a/plugins/mma/pom.xml b/plugins/mma/pom.xml index 1a063480..af88641b 100644 --- a/plugins/mma/pom.xml +++ b/plugins/mma/pom.xml @@ -7,7 +7,7 @@ com.ftpix.homedash.plugins plugins - 2019.01.3 + 2019.07.1 mma mma diff --git a/plugins/networkmonitor/pom.xml b/plugins/networkmonitor/pom.xml index 4fd87239..c777e3a4 100644 --- a/plugins/networkmonitor/pom.xml +++ b/plugins/networkmonitor/pom.xml @@ -7,7 +7,7 @@ com.ftpix.homedash.plugins plugins - 2019.01.3 + 2019.07.1 networkmonitor diff --git a/plugins/pihole/pom.xml b/plugins/pihole/pom.xml index 9ad735e6..0a85a3cd 100644 --- a/plugins/pihole/pom.xml +++ b/plugins/pihole/pom.xml @@ -7,7 +7,7 @@ com.ftpix.homedash.plugins plugins - 2019.01.3 + 2019.07.1 pihole pihole diff --git a/plugins/plex/pom.xml b/plugins/plex/pom.xml index 117657f3..e15e3d7d 100644 --- a/plugins/plex/pom.xml +++ b/plugins/plex/pom.xml @@ -7,7 +7,7 @@ com.ftpix.homedash.plugins plugins - 2019.01.3 + 2019.07.1 plex diff --git a/plugins/pom.xml b/plugins/pom.xml index fc4ea483..9c5d321a 100644 --- a/plugins/pom.xml +++ b/plugins/pom.xml @@ -6,7 +6,7 @@ homedash com.ftpix.homedash - 2019.01.3 + 2019.07.1 4.0.0 diff --git a/plugins/portmapper/pom.xml b/plugins/portmapper/pom.xml index 48f850a0..29651c21 100644 --- a/plugins/portmapper/pom.xml +++ b/plugins/portmapper/pom.xml @@ -7,7 +7,7 @@ com.ftpix.homedash.plugins plugins - 2019.01.3 + 2019.07.1 portmapper portmapper diff --git a/plugins/sonarrtv/pom.xml b/plugins/sonarrtv/pom.xml index 92b7072b..68dd2dd6 100644 --- a/plugins/sonarrtv/pom.xml +++ b/plugins/sonarrtv/pom.xml @@ -7,7 +7,7 @@ com.ftpix.homedash.plugins plugins - 2019.01.3 + 2019.07.1 sonarrtv diff --git a/plugins/spotify/pom.xml b/plugins/spotify/pom.xml index b5a18bb7..df9f3b8f 100644 --- a/plugins/spotify/pom.xml +++ b/plugins/spotify/pom.xml @@ -7,7 +7,7 @@ com.ftpix.homedash.plugins plugins - 2019.01.3 + 2019.07.1 spotify diff --git a/plugins/systeminfo/pom.xml b/plugins/systeminfo/pom.xml index 3d138a68..bb9428e6 100644 --- a/plugins/systeminfo/pom.xml +++ b/plugins/systeminfo/pom.xml @@ -7,7 +7,7 @@ com.ftpix.homedash.plugins plugins - 2019.01.3 + 2019.07.1 systeminfo diff --git a/plugins/transmission/pom.xml b/plugins/transmission/pom.xml index 9989166a..5664b1e6 100644 --- a/plugins/transmission/pom.xml +++ b/plugins/transmission/pom.xml @@ -7,7 +7,7 @@ com.ftpix.homedash.plugins plugins - 2019.01.3 + 2019.07.1 transmission transmission diff --git a/plugins/unifi/pom.xml b/plugins/unifi/pom.xml index 5fad7b3d..7ccde59b 100644 --- a/plugins/unifi/pom.xml +++ b/plugins/unifi/pom.xml @@ -7,7 +7,7 @@ com.ftpix.homedash.plugins plugins - 2019.01.3 + 2019.07.1 unifi unifi diff --git a/pom.xml b/pom.xml index dfe19d07..7de098c8 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ 4.0.0 com.ftpix.homedash homedash - 2019.01.3 + 2019.07.1 Archetype - homedash http://maven.apache.org pom diff --git a/updater/pom.xml b/updater/pom.xml index 85eebb95..53d32892 100644 --- a/updater/pom.xml +++ b/updater/pom.xml @@ -5,7 +5,7 @@ homedash com.ftpix.homedash - 2019.01.3 + 2019.07.1 4.0.0 diff --git a/web/pom.xml b/web/pom.xml index 848d7548..7b2878e3 100644 --- a/web/pom.xml +++ b/web/pom.xml @@ -7,7 +7,7 @@ com.ftpix.homedash homedash - 2019.01.3 + 2019.07.1 @@ -199,7 +199,7 @@ com.ftpix.homedash models - 2019.01.3 + 2019.07.1 @@ -373,7 +373,7 @@ 1.1.1 - fix issue #7 where the UI wouldn't load on windows JAR distribution + remove full screen overlay when connection to server is lost. Instead will try to reconnect. ${version} ${version} @@ -450,7 +450,9 @@ build -t - ${docker.image.name} + ${docker.image.name}:latest + -t + ${docker.image.name}:${version} . diff --git a/web/src/main/java/assets/js/websocket.js b/web/src/main/java/assets/js/websocket.js index 288ccd2c..56164136 100644 --- a/web/src/main/java/assets/js/websocket.js +++ b/web/src/main/java/assets/js/websocket.js @@ -2,21 +2,21 @@ * This file will handle all the websocket related stuff */ var ws; +var singleModuleSize = null; $(document).ready(function () { - $('#overlay .reload-page').click(function () { - location.reload(); - }); }); function initWebsocket() { + singleModuleSize = null; var protocol = (location.protocol === 'https:') ? 'wss://' : 'ws://'; ws = new WebSocket(protocol + window.location.host + '/ws'); try { ws.onmessage = onMessage; ws.onopen = function (e) { + $('#reconnecting-bar').removeClass('showing'); for (i = 0; i < MODULES.length; i++) { if (MODULES[i] != null && MODULES[i].onConnect != undefined) { MODULES[i].onConnect(); @@ -39,6 +39,8 @@ function initWebsocket() { function initSingleModuleWebSocket(size) { + singleModuleSize = size; + var protocol = (location.protocol === 'https:') ? 'wss://' : 'ws://'; ws = new WebSocket(protocol + window.location.host + '/ws-' + size); try { @@ -49,6 +51,7 @@ function initSingleModuleWebSocket(size) { } ws.onopen = function (e) { + $('#reconnecting-bar').removeClass('showing'); MODULE.onConnect(); MODULE.documentReady(size); sendMessage(MODULE.moduleId, "setModule", ""); @@ -152,8 +155,17 @@ var notificationTimeout; Display the overlay when the connection is off */ function showOfflineOverlay() { - $('#overlay').addClass('showing'); + console.log('reconnecting to socket'); + $('#reconnecting-bar').addClass('showing'); + setTimeout(function () { + if (singleModuleSize !== null) { + initSingleModuleWebSocket(singleModuleSize); + } else { + initWebsocket(); + } + }, 1000); } + /** * Show a success notification * @param message diff --git a/web/src/main/java/assets/less/main.less b/web/src/main/java/assets/less/main.less index 8da08189..eeecd9f7 100644 --- a/web/src/main/java/assets/less/main.less +++ b/web/src/main/java/assets/less/main.less @@ -115,44 +115,37 @@ body { } } -#overlay { +#reconnecting-bar { position: fixed; - background-color: white; + background-color: @accentColor; + color: white; z-index: 9001; - top: 0; left: 0; right: 0; - bottom: 0; + bottom: -60px; + height:50px; + + display:flex; + align-items: center; -webkit-transition: all @transition-speed !important; transition: all @transition-speed !important; + font-size: 20px; - @angle: -90deg; - -webkit-transform: rotateX(@angle); /* Safari */ - transform: rotateX(@angle); - - transform-origin: center top; - - padding-top: 50px; - p { - text-align: center; - + .message{ + flex-grow: 1; + margin: 0; } - .smiley { - color: @accentColor; - font-size: 150px; + .icon{ + margin: 0; + padding: 20px; } - .message { - font-size: 35px; - } } -#overlay.showing { - @angle: 0deg; - -webkit-transform: rotateX(@angle); /* Safari */ - transform: rotateX(@angle); +#reconnecting-bar.showing { + bottom: 0px; } // diff --git a/web/src/main/resources/templates/layout.jade b/web/src/main/resources/templates/layout.jade index 2279a811..9427c8f8 100644 --- a/web/src/main/resources/templates/layout.jade +++ b/web/src/main/resources/templates/layout.jade @@ -28,11 +28,10 @@ html(lang="en") .icon .message - #overlay - p.smiley :( - p.message Can't connect to the server - p - button.reload-page.btn.btn-primary Reload + #reconnecting-bar + p.icon + i.fa.fa-refresh.fa-spin + p.message Can't connect to the server, retrying #pages div.icons