Add app version management, update checks, and periodic SW updates
ci/woodpecker/push/woodpecker Pipeline was successful
ci/woodpecker/pr/woodpecker Pipeline was successful

- Introduced version.json and appVersionAssetPlugin for build-time version tracking.
- Enhanced settings page with update check/status UI.
- Refactored bootstrap to handle SW updates and initiate periodic checks.
This commit is contained in:
2026-04-11 03:19:53 +02:00
parent 9e6ad2dc08
commit 0a8464f63c
7 changed files with 366 additions and 18 deletions
+11 -1
View File
@@ -3,7 +3,6 @@ const APP_SHELL = ['/', '/index.html', '/manifest.webmanifest', '/offline.html',
self.addEventListener('install', (event) => {
event.waitUntil(caches.open(CACHE_NAME).then((cache) => cache.addAll(APP_SHELL)));
self.skipWaiting();
});
self.addEventListener('activate', (event) => {
@@ -19,6 +18,12 @@ self.addEventListener('activate', (event) => {
self.clients.claim();
});
self.addEventListener('message', (event) => {
if (event?.data?.type === 'SKIP_WAITING') {
self.skipWaiting();
}
});
self.addEventListener('fetch', (event) => {
if (event.request.method !== 'GET') {
return;
@@ -40,6 +45,11 @@ self.addEventListener('fetch', (event) => {
return;
}
if (requestUrl.pathname === '/version.json') {
event.respondWith(fetch(event.request, { cache: 'no-store' }));
return;
}
const destination = event.request.destination;
if (
destination === 'script' ||