Add app version display in Footer and implement version API endpoint
Some checks failed
Code Analysis and Production Deploy / analyze (push) Successful in 2m49s
Code Analysis and Production Deploy / deploy-production (push) Has been skipped
Code Analysis and Production Deploy / deploy-test (push) Successful in 1m54s
Code Analysis and Production Deploy / analyze (pull_request) Failing after 11s
Code Analysis and Production Deploy / deploy-production (pull_request) Has been skipped
Code Analysis and Production Deploy / deploy-test (pull_request) Has been skipped
Some checks failed
Code Analysis and Production Deploy / analyze (push) Successful in 2m49s
Code Analysis and Production Deploy / deploy-production (push) Has been skipped
Code Analysis and Production Deploy / deploy-test (push) Successful in 1m54s
Code Analysis and Production Deploy / analyze (pull_request) Failing after 11s
Code Analysis and Production Deploy / deploy-production (pull_request) Has been skipped
Code Analysis and Production Deploy / deploy-test (pull_request) Has been skipped
- Updated Footer.vue to show the application version for logged-in users. - Added a new API endpoint to return the application version from package.json. - Enhanced code-analysis.yml to require package version changes for main PRs.
This commit is contained in:
@@ -6,6 +6,13 @@
|
||||
© {{ currentYear }} Harheimer TC 1954 e.V.
|
||||
</p>
|
||||
<div class="flex items-center space-x-6 text-sm relative">
|
||||
<span
|
||||
v-if="isLoggedIn && appVersion"
|
||||
class="text-xs text-gray-600"
|
||||
title="Version"
|
||||
>
|
||||
v{{ appVersion }}
|
||||
</span>
|
||||
<NuxtLink
|
||||
to="/impressum"
|
||||
class="text-gray-400 hover:text-primary-400 transition-colors"
|
||||
@@ -89,7 +96,7 @@
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ref, computed, onMounted, onUnmounted } from 'vue'
|
||||
import { ref, computed, onMounted, onUnmounted, watch } from 'vue'
|
||||
import { useRouter } from 'vue-router'
|
||||
import { User, ChevronUp } from 'lucide-vue-next'
|
||||
|
||||
@@ -97,11 +104,26 @@ const router = useRouter()
|
||||
const authStore = useAuthStore()
|
||||
const currentYear = new Date().getFullYear()
|
||||
const isMemberMenuOpen = ref(false)
|
||||
const appVersion = ref('')
|
||||
|
||||
// Reactive auth state from store
|
||||
const isLoggedIn = computed(() => authStore.isLoggedIn)
|
||||
// const isAdmin = computed(() => authStore.isAdmin)
|
||||
|
||||
const loadAppVersion = async () => {
|
||||
if (!isLoggedIn.value) {
|
||||
appVersion.value = ''
|
||||
return
|
||||
}
|
||||
|
||||
try {
|
||||
const response = await $fetch('/api/app/version')
|
||||
appVersion.value = response.version || ''
|
||||
} catch (_error) {
|
||||
appVersion.value = ''
|
||||
}
|
||||
}
|
||||
|
||||
const toggleMemberMenu = () => {
|
||||
isMemberMenuOpen.value = !isMemberMenuOpen.value
|
||||
}
|
||||
@@ -116,6 +138,10 @@ onMounted(() => {
|
||||
authStore.checkAuth()
|
||||
})
|
||||
|
||||
watch(isLoggedIn, () => {
|
||||
loadAppVersion()
|
||||
}, { immediate: true })
|
||||
|
||||
// Close menu when clicking outside
|
||||
const handleClickOutside = (event) => {
|
||||
if (!event.target.closest('.relative')) {
|
||||
|
||||
Reference in New Issue
Block a user