Refactor manifest.json for Ausleihsystem; add service worker for caching and offline support
This commit is contained in:
Submodule
+1
Submodule Web/pwa-app added at da45c25039
Binary file not shown.
|
After Width: | Height: | Size: 545 B |
Binary file not shown.
|
After Width: | Height: | Size: 1.8 KiB |
+8
-119
@@ -1,134 +1,23 @@
|
|||||||
{
|
{
|
||||||
"name": "Inventarsystem",
|
"name": "Ausleihsystem",
|
||||||
"short_name": "Inventar",
|
"short_name": "Ausleihe",
|
||||||
"description": "Verwaltungssystem für Schulinventare mit Ausleihmanagement",
|
"description": "System zur Verwaltung von Ausleihen",
|
||||||
"start_url": "/",
|
"start_url": "/",
|
||||||
"scope": "/",
|
|
||||||
"display": "standalone",
|
"display": "standalone",
|
||||||
"orientation": "portrait-primary",
|
|
||||||
"background_color": "#ffffff",
|
"background_color": "#ffffff",
|
||||||
"theme_color": "#007bff",
|
"theme_color": "#1f2937",
|
||||||
"dir": "ltr",
|
|
||||||
"lang": "de-DE",
|
|
||||||
"prefer_related_applications": false,
|
|
||||||
"related_applications": [],
|
|
||||||
"icons": [
|
"icons": [
|
||||||
{
|
{
|
||||||
"src": "/static/img/logo-72x72.png",
|
"src": "/static/img/icon-192.png",
|
||||||
"sizes": "72x72",
|
|
||||||
"type": "image/png",
|
"type": "image/png",
|
||||||
"purpose": "any"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"src": "/static/img/logo-96x96.png",
|
|
||||||
"sizes": "96x96",
|
|
||||||
"type": "image/png",
|
|
||||||
"purpose": "any"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"src": "/static/img/logo-128x128.png",
|
|
||||||
"sizes": "128x128",
|
|
||||||
"type": "image/png",
|
|
||||||
"purpose": "any"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"src": "/static/img/logo-144x144.png",
|
|
||||||
"sizes": "144x144",
|
|
||||||
"type": "image/png",
|
|
||||||
"purpose": "any"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"src": "/static/img/logo-152x152.png",
|
|
||||||
"sizes": "152x152",
|
|
||||||
"type": "image/png",
|
|
||||||
"purpose": "any"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"src": "/static/img/logo-192x192.png",
|
|
||||||
"sizes": "192x192",
|
"sizes": "192x192",
|
||||||
"type": "image/png",
|
"purpose": "any maskable"
|
||||||
"purpose": "any"
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"src": "/static/img/logo-384x384.png",
|
"src": "/static/img/icon-512.png",
|
||||||
"sizes": "384x384",
|
|
||||||
"type": "image/png",
|
"type": "image/png",
|
||||||
"purpose": "any"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"src": "/static/img/logo-512x512.png",
|
|
||||||
"sizes": "512x512",
|
"sizes": "512x512",
|
||||||
"type": "image/png",
|
"purpose": "any maskable"
|
||||||
"purpose": "any"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"src": "/static/img/logo-192x192-maskable.png",
|
|
||||||
"sizes": "192x192",
|
|
||||||
"type": "image/png",
|
|
||||||
"purpose": "maskable"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"src": "/static/img/logo-512x512-maskable.png",
|
|
||||||
"sizes": "512x512",
|
|
||||||
"type": "image/png",
|
|
||||||
"purpose": "maskable"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"screenshots": [
|
|
||||||
{
|
|
||||||
"src": "/static/img/screenshot-540x720.png",
|
|
||||||
"sizes": "540x720",
|
|
||||||
"type": "image/png",
|
|
||||||
"form_factor": "narrow"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"src": "/static/img/screenshot-1280x720.png",
|
|
||||||
"sizes": "1280x720",
|
|
||||||
"type": "image/png",
|
|
||||||
"form_factor": "wide"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"categories": ["education", "productivity"],
|
|
||||||
"shortcuts": [
|
|
||||||
{
|
|
||||||
"name": "Meine Ausleihungen",
|
|
||||||
"short_name": "Ausleihungen",
|
|
||||||
"description": "Zeige meine aktuellen Ausleihungen",
|
|
||||||
"url": "/my_borrowed_items",
|
|
||||||
"icons": [
|
|
||||||
{
|
|
||||||
"src": "/static/img/shortcut-96x96.png",
|
|
||||||
"sizes": "96x96"
|
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "Kalender",
|
|
||||||
"short_name": "Kalender",
|
|
||||||
"description": "Kalender für Ausleihplanungen",
|
|
||||||
"url": "/terminplan",
|
|
||||||
"icons": [
|
|
||||||
{
|
|
||||||
"src": "/static/img/shortcut-96x96.png",
|
|
||||||
"sizes": "96x96"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"share_target": {
|
|
||||||
"action": "/share",
|
|
||||||
"method": "POST",
|
|
||||||
"enctype": "multipart/form-data",
|
|
||||||
"params": {
|
|
||||||
"title": "title",
|
|
||||||
"text": "text",
|
|
||||||
"url": "url",
|
|
||||||
"files": [
|
|
||||||
{
|
|
||||||
"name": "media",
|
|
||||||
"accept": ["image/*", "video/*"]
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,18 @@
|
|||||||
|
const CACHE_NAME = 'ausleihe-cache-v1';
|
||||||
|
|
||||||
|
self.addEventListener('install', (event) => {
|
||||||
|
self.skipWaiting();
|
||||||
|
});
|
||||||
|
|
||||||
|
self.addEventListener('activate', (event) => {
|
||||||
|
event.waitUntil(clients.claim());
|
||||||
|
});
|
||||||
|
|
||||||
|
self.addEventListener('fetch', (event) => {
|
||||||
|
// Einfacher Fallback aufs Netzwerk (Offline-Seite könnte hier ergänzt werden)
|
||||||
|
event.respondWith(
|
||||||
|
fetch(event.request).catch(() => {
|
||||||
|
return caches.match(event.request);
|
||||||
|
})
|
||||||
|
);
|
||||||
|
});
|
||||||
@@ -14,6 +14,7 @@
|
|||||||
<meta name="mobile-web-app-capable" content="yes">
|
<meta name="mobile-web-app-capable" content="yes">
|
||||||
<meta name="apple-mobile-web-app-capable" content="yes">
|
<meta name="apple-mobile-web-app-capable" content="yes">
|
||||||
<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent">
|
<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent">
|
||||||
|
<link rel="manifest" href="{{ url_for('static', filename='manifest.json') }}">
|
||||||
<meta name="csrf-token" content="{{ csrf_token }}">
|
<meta name="csrf-token" content="{{ csrf_token }}">
|
||||||
<title>{% block title %}Inventarsystem{% endblock %}</title>
|
<title>{% block title %}Inventarsystem{% endblock %}</title>
|
||||||
{% block head %}
|
{% block head %}
|
||||||
|
|||||||
Reference in New Issue
Block a user