diff --git a/lib/www/client/source/src/components/footer.vue b/lib/www/client/source/src/components/footer.vue index 13f32b6..3867dad 100644 --- a/lib/www/client/source/src/components/footer.vue +++ b/lib/www/client/source/src/components/footer.vue @@ -9,6 +9,9 @@ + mdi-lan-connect + mdi-lan-disconnect +
@@ -35,6 +38,7 @@ diff --git a/lib/www/client/source/src/main.js b/lib/www/client/source/src/main.js index 51da3fb..023f0c3 100644 --- a/lib/www/client/source/src/main.js +++ b/lib/www/client/source/src/main.js @@ -59,6 +59,7 @@ new Vue({ this.ws.addEventListener("open", (ev) => { console.log("WebSocket connection open", ev); + this.setServerConnectionState(true); }); this.ws.addEventListener("close", (ev) => { @@ -74,11 +75,12 @@ new Vue({ delete this.ws; this.ws = null; setTimeout( this.initWs, 60000 ); + this.setServerConnectionState(false); }); }, - ...mapMutations(['setServerEvent']) + ...mapMutations(['setServerEvent', 'setServerConnectionState']) }, diff --git a/lib/www/client/source/src/store/modules/notify/mutations.js b/lib/www/client/source/src/store/modules/notify/mutations.js index c148728..afe10c8 100644 --- a/lib/www/client/source/src/store/modules/notify/mutations.js +++ b/lib/www/client/source/src/store/modules/notify/mutations.js @@ -7,4 +7,8 @@ function clearServerEvent (state) { state.serverEvent = null; } -export default { setServerEvent, clearServerEvent }; +function setServerConnectionState (state, isConnected) { + state.serverConnected = !!isConnected; +} + +export default { setServerEvent, clearServerEvent, setServerConnectionState }; diff --git a/lib/www/client/source/src/store/modules/notify/state.js b/lib/www/client/source/src/store/modules/notify/state.js index 828e91d..e49d412 100644 --- a/lib/www/client/source/src/store/modules/notify/state.js +++ b/lib/www/client/source/src/store/modules/notify/state.js @@ -1,5 +1,6 @@ const state = () => ({ - serverEvent: null + serverEvent: null, + serverConnected: false }); export default state;