mirror of
https://github.com/carlosazaustre/tenacitOS.git
synced 2026-08-14 09:02:12 +00:00
- OpenClaw Mission Control dashboard - Auth with rate limiting and secure cookie handling - API routes protected by middleware authentication - Terminal with safe command allowlist - File browser, cron manager, activity feed - Office 3D view with agent avatars - Cost tracking and analytics - Configurable branding via env vars
16 lines
583 B
JavaScript
16 lines
583 B
JavaScript
const CACHE = "mc-v1";
|
|
self.addEventListener("install", e => { self.skipWaiting(); });
|
|
self.addEventListener("activate", e => { e.waitUntil(clients.claim()); });
|
|
self.addEventListener("fetch", e => {
|
|
const url = new URL(e.request.url);
|
|
if (url.pathname.startsWith("/api/")) {
|
|
e.respondWith(fetch(e.request).catch(() => caches.match(e.request)));
|
|
} else {
|
|
e.respondWith(caches.match(e.request).then(r => r || fetch(e.request).then(res => {
|
|
const clone = res.clone();
|
|
caches.open(CACHE).then(c => c.put(e.request, clone));
|
|
return res;
|
|
})));
|
|
}
|
|
});
|