feat(server): /api/info aggregator + frontend version footer (#40)
Some checks failed
CI/CD Pipeline / Build Docker Cache (push) Successful in 9s
CI/CD Pipeline / CI Pipeline (push) Failing after 4m48s
CI/CD Pipeline / Trigger Docker Push (push) Has been skipped

Co-authored-by: Gabriel Radureau <arcodange@gmail.com>
Co-committed-by: Gabriel Radureau <arcodange@gmail.com>
This commit was merged in pull request #40.
This commit is contained in:
2026-05-05 08:29:26 +02:00
committed by arcodange
parent 4a3f1bb138
commit a2beadc458
16 changed files with 587 additions and 1 deletions

View File

@@ -0,0 +1,13 @@
<script setup lang="ts">
import AppFooterView, { type AppInfo } from './AppFooterView.vue'
// Wrapper: handles data fetching, delegates rendering to AppFooterView.
// Separation of concerns (SRP) - same pattern as HealthDashboard / HealthDashboardView.
// server: false → fetch client-side only. Avoids SSR fetching through the dev proxy
// (which can fail in some local setups), and lets Playwright route mocks apply.
const { data, pending, error } = useFetch<AppInfo>('/api/info', { server: false })
</script>
<template>
<AppFooterView :data="data" :pending="pending" :error="error" />
</template>

View File

@@ -0,0 +1,45 @@
<script setup lang="ts">
import { humaniseUptime } from '~/utils/uptime'
export interface AppInfo {
version: string
commit_short: string
build_date: string
uptime_seconds: number
cache_enabled: boolean
healthz_status: string
}
defineProps<{
data: AppInfo | null | undefined
pending: boolean
error: { message: string } | null | undefined
}>()
</script>
<template>
<footer data-testid="app-footer">
<p v-if="pending" data-testid="app-footer-pending">v?</p>
<p v-else-if="error" data-testid="app-footer-error">v? · info unavailable</p>
<p v-else-if="data" data-testid="app-footer-info">
<span data-testid="app-footer-version">v{{ data.version }}</span>
<span> · commit </span>
<span data-testid="app-footer-commit">{{ data.commit_short }}</span>
<span> · uptime </span>
<span data-testid="app-footer-uptime">{{ humaniseUptime(data.uptime_seconds) }}</span>
</p>
</footer>
</template>
<style scoped>
footer {
border-top: 1px solid #ccc;
padding: 0.5rem 1rem;
font-size: 0.85rem;
color: #555;
text-align: center;
}
footer p {
margin: 0;
}
</style>