Init commit

This commit is contained in:
2026-08-29 09:08:22 +05:00
commit eaa9a7bef2
21 changed files with 2738 additions and 0 deletions
+17
View File
@@ -0,0 +1,17 @@
/* Offline shell: network-first for navigations, cache fallback when offline. */
const CACHE = "homelab-shell-v1";
self.addEventListener("install", (e) => {
e.waitUntil(caches.open(CACHE).then((c) => c.addAll(["/", "/index.html"])));
});
self.addEventListener("activate", (e) => {
e.waitUntil(
caches.keys().then((keys) => Promise.all(keys.filter((k) => k !== CACHE).map((k) => caches.delete(k)))),
);
});
self.addEventListener("fetch", (e) => {
if (e.request.mode !== "navigate") return;
e.respondWith(fetch(e.request).catch(() => caches.match("/index.html")));
});