Phase 2: AI Chat, Calendar, Odoo connector, PWA
- AI Chat endpoint (/api/v1/chat) with Claude API context - Calendar page with FullCalendar.js (day/week/month) - Odoo API connector (import/export/webhook) - PWA manifest + service worker for offline - SW register component Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
27
apps/tasks/public/sw.js
Normal file
27
apps/tasks/public/sw.js
Normal file
@@ -0,0 +1,27 @@
|
||||
const CACHE = "taskteam-v1";
|
||||
const PRECACHE = ["/tasks", "/login", "/manifest.json"];
|
||||
|
||||
self.addEventListener("install", (e) => {
|
||||
e.waitUntil(caches.open(CACHE).then((c) => c.addAll(PRECACHE)));
|
||||
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;
|
||||
e.respondWith(
|
||||
fetch(e.request)
|
||||
.then((r) => {
|
||||
const clone = r.clone();
|
||||
caches.open(CACHE).then((c) => c.put(e.request, clone));
|
||||
return r;
|
||||
})
|
||||
.catch(() => caches.match(e.request))
|
||||
);
|
||||
});
|
||||
Reference in New Issue
Block a user