Files
summercms/admin/src/App.vue
Jakub Zych 291b18fb1e feat(boardwalk): expose the admin build id and show a reload banner when a new build is deployed (quick-261028-rqb)
- boardwalk.BuildID hashes the dist tree plus the binary's build info once
  per handler; X-Summer-Build on every response, {prefix}/build.json and the
  summer-admin-build meta carry it
- the SPA reads the booted build, re-checks on focus, visibility and every
  5 minutes, and shows UpdateBanner on a different build
2026-10-28 21:19:36 +01:00

31 lines
1.1 KiB
Vue

<script setup lang="ts">
import { computed, watchEffect } from 'vue'
import { RouterView, useRoute } from 'vue-router'
import { documentTitleForRoute } from './app/pageTitle'
import AppShell from './components/shell/AppShell.vue'
import UpdateBanner from './components/ui/UpdateBanner.vue'
import { remountRevision } from './state/useRemount'
const route = useRoute()
const inShell = computed(() => route.meta.shell === true)
watchEffect(() => {
document.title = documentTitleForRoute(route)
})
</script>
<template>
<!-- Keyed by path, not full path: a new controller or record remounts its
view, while list query changes (search, sort, page) keep it. The
remount revision is part of the key, so a view can remount itself in
place (Create and new). The new-version banner sits outside the
v-if, so it also shows on the login screen. -->
<AppShell v-if="inShell">
<RouterView v-slot="{ Component, route: current }">
<component :is="Component" :key="`${current.path}#${remountRevision}`" />
</RouterView>
</AppShell>
<RouterView v-else />
<UpdateBanner />
</template>