versioning

This commit is contained in:
2025-12-14 23:20:51 -05:00
parent 596cb97a28
commit 68a4f1800c
5 changed files with 81 additions and 4 deletions

View File

@@ -1,6 +1,6 @@
<script setup lang="ts">
import { useRouter, useRoute } from 'vue-router'
import { computed } from 'vue'
import { computed, ref, onMounted } from 'vue'
import LoginButton from '../components/LoginButton.vue'
const router = useRouter()
@@ -23,6 +23,20 @@ const showBack = computed(
route.name === 'NotificationView'
),
)
// Version fetching
const appVersion = ref('')
onMounted(async () => {
try {
const resp = await fetch('/api/version')
if (resp.ok) {
const data = await resp.json()
appVersion.value = data.version || ''
}
} catch (e) {
appVersion.value = ''
}
})
</script>
<template>
@@ -142,6 +156,8 @@ const showBack = computed(
<main class="main-content">
<router-view />
</main>
<div v-if="appVersion" class="app-version">v{{ appVersion }}</div>
</div>
</template>
@@ -251,6 +267,19 @@ const showBack = computed(
align-self: start;
}
.app-version {
position: fixed;
right: 18px;
bottom: 12px;
font-size: 0.92rem;
color: #cbd5e1; /* Brighter slate-200 */
opacity: 0.85;
z-index: 100;
pointer-events: none;
user-select: none;
font-family: monospace;
}
@media (max-width: 480px) {
.back-btn {
padding: 0.45rem 0.75rem;