SysOps: voice-agy-webbuilder-backup — 2026-06-23 10:04 UTC

This commit is contained in:
sysops
2026-06-23 10:04:23 +00:00
parent 3bf15c4850
commit 26fe76afdd
165 changed files with 47427 additions and 1264 deletions
+15 -43
View File
@@ -1,46 +1,18 @@
/* Foodlinkk PWA — light cache for shell */
const CACHE = 'foodlinkk-v1';
const ASSETS = [
'/',
'/static/css/palantir-theme.css',
'/static/css/pulse-theme.css',
'/static/css/mobile.css',
'/static/css/vertical-tabs.css',
'/static/js/cockpit.js',
'/static/js/live-pulse.js',
'/static/icons/app-icon.svg',
'/static/manifest.json',
];
self.addEventListener('install', (e) => {
e.waitUntil(
caches.open(CACHE).then((c) => c.addAll(ASSETS).catch(() => {}))
);
/* PWA cache disabled — clears legacy caches and unregisters itself */
self.addEventListener('install', (event) => {
self.skipWaiting();
});
self.addEventListener('activate', (e) => {
e.waitUntil(
caches.keys().then((keys) =>
Promise.all(keys.filter((k) => k !== CACHE).map((k) => caches.delete(k)))
)
);
self.clients.claim();
});
self.addEventListener('fetch', (e) => {
if (e.request.method !== 'GET') return;
const url = new URL(e.request.url);
if (url.pathname.startsWith('/api/') || url.pathname.startsWith('/ws')) return;
e.respondWith(
fetch(e.request)
.then((r) => {
if (r.ok && url.pathname.startsWith('/static/')) {
const clone = r.clone();
caches.open(CACHE).then((c) => c.put(e.request, clone));
}
return r;
})
.catch(() => caches.match(e.request).then((m) => m || caches.match('/')))
event.waitUntil(
caches.keys().then((keys) => Promise.all(keys.map((k) => caches.delete(k))))
);
});
self.addEventListener('activate', (event) => {
event.waitUntil(
caches.keys()
.then((keys) => Promise.all(keys.map((k) => caches.delete(k))))
.then(() => self.clients.claim())
);
});
/* Do not intercept fetches — always use network */
self.addEventListener('fetch', () => {});