Files
Maven/cmd/mavweb/static/service-worker.js
T
kami 7a95097cc7 feat: web UI redesign with PWA support, voice page, and mobile layout
- Redesign dash/history/notifications/trace pages with unified CSS framework
  (ui.css): cards, badges, scrollable tables, responsive grid, PWA shell.
- Add /voice page with chat-bubble transcript, listening indicator, and
  push-to-talk button for voice interaction.
- Add mavweb.js: client-side JS for live transcript polling, auto-scroll,
  push-to-talk, and service-worker registration.
- Update PWA manifest, icon, and service-worker for installable web app.
- Add WebAuthn credential management (register/list/delete) with modal UI.
- Update main.go: /voice route, WebAuthn handlers, new page navigation.
- Update handlers_test.go for new voice and WebAuthn routes.
2026-07-10 15:49:18 +04:00

17 lines
514 B
JavaScript

const CACHE = "maven-v2";
self.addEventListener("install", e => {
e.waitUntil(caches.open(CACHE).then(c => c.addAll(["/", "/ui.css", "/mavweb.js", "/manifest.json", "/dash"])));
self.skipWaiting();
});
self.addEventListener("activate", e => {
e.waitUntil(
caches.keys().then(keys => Promise.all(keys.filter(k => k !== CACHE).map(k => caches.delete(k))))
);
clients.claim();
});
self.addEventListener("fetch", e => {
e.respondWith(
fetch(e.request).catch(() => caches.match(e.request))
);
});