diff --git a/ui/app/components/NewVersion.vue b/ui/app/components/NewVersion.vue new file mode 100644 index 00000000..28be65a5 --- /dev/null +++ b/ui/app/components/NewVersion.vue @@ -0,0 +1,16 @@ + + + + + A New WebUI Version installed, please + click here + to reload the app. + + + + + diff --git a/ui/app/layouts/default.vue b/ui/app/layouts/default.vue index bf90e3c5..22456d01 100644 --- a/ui/app/layouts/default.vue +++ b/ui/app/layouts/default.vue @@ -1,5 +1,6 @@ + @@ -361,4 +362,19 @@ const openMenu = (e: MouseEvent) => { elm?.classList.toggle('is-active') } +const useVersionUpdate = () => { + const newVersionIsAvailable = ref(false) + const nuxtApp = useNuxtApp() + nuxtApp.hooks.addHooks({ + 'app:manifest:update': () => { + newVersionIsAvailable.value = true + } + }); + + return { + newVersionIsAvailable: readonly(newVersionIsAvailable), + } +} +const { newVersionIsAvailable } = useVersionUpdate() + diff --git a/ui/nuxt.config.ts b/ui/nuxt.config.ts index 1fa82efc..e3d37048 100644 --- a/ui/nuxt.config.ts +++ b/ui/nuxt.config.ts @@ -76,5 +76,8 @@ export default defineNuxtConfig({ } }, telemetry: false, - compatibilityDate: "2024-07-13", + compatibilityDate: "2025-08-03", + experimental: { + checkOutdatedBuildInterval: 1000 * 60 * 60, + } })