feat : ajout du numéro de version de l'application auth/default layout

This commit is contained in:
tristan
2026-02-06 11:52:45 +01:00
parent 0e905bfcbe
commit c010bdc262
8 changed files with 58 additions and 16 deletions
+8
View File
@@ -3,3 +3,11 @@
<NuxtPage />
</NuxtLayout>
</template>
<script setup lang="ts">
const { load } = useAppVersion()
onMounted(() => {
load()
})
</script>
+17
View File
@@ -0,0 +1,17 @@
export const useAppVersion = () => {
const api = useApi()
const version = useState<string | null>('app-version', () => null)
const load = async () => {
if (version.value) {
return version.value
}
const response = await api.get<{ version: string }>('version', {}, {
toast: false
})
version.value = response.version
return version.value
}
return { version, load }
}
+4
View File
@@ -100,6 +100,9 @@
<main class="mx-auto w-full max-w-[1280px] pb-0">
<slot/>
</main>
<footer class="w-full mt-8 bg-primary-500 p-6">
<p class="font-bold text-white text-right">v{{ version }}</p>
</footer>
</div>
</template>
@@ -109,6 +112,7 @@ import { useAuthStore } from '~/stores/auth'
const route = useRoute()
const auth = useAuthStore()
const isMenuOpen = ref(false)
const { version } = useAppVersion()
const closeMenu = () => {
isMenuOpen.value = false
+3 -1
View File
@@ -46,7 +46,8 @@
>
Connexion
</button>
</form>
<p class="font-bold">v{{ version }}</p>
</form>
</div>
</template>
@@ -57,6 +58,7 @@ import { useAuthStore } from '~/stores/auth'
const router = useRouter()
const auth = useAuthStore()
const { version } = useAppVersion()
definePageMeta({
layout: 'auth'