diff --git a/src/App.vue b/src/App.vue index e9174039b758f0bc6c03b4b5718130cea5ccae55..6d3a7930bb8d0b7c66b35b6abb1191880b440dcb 100644 --- a/src/App.vue +++ b/src/App.vue @@ -219,7 +219,9 @@ export default { checkVersion() { SystemInfoService.getAlerts().then((alerts) => { this.$store.commit('updateSystemAlerts', alerts.data) + this.$store.commit('setOnline', true) }).catch(() => { + this.$store.commit('setOnline', false) }) // Fail silently SystemInfoService.getMaintenance(this.$store.state).then((items) => { const alerts = [] diff --git a/src/components/Navbar.vue b/src/components/Navbar.vue index 4dc7158f79516caa7ed6877049c1248ece081d91..19c69a97c3a5bf39ead580a21941fb928be157c7 100644 --- a/src/components/Navbar.vue +++ b/src/components/Navbar.vue @@ -8,6 +8,10 @@ src="/logo.webp"/> <img v-else class="d-inline-block align-top scc-img" alt="NETTVS" src="@/assets/img/netvs_logo.png"/> </b-navbar-brand> + <b-nav-text class="ml-3 text-danger" v-if="!$store.state.netvs_online"> + <netvs-icon size="1x" class="pr-1 text-danger" :beat_fade="true" icon="offline"/> + {{ $t('system.offline') }} + </b-nav-text> <template v-if="$store.state.impersonate_user"> <b-nav-text class="ml-3"> <netvs-icon size="1x" class="pr-1 text-danger" :beat_fade="true" icon="warning"/> diff --git a/src/icons/NETVSIcon.vue b/src/icons/NETVSIcon.vue index 55ee7e9f77c3675edac60afd7dd1220225991c0e..502291238464a9c3665b5c8addd6146ca656c8cc 100644 --- a/src/icons/NETVSIcon.vue +++ b/src/icons/NETVSIcon.vue @@ -14,6 +14,7 @@ export default { data() { return { map: { + offline: 'fa-solid fa-link-slash', home: 'fa-solid fa-home', dnsvs: 'fa-solid fa-signs-post', record: 'fa-solid fa-signs-post', diff --git a/src/locales/de.json b/src/locales/de.json index 2f0e329f1eb4896a6b8695ea17159c047871baa7..ec83b1f73a0c3799052d87c4ade8791e7bf48453 100644 --- a/src/locales/de.json +++ b/src/locales/de.json @@ -423,6 +423,7 @@ } }, "system": { + "offline": "NETVS Offline", "OE": "OE", "account": "Account", "accounts_tokens": "Accounts & Tokens", diff --git a/src/locales/en.json b/src/locales/en.json index c23eaf05a7994ac05c2d5549313bdfa28ed3a41a..f32c04be060a0c3ae4c32ccb9821ec7e2f6e5c76 100644 --- a/src/locales/en.json +++ b/src/locales/en.json @@ -420,6 +420,7 @@ } }, "system": { + "offline": "NETVS Offline", "OE": "OU", "account": "Account", "accounts_tokens": "Accounts & Tokens", diff --git a/src/vuex.js b/src/vuex.js index e585835600b92f669a9900c9e767d85518f99e29..cd447f6caa8fb3f605b13ba27437257ef8c9ed5d 100644 --- a/src/vuex.js +++ b/src/vuex.js @@ -32,6 +32,7 @@ function getTaListFromLocalStorage() { const NetvsVuex = new Vuex.Store({ state: { + netvs_online: true, current_api_version: null, home_grid: window.localStorage.getItem('home_grid') ? JSON.parse(window.localStorage.getItem('home_grid')) : true, refreshHandleGPK: null, @@ -219,6 +220,9 @@ const NetvsVuex = new Vuex.Store({ this.dispatch('refresh_session_info') } }, + setOnline(state, payload) { + state.netvs_online = payload + }, update_session_info(state, payload) { state.xup_perm = payload.xup_perm state.user = payload.user