Refactor to Vue 3 + FastAPI + SQLite architecture
Some checks failed
Some checks failed
- Backend: FastAPI + SQLite (WAL mode), 22 tables, ~40 API endpoints - Frontend: Vue 3 + Vite + Pinia + Vue Router, 8 views, 3 stores - Database: migrate from JSON file to SQLite with proper schema - Dockerfile: multi-stage build (node + python) - Deploy: K8s manifests (namespace, deployment, service, ingress, pvc, backup) - CI/CD: Gitea Actions (test, deploy, PR preview at pr-$id.planner.oci.euphon.net) - Tests: 20 Cypress E2E test files, 196 test cases, ~85% coverage - Doc: test-coverage.md with full feature coverage report Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
25
frontend/public/sw.js
Normal file
25
frontend/public/sw.js
Normal file
@@ -0,0 +1,25 @@
|
||||
// Service Worker for Hera's Planner — 后台提醒通知
|
||||
self.addEventListener('install', () => self.skipWaiting());
|
||||
self.addEventListener('activate', () => self.clients.claim());
|
||||
|
||||
self.addEventListener('message', event => {
|
||||
if (event.data && event.data.type === 'SHOW_NOTIFICATION') {
|
||||
self.registration.showNotification(event.data.title, {
|
||||
body: event.data.body,
|
||||
icon: 'icon-180.png',
|
||||
badge: 'icon-180.png',
|
||||
requireInteraction: true,
|
||||
tag: event.data.tag || 'planner-reminder',
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
self.addEventListener('notificationclick', event => {
|
||||
event.notification.close();
|
||||
event.waitUntil(
|
||||
self.clients.matchAll({ type: 'window' }).then(clients => {
|
||||
if (clients.length > 0) { clients[0].focus(); }
|
||||
else { self.clients.openWindow('/'); }
|
||||
})
|
||||
);
|
||||
});
|
||||
Reference in New Issue
Block a user