mirror of
https://gitlab.com/crafty-controller/crafty-4.git
synced 2024-08-30 18:23:09 +00:00
manifest updates, make offline work better
This commit is contained in:
parent
014805fc31
commit
22ab592126
@ -10,26 +10,29 @@
|
||||
"start_url": "/",
|
||||
"theme_color": "#222436",
|
||||
"categories": ["utilities"],
|
||||
"screenshots": [],
|
||||
"icons": [
|
||||
{
|
||||
"src": "/static/assets/images/Crafty_4-0_Logo_square.ico",
|
||||
"type": "image/x-icon",
|
||||
"sizes":"128x128"
|
||||
},
|
||||
{
|
||||
"src": "/static/assets/images/Crafty_4-0.png",
|
||||
"type": "image/png",
|
||||
"sizes": "144x144"
|
||||
}
|
||||
],
|
||||
"shortcuts": [
|
||||
"sizes": "144x144",
|
||||
"purpose": "any"
|
||||
},
|
||||
{
|
||||
"name": "Crafty Controller 4",
|
||||
"short_name": "Crafty",
|
||||
"description": "Minecraft server manager",
|
||||
"url": "/panel/dashboard",
|
||||
"icons": [
|
||||
{
|
||||
"src": "/static/assets/images/Crafty_4-0.png",
|
||||
"sizes": "144x144"
|
||||
}
|
||||
]
|
||||
"src": "/static/assets/images/crafty-logo-square-1024.png",
|
||||
"type": "image/png",
|
||||
"sizes": "1024/1024",
|
||||
"purpose": "any"
|
||||
},
|
||||
{
|
||||
"src": "/static/assets/images/crafty-logo-square-96.png",
|
||||
"type": "image/png",
|
||||
"sizes": "96x96",
|
||||
"purpose": "any"
|
||||
}
|
||||
],
|
||||
"lang": "en",
|
||||
|
BIN
app/frontend/static/assets/images/crafty-logo-square-1024.png
Normal file
BIN
app/frontend/static/assets/images/crafty-logo-square-1024.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 424 KiB |
BIN
app/frontend/static/assets/images/crafty-logo-square-96.png
Normal file
BIN
app/frontend/static/assets/images/crafty-logo-square-96.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 2.8 KiB |
47
app/frontend/static/assets/js/shared/service-worker.js
Normal file
47
app/frontend/static/assets/js/shared/service-worker.js
Normal file
@ -0,0 +1,47 @@
|
||||
// This is the "Offline page" service worker
|
||||
|
||||
importScripts('https://storage.googleapis.com/workbox-cdn/releases/5.1.2/workbox-sw.js');
|
||||
|
||||
const CACHE = "pwabuilder-page";
|
||||
|
||||
// TODO: replace the following with the correct offline fallback page i.e.: const offlineFallbackPage = "offline.html";
|
||||
const offlineFallbackPage = "/offline";
|
||||
|
||||
self.addEventListener("message", (event) => {
|
||||
if (event.data && event.data.type === "SKIP_WAITING") {
|
||||
self.skipWaiting();
|
||||
}
|
||||
});
|
||||
|
||||
self.addEventListener('install', async (event) => {
|
||||
event.waitUntil(
|
||||
caches.open(CACHE)
|
||||
.then((cache) => cache.add(offlineFallbackPage))
|
||||
);
|
||||
});
|
||||
|
||||
if (workbox.navigationPreload.isSupported()) {
|
||||
workbox.navigationPreload.enable();
|
||||
}
|
||||
|
||||
self.addEventListener('fetch', (event) => {
|
||||
console.log("service worker -- fetch");
|
||||
if (event.request.mode === 'navigate') {
|
||||
event.respondWith((async () => {
|
||||
try {
|
||||
const preloadResp = await event.preloadResponse;
|
||||
|
||||
if (preloadResp) {
|
||||
return preloadResp;
|
||||
}
|
||||
const networkResp = await fetch(event.request);
|
||||
return networkResp;
|
||||
} catch (error) {
|
||||
|
||||
const cache = await caches.open(CACHE);
|
||||
const cachedResp = await cache.match(offlineFallbackPage);
|
||||
return cachedResp;
|
||||
}
|
||||
})());
|
||||
}
|
||||
});
|
@ -22,12 +22,11 @@
|
||||
<link rel="manifest" href="/static/assets/crafty.webmanifest">
|
||||
<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="mobile-web-app-capable" content="yes" />
|
||||
<meta name="apple-mobile-web-app-status-bar-style" content="black">
|
||||
<meta name="apple-mobile-web-app-title" content="Crafty Controller 4">
|
||||
<link rel="shortcut icon" sizes="192x192" href="../static/assets/images/Crafty_4-0.png">
|
||||
<!-- <meta name="apple-mobile-web-app-title" content="Crafty Controller 4"> -->
|
||||
<link rel="apple-touch-icon" href="../static/assets/images/Crafty_4-0.png">
|
||||
<link rel="shortcut icon" sizes="192x192" href="../static/assets/images/Crafty_4-0.png">
|
||||
|
||||
|
||||
<!-- endinject -->
|
||||
@ -543,6 +542,8 @@
|
||||
.then(function (registration) {
|
||||
console.log('Service Worker Registered');
|
||||
});
|
||||
} else {
|
||||
console.log("service worker not registered");
|
||||
}
|
||||
});
|
||||
</script>
|
||||
|
@ -15,6 +15,12 @@
|
||||
<link rel="stylesheet" href="/static/assets/vendors/fontawesome6/css/all.css">
|
||||
<link rel="stylesheet" href="/static/assest/css/crafty.css">
|
||||
<link rel="manifest" href="/static/assets/crafty.webmanifest">
|
||||
|
||||
<meta name="apple-mobile-web-app-capable" content="yes">
|
||||
<meta name="mobile-web-app-capable" content="yes" />
|
||||
<meta name="apple-mobile-web-app-status-bar-style" content="black">
|
||||
<!-- <meta name="apple-mobile-web-app-title" content="Crafty Controller 4"> -->
|
||||
<link rel="apple-touch-icon" href="../static/assets/images/Crafty_4-0.png">
|
||||
<!-- endinject -->
|
||||
<!-- Plugin css for this page -->
|
||||
<!-- End Plugin css for this page -->
|
||||
|
@ -1,32 +0,0 @@
|
||||
{
|
||||
"$schema": "https://json.schemastore.org/web-manifest-combined.json",
|
||||
"short_name": "Crafty",
|
||||
"name": "Crafty Controller 4",
|
||||
"icons": [
|
||||
{
|
||||
"src": "../static/assets/images/Crafty_4-0.png",
|
||||
"type": "image/png",
|
||||
"sizes": "192x192"
|
||||
}
|
||||
],
|
||||
"start_url": "/public/login",
|
||||
"background_color": "#3367D6",
|
||||
"display": "fullscreen",
|
||||
"scope": "/",
|
||||
"theme_color": "#3367D6",
|
||||
"shortcuts": [
|
||||
{
|
||||
"name": "Crafty Controller 4",
|
||||
"short_name": "Crafty",
|
||||
"description": "View weather information for today",
|
||||
"url": "/panel/dashboard",
|
||||
"icons": [
|
||||
{
|
||||
"src": "../static/assets/images/Crafty_4-0.png",
|
||||
"sizes": "192x192"
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
"description": "Server Management Console/Wrapper"
|
||||
}
|
@ -24,7 +24,7 @@
|
||||
<style>
|
||||
.auth.auth-bg-1 {
|
||||
background: url("../../static/assets/images/auth/{% raw data['background'] %}"),
|
||||
url("../../static/assets/images/auth/login-1.jpg");
|
||||
url("/static/assets/images/auth/login_1.jpg");
|
||||
background-size: cover;
|
||||
}
|
||||
</style>
|
||||
|
@ -12,6 +12,14 @@
|
||||
<link rel="stylesheet" href="/static/assets/vendors/ti-icons/css/themify-icons.css">
|
||||
<link rel="stylesheet" href="/static/assets/vendors/typicons/typicons.css">
|
||||
<link rel="stylesheet" href="/static/assets/vendors/css/vendor.bundle.base.css">
|
||||
<link rel="manifest" href="/static/assets/crafty.webmanifest">
|
||||
|
||||
<meta name="apple-mobile-web-app-capable" content="yes">
|
||||
<meta name="mobile-web-app-capable" content="yes" />
|
||||
<meta name="apple-mobile-web-app-status-bar-style" content="black">
|
||||
<!-- <meta name="apple-mobile-web-app-title" content="Crafty Controller 4"> -->
|
||||
<link rel="apple-touch-icon" href="../static/assets/images/Crafty_4-0.png">
|
||||
|
||||
<!-- endinject -->
|
||||
<!-- Plugin css for this page -->
|
||||
<!-- End Plugin css for this page -->
|
||||
@ -24,7 +32,7 @@
|
||||
<style>
|
||||
.auth.auth-bg-1 {
|
||||
background: url("../../static/assets/images/auth/{% raw data['background'] %}"),
|
||||
url("../../static/assets/images/auth/login-1.jpg");
|
||||
url("/static/assets/images/auth/login_1.jpg");
|
||||
background-size: cover;
|
||||
}
|
||||
</style>
|
||||
|
@ -12,6 +12,14 @@
|
||||
<link rel="stylesheet" href="/static/assets/vendors/ti-icons/css/themify-icons.css">
|
||||
<link rel="stylesheet" href="/static/assets/vendors/typicons/typicons.css">
|
||||
<link rel="stylesheet" href="/static/assets/vendors/css/vendor.bundle.base.css">
|
||||
<link rel="manifest" href="/static/assets/crafty.webmanifest">
|
||||
|
||||
<meta name="apple-mobile-web-app-capable" content="yes">
|
||||
<meta name="mobile-web-app-capable" content="yes" />
|
||||
<meta name="apple-mobile-web-app-status-bar-style" content="black">
|
||||
<!-- <meta name="apple-mobile-web-app-title" content="Crafty Controller 4"> -->
|
||||
<link rel="apple-touch-icon" href="../static/assets/images/Crafty_4-0.png">
|
||||
|
||||
<!-- endinject -->
|
||||
<!-- Plugin css for this page -->
|
||||
<!-- End Plugin css for this page -->
|
||||
@ -24,7 +32,7 @@
|
||||
<style>
|
||||
.auth.auth-bg-1 {
|
||||
background: url("../../static/assets/images/auth/{% raw data['background'] %}"),
|
||||
url("../../static/assets/images/auth/login-1.jpg");
|
||||
url("/static/assets/images/auth/login_1.jpg");
|
||||
background-size: cover;
|
||||
}
|
||||
</style>
|
||||
|
@ -13,6 +13,12 @@
|
||||
<link rel="stylesheet" href="/static/assets/vendors/typicons/typicons.css">
|
||||
<link rel="stylesheet" href="/static/assets/vendors/css/vendor.bundle.base.css">
|
||||
<link rel="manifest" href="/static/assets/crafty.webmanifest">
|
||||
|
||||
<meta name="apple-mobile-web-app-capable" content="yes">
|
||||
<meta name="mobile-web-app-capable" content="yes" />
|
||||
<meta name="apple-mobile-web-app-status-bar-style" content="black">
|
||||
<!-- <meta name="apple-mobile-web-app-title" content="Crafty Controller 4"> -->
|
||||
<link rel="apple-touch-icon" href="../static/assets/images/Crafty_4-0.png">
|
||||
<!-- endinject -->
|
||||
<!-- Plugin css for this page -->
|
||||
<!-- End Plugin css for this page -->
|
||||
@ -25,7 +31,7 @@
|
||||
<style>
|
||||
.auth.auth-bg-1 {
|
||||
background: url("../../static/assets/images/auth/{% raw data['background'] %}"),
|
||||
url("../../static/assets/images/auth/login-1.jpg");
|
||||
url("/static/assets/images/auth/login_1.jpg");
|
||||
background-size: cover;
|
||||
background-position: center;
|
||||
}
|
||||
@ -145,10 +151,15 @@
|
||||
if ('serviceWorker' in navigator) {
|
||||
navigator.serviceWorker.register('/static/assets/js/shared/service-worker.js', {scope: '/'})
|
||||
.then(function (registration) {
|
||||
console.log('Service Worker Registered');
|
||||
console.error('Service Worker Registered');
|
||||
});
|
||||
} else {
|
||||
console.error("service worker not registered");
|
||||
}
|
||||
});
|
||||
|
||||
console.error('service worker' in navigator);
|
||||
console.error(navigator.serviceWorker);
|
||||
|
||||
</script>
|
||||
</body>
|
||||
|
@ -12,6 +12,14 @@
|
||||
<link rel="stylesheet" href="/static/assets/vendors/ti-icons/css/themify-icons.css">
|
||||
<link rel="stylesheet" href="/static/assets/vendors/typicons/typicons.css">
|
||||
<link rel="stylesheet" href="/static/assets/vendors/css/vendor.bundle.base.css">
|
||||
<link rel="manifest" href="/static/assets/crafty.webmanifest">
|
||||
|
||||
<meta name="apple-mobile-web-app-capable" content="yes">
|
||||
<meta name="mobile-web-app-capable" content="yes" />
|
||||
<meta name="apple-mobile-web-app-status-bar-style" content="black">
|
||||
<!-- <meta name="apple-mobile-web-app-title" content="Crafty Controller 4"> -->
|
||||
<link rel="apple-touch-icon" href="../static/assets/images/Crafty_4-0.png">
|
||||
|
||||
<!-- endinject -->
|
||||
<!-- Plugin css for this page -->
|
||||
<!-- End Plugin css for this page -->
|
||||
@ -24,7 +32,7 @@
|
||||
<style>
|
||||
.auth.auth-bg-1 {
|
||||
background: url("../../static/assets/images/auth/{% raw data['background'] %}"),
|
||||
url("../../static/assets/images/auth/login-1.jpg");
|
||||
url("/static/assets/images/auth/login_1.jpg");
|
||||
background-size: cover;
|
||||
}
|
||||
</style>
|
||||
|
@ -10,7 +10,7 @@
|
||||
<style>
|
||||
.auth.auth-bg-1 {
|
||||
background: url("../../static/assets/images/auth/{% raw data['background'] %}"),
|
||||
url("../../static/assets/images/auth/login-1.jpg");
|
||||
url("/static/assets/images/auth/login_1.jpg");
|
||||
background-size: cover;
|
||||
}
|
||||
</style>
|
||||
|
@ -15,6 +15,12 @@
|
||||
<link rel="stylesheet" href="/static/assets/vendors/css/vendor.bundle.base.css">
|
||||
<link rel="stylesheet" href="/static/assets/vendors/fontawesome6/css/all.css">
|
||||
<link rel="manifest" href="/static/assets/crafty.webmanifest">
|
||||
|
||||
<meta name="apple-mobile-web-app-capable" content="yes">
|
||||
<meta name="mobile-web-app-capable" content="yes" />
|
||||
<meta name="apple-mobile-web-app-status-bar-style" content="black">
|
||||
<!-- <meta name="apple-mobile-web-app-title" content="Crafty Controller 4"> -->
|
||||
<link rel="apple-touch-icon" href="../static/assets/images/Crafty_4-0.png">
|
||||
<!-- endinject -->
|
||||
<!-- Plugin css for this page -->
|
||||
<!-- End Plugin css for this page -->
|
||||
|
Loading…
Reference in New Issue
Block a user