mirror of
https://github.com/Southampton-RSG/breccia-mapper.git
synced 2026-03-03 11:27:09 +00:00
[FIX] Offline PWA functionality and style offline page
This commit is contained in:
@@ -1,9 +1,10 @@
|
|||||||
var staticCacheName = "django-pwa-v" + new Date().getTime();
|
var staticCacheName = "django-pwa-v" + new Date().getTime();
|
||||||
var filesToCache = [
|
var filesToCache = [
|
||||||
"/offline",
|
"/offline/",
|
||||||
"https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.2.1/css/fontawesome.min.css",
|
"https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.2.1/css/fontawesome.min.css",
|
||||||
"https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.2.1/css/solid.min.css",
|
"https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.2.1/css/solid.min.css",
|
||||||
"/static/css/global.css",
|
"/static/css/global.css",
|
||||||
|
"/static/js/serviceworker.js",
|
||||||
"/static/hijack/hijack.min.css",
|
"/static/hijack/hijack.min.css",
|
||||||
"/media/icon-192x192.png",
|
"/media/icon-192x192.png",
|
||||||
];
|
];
|
||||||
@@ -41,7 +42,7 @@ self.addEventListener("fetch", event => {
|
|||||||
return response || fetch(event.request);
|
return response || fetch(event.request);
|
||||||
})
|
})
|
||||||
.catch(() => {
|
.catch(() => {
|
||||||
return caches.match('offline');
|
return caches.match('/offline/');
|
||||||
})
|
})
|
||||||
)
|
)
|
||||||
});
|
});
|
||||||
8
breccia_mapper/templates/offline.html
Normal file
8
breccia_mapper/templates/offline.html
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
{% extends 'base.html' %}
|
||||||
|
|
||||||
|
{% block content %}
|
||||||
|
<h2>Offline</h2>
|
||||||
|
|
||||||
|
<p>You are currently offline. Please connect to a network to use this platform.</p>
|
||||||
|
|
||||||
|
{% endblock %}
|
||||||
Reference in New Issue
Block a user