diff --git a/package.json b/package.json index 578d404..232f80d 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "Item", - "version": "2.4.10-SNAPSHOT", + "version": "3.0.0-SNAPSHOT", "scripts": { "dev": "vite", "build": "vite build", @@ -13,6 +13,7 @@ "pinia": "^2.1.7", "roboto-fontface": "*", "vue": "^3.4.26", + "vue-breakpoints": "^1.1.0", "vue-i18n": "^9.13.1", "vue-router": "^4.3.2", "vuetify": "^3.6.8" diff --git a/src/App.vue b/src/App.vue index 6f6973a..7b67520 100644 --- a/src/App.vue +++ b/src/App.vue @@ -1,8 +1,8 @@ - +onMounted(async () => { + try { + const version = await itemService.getApplicationVersion() + backVersion.value = version.data.BACKVERSION + } catch (error) { + console.error('Erreur lors de la récupération de la version de l\'application :', error) + } +}) + +const getHealthOfServices = async () => { + try { + const response = await itemService.getHealthOfServices() + console.log('Response:', response) + + if (response.data) { + console.log('Response Data:', response.data) + healthServices.value = response.data + } else { + console.warn('La réponse ne contient pas de propriété "data".') + } + + console.log('Health Services:', healthServices.value) + } catch (error) { + healthServices.value = [{ + 'STATUT CBS':false, + 'STATUT BASE_XML':false, + 'STATUT BASE_ITEM':false + }] + console.error('Erreur lors de la récupération des statuts des services :', error) + } +} + diff --git a/src/components/Structure/Header.vue b/src/components/Structure/Header.vue index 1c487bc..caebf38 100644 --- a/src/components/Structure/Header.vue +++ b/src/components/Structure/Header.vue @@ -54,7 +54,7 @@ diff --git a/src/router/index.js b/src/router/index.js index f9457e2..d2628af 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -1,17 +1,19 @@ -import { createRouter, createWebHistory } from 'vue-router'; +import { createRouter, createWebHistory } from 'vue-router' import Login from '@/views/Utilisateur/Login.vue' import ExempTable from '@/views/Exemplarisation/ExempTable.vue' import ModifTable from '@/views/Modification/ModifTable.vue' import RecouvTable from '@/views/Recouvrement/RecouvTable.vue' -import ModifSteps from '@/views/Modification/ModifSteps.vue'; -import RecouvSteps from '@/views/Recouvrement/RecouvSteps.vue'; -import ExempSteps from '@/views/Exemplarisation/ExempSteps.vue'; +import ModifSteps from '@/views/Modification/ModifSteps.vue' +import RecouvSteps from '@/views/Recouvrement/RecouvSteps.vue' +import ExempSteps from '@/views/Exemplarisation/ExempSteps.vue' import SuppSteps from '@/views/Suppression/SuppSteps.vue' -import Accueil from '@/views/Accueil.vue'; -import ModificationEmail from '@/views/Utilisateur/ModificationEmail.vue'; -import demandesService from '@/service/DemandesService' +import Accueil from '@/views/Accueil.vue' +import ModificationEmail from '@/views/Utilisateur/ModificationEmail.vue' +import itemService from '@/service/DemandesService' import {useAuthStore} from '@/store/authStore' -import SuppTable from "@/views/Suppression/SuppTable.vue"; +import SuppTable from "@/views/Suppression/SuppTable.vue" +import Donnees from "@/views/Informations/DonneesPersonnelles.vue" +import Mentions from "@/views/Informations/MentionsLegales.vue" const routes = [ { @@ -37,6 +39,18 @@ const routes = [ component: Accueil, meta: { requiresAuth: true } }, + { + path: '/donnees', + name: 'donnees', + component: Donnees, + meta: { requiresAuth: false } + }, + { + path: '/mentions', + name: 'mentions', + component: Mentions, + meta: { requiresAuth: false } + }, { path: '/premiere-connexion', name: 'premiere-connexion', @@ -145,17 +159,17 @@ router.beforeEach(async (to, from, next) => { if (requiresAuth) { if (authStore.isAuthenticated) { try { - const valid = await demandesService.checkToken(); + const valid = await itemService.checkToken(); if (valid.data) { next(); } else { console.error('Token invalide auprès du serveur'); - demandesService.logout(); + itemService.logout(); next('/identification'); } } catch (error) { console.error(error); - demandesService.logout(); + itemService.logout(); next('/identification'); } } else { diff --git a/src/service/DemandesService.js b/src/service/DemandesService.js index 1ddcbb8..088a2fe 100644 --- a/src/service/DemandesService.js +++ b/src/service/DemandesService.js @@ -1,7 +1,7 @@ import axios from 'axios' import { useAuthStore } from '@/store/authStore' -export class DemandesService { +export class ItemService { constructor() { this.client = axios.create({ baseURL: import.meta.env.VITE_API_URL @@ -158,6 +158,14 @@ export class DemandesService { getEtatsDemande(){ return this.client.get('etatsDemande'); } + + getApplicationVersion(){ + return this.client.get('applicationDetails'); + } + + getHealthOfServices(){ + return this.client.get('applicationStatutServices') + } } -export default new DemandesService() +export default new ItemService() diff --git a/src/views/Exemplarisation/ExempSteps.vue b/src/views/Exemplarisation/ExempSteps.vue index b5a2d78..e289357 100644 --- a/src/views/Exemplarisation/ExempSteps.vue +++ b/src/views/Exemplarisation/ExempSteps.vue @@ -104,7 +104,7 @@