mirror of
https://github.com/coulisse/spiderweb.git
synced 2024-09-21 07:27:09 +00:00
webmanifest
This commit is contained in:
parent
696f4c08ea
commit
57f3d4b095
@ -8,11 +8,11 @@ path_static='../static'
|
|||||||
path_static_html=${path_static}'/html'
|
path_static_html=${path_static}'/html'
|
||||||
path_static_js=${path_static}'/js'
|
path_static_js=${path_static}'/js'
|
||||||
path_static_css=${path_static}'/css'
|
path_static_css=${path_static}'/css'
|
||||||
|
path_static_pwa=${path_static}'/pwa'
|
||||||
path_cfg='../cfg'
|
path_cfg='../cfg'
|
||||||
app_ini=${path_cfg}'/webapp_log_config.ini'
|
app_ini=${path_cfg}'/webapp_log_config.ini'
|
||||||
path_docs='../docs'
|
path_docs='../docs'
|
||||||
readme='../README.md'
|
readme='../README.md'
|
||||||
manifest=${path_static}'/manifest.webmanifest'
|
|
||||||
changelog=${path_docs}'/'CHANGELOG.md
|
changelog=${path_docs}'/'CHANGELOG.md
|
||||||
|
|
||||||
html_change_references(){
|
html_change_references(){
|
||||||
@ -32,6 +32,7 @@ html_change_references(){
|
|||||||
echo 'ERROR replacing .css to .min.css '
|
echo 'ERROR replacing .css to .min.css '
|
||||||
exit 6
|
exit 6
|
||||||
fi
|
fi
|
||||||
|
|
||||||
elif [ "${1}" == "-d" ]; then
|
elif [ "${1}" == "-d" ]; then
|
||||||
# concatenating 2 sed command with ";"
|
# concatenating 2 sed command with ";"
|
||||||
# 1) if found static/js/rel/ replace .min.js with .js
|
# 1) if found static/js/rel/ replace .min.js with .js
|
||||||
@ -45,6 +46,7 @@ html_change_references(){
|
|||||||
echo 'ERROR replacing .min.css to .css'
|
echo 'ERROR replacing .min.css to .css'
|
||||||
exit 6
|
exit 6
|
||||||
fi
|
fi
|
||||||
|
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
}
|
}
|
||||||
@ -84,6 +86,7 @@ if [ "$1" == "-r" ]; then
|
|||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|
||||||
|
|
||||||
#used to minify css
|
#used to minify css
|
||||||
echo 'minify css...'
|
echo 'minify css...'
|
||||||
rm ${path_static_css}/rel/*.css
|
rm ${path_static_css}/rel/*.css
|
||||||
@ -127,7 +130,6 @@ if [ "$1" == "-r" ]; then
|
|||||||
echo 'ERROR settimg loglevel=INFO '
|
echo 'ERROR settimg loglevel=INFO '
|
||||||
exit 12
|
exit 12
|
||||||
fi
|
fi
|
||||||
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ "$1" == "-d" ]; then
|
if [ "$1" == "-d" ]; then
|
||||||
@ -163,10 +165,10 @@ if [ ${ver} == "" ]; then
|
|||||||
fi
|
fi
|
||||||
echo 'version: '${ver}
|
echo 'version: '${ver}
|
||||||
|
|
||||||
echo 'writing version in '${manifest} '...'
|
echo 'writing version in '${path_static_pwa}/manifest.webmanifest '...'
|
||||||
if ! sed -i 's/v.*",/'$ver'",/g' ${manifest}
|
if ! sed -i 's/v.*",/'$ver'",/g' ${path_static_pwa}/manifest.webmanifest
|
||||||
then
|
then
|
||||||
echo 'ERROR writing version in '${manifest}
|
echo 'ERROR writing version in '${path_static_pwa}/manifest.webmanifest
|
||||||
exit 42
|
exit 42
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
@ -16,7 +16,7 @@
|
|||||||
<link rel="icon" href="/static/images/icons/favicon.ico">
|
<link rel="icon" href="/static/images/icons/favicon.ico">
|
||||||
<link rel="icon" href="/static/images/icons/spider_ico_master.svg" type="image/svg+xml">
|
<link rel="icon" href="/static/images/icons/spider_ico_master.svg" type="image/svg+xml">
|
||||||
<link rel="apple-touch-icon" href="/static/images/icons/icon-apple.png">
|
<link rel="apple-touch-icon" href="/static/images/icons/icon-apple.png">
|
||||||
<link rel="manifest" href="/static/manifest.webmanifest">
|
<link rel="manifest" href="/static/pwa/manifest.webmanifest">
|
||||||
<link rel="stylesheet" href="/static/css/rel/style.min.css">
|
<link rel="stylesheet" href="/static/css/rel/style.min.css">
|
||||||
|
|
||||||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@5.2.3/dist/css/bootstrap.min.css"
|
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@5.2.3/dist/css/bootstrap.min.css"
|
||||||
|
BIN
static/images/icons/icon-512x512-any.png
Normal file
BIN
static/images/icons/icon-512x512-any.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 20 KiB |
1
static/js/rel/manifest.webmanifest.min
Normal file
1
static/js/rel/manifest.webmanifest.min
Normal file
@ -0,0 +1 @@
|
|||||||
|
{"name": "IU1BOW Spiderweb v2.4.1.2", "description": "DXCluser for ham radio by IU1BOW", "short_name": "Spiderweb", "theme_color": "#f3b221", "background_color": "#2196f3", "display": "standalone", "orientation": "portrait", "scope": "/", "start_url": "/index.html", "lang": "en-EN", "icons": [{"src": "images/icons/icon-72x72.png", "sizes": "72x72", "type": "image/png"}, {"src": "images/icons/icon-96x96.png", "sizes": "96x96", "type": "image/png"}, {"src": "images/icons/icon-128x128.png", "sizes": "128x128", "type": "image/png"}, {"src": "images/icons/icon-144x144.png", "sizes": "144x144", "type": "image/png"}, {"src": "images/icons/icon-152x152.png", "sizes": "152x152", "type": "image/png"}, {"src": "images/icons/icon-192x192.png", "sizes": "192x192", "type": "image/png"}, {"src": "images/icons/icon-384x384.png", "sizes": "384x384", "type": "image/png"}, {"src": "images/icons/icon-512x512.png", "sizes": "512x512", "type": "image/png", "purpose": "any"}, {"src": "images/icons/icon-512x512.png", "sizes": "512x512", "type": "image/png", "purpose": "maskable"}], "splash_pages": null}
|
@ -1,56 +0,0 @@
|
|||||||
{
|
|
||||||
"name": "IU1BOW DXCluster v2.4.1.2",
|
|
||||||
"description": "DXCluser for ham radio by IU1BOW",
|
|
||||||
"short_name": "IU1BOW DX",
|
|
||||||
"theme_color": "#2196f3",
|
|
||||||
"background_color": "#f3b221",
|
|
||||||
"display": "standalone",
|
|
||||||
"orientation": "portrait",
|
|
||||||
"scope": "/",
|
|
||||||
"start_url": "/index.html",
|
|
||||||
"lang": "en-EN",
|
|
||||||
"icons": [
|
|
||||||
{
|
|
||||||
"src": "images/icons/icon-72x72.png",
|
|
||||||
"sizes": "72x72",
|
|
||||||
"type": "image/png",
|
|
||||||
"purpose": "any maskable"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"src": "images/icons/icon-96x96.png",
|
|
||||||
"sizes": "96x96",
|
|
||||||
"type": "image/png"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"src": "images/icons/icon-128x128.png",
|
|
||||||
"sizes": "128x128",
|
|
||||||
"type": "image/png"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"src": "images/icons/icon-144x144.png",
|
|
||||||
"sizes": "144x144",
|
|
||||||
"type": "image/png"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"src": "images/icons/icon-152x152.png",
|
|
||||||
"sizes": "152x152",
|
|
||||||
"type": "image/png"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"src": "images/icons/icon-192x192.png",
|
|
||||||
"sizes": "192x192",
|
|
||||||
"type": "image/png"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"src": "images/icons/icon-384x384.png",
|
|
||||||
"sizes": "384x384",
|
|
||||||
"type": "image/png"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"src": "images/icons/icon-512x512.png",
|
|
||||||
"sizes": "512x512",
|
|
||||||
"type": "image/png"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"splash_pages": null
|
|
||||||
}
|
|
61
static/pwa/manifest.webmanifest
Normal file
61
static/pwa/manifest.webmanifest
Normal file
@ -0,0 +1,61 @@
|
|||||||
|
{
|
||||||
|
"name": "IU1BOW Spiderweb v2.4.1.2",
|
||||||
|
"description": "DXCluser for ham radio by IU1BOW",
|
||||||
|
"short_name": "Spiderweb",
|
||||||
|
"theme_color": "#f3b221",
|
||||||
|
"background_color": "#2196f3",
|
||||||
|
"display": "standalone",
|
||||||
|
"orientation": "portrait",
|
||||||
|
"scope": "/",
|
||||||
|
"start_url": "/index.html",
|
||||||
|
"lang": "en-EN",
|
||||||
|
"icons": [
|
||||||
|
{
|
||||||
|
"src": "/static/images/icons/icon-72x72.png",
|
||||||
|
"sizes": "72x72",
|
||||||
|
"type": "image/png" },
|
||||||
|
{
|
||||||
|
"src": "/static/images/icons/icon-96x96.png",
|
||||||
|
"sizes": "96x96",
|
||||||
|
"type": "image/png"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"src": "/static/images/icons/icon-128x128.png",
|
||||||
|
"sizes": "128x128",
|
||||||
|
"type": "image/png"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"src": "/static/images/icons/icon-144x144.png",
|
||||||
|
"sizes": "144x144",
|
||||||
|
"type": "image/png"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"src": "/static/images/icons/icon-152x152.png",
|
||||||
|
"sizes": "152x152",
|
||||||
|
"type": "image/png"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"src": "/static/images/icons/icon-192x192.png",
|
||||||
|
"sizes": "192x192",
|
||||||
|
"type": "image/png"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"src": "/static/images/icons/icon-384x384.png",
|
||||||
|
"sizes": "384x384",
|
||||||
|
"type": "image/png"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"src": "/static/images/icons/icon-512x512.png",
|
||||||
|
"sizes": "512x512",
|
||||||
|
"type": "image/png",
|
||||||
|
"purpose": "any"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"src": "/static/images/icons/icon-512x512.png",
|
||||||
|
"sizes": "512x512",
|
||||||
|
"type": "image/png",
|
||||||
|
"purpose": "maskable"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"splash_pages": null
|
||||||
|
}
|
57
static/pwa/service-worker.js
Normal file
57
static/pwa/service-worker.js
Normal file
@ -0,0 +1,57 @@
|
|||||||
|
// This is the "Offline page" service worker
|
||||||
|
|
||||||
|
const CACHE = 'pwabuilder-page';
|
||||||
|
|
||||||
|
const offlineFallbackPage = '/offline.html';
|
||||||
|
|
||||||
|
// Install stage sets up the offline page in the cache and opens a new cache
|
||||||
|
self.addEventListener('install', function (event) {
|
||||||
|
console.log('[PWA Builder] Install Event processing');
|
||||||
|
|
||||||
|
event.waitUntil(
|
||||||
|
caches.open(CACHE).then(function (cache) {
|
||||||
|
console.log('[PWA Builder] Cached offline page during install');
|
||||||
|
/*
|
||||||
|
if (offlineFallbackPage === "/html/offline.html") {
|
||||||
|
return cache.add(new Response("TODO: Update the value of the offlineFallbackPage constant in the serviceworker."));
|
||||||
|
}
|
||||||
|
*/
|
||||||
|
return cache.add(offlineFallbackPage);
|
||||||
|
})
|
||||||
|
);
|
||||||
|
});
|
||||||
|
|
||||||
|
// If any fetch fails, it will show the offline page.
|
||||||
|
self.addEventListener('fetch', function (event) {
|
||||||
|
if (event.request.method !== 'GET') return;
|
||||||
|
|
||||||
|
event.respondWith(
|
||||||
|
fetch(event.request).catch(function (error) {
|
||||||
|
// The following validates that the request was for a navigation to a new document
|
||||||
|
if (
|
||||||
|
event.request.destination !== 'document' ||
|
||||||
|
event.request.mode !== 'navigate'
|
||||||
|
) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
console.error('[PWA Builder] Network request Failed. Serving offline page ' + error);
|
||||||
|
return caches.open(CACHE).then(function (cache) {
|
||||||
|
return cache.match(offlineFallbackPage);
|
||||||
|
});
|
||||||
|
})
|
||||||
|
);
|
||||||
|
});
|
||||||
|
|
||||||
|
// This is an event that can be fired from your page to tell the SW to update the offline page
|
||||||
|
self.addEventListener('refreshOffline', function () {
|
||||||
|
const offlinePageRequest = new Request(offlineFallbackPage);
|
||||||
|
|
||||||
|
return fetch(offlineFallbackPage).then(function (response) {
|
||||||
|
return caches.open(CACHE).then(function (cache) {
|
||||||
|
console.log('[PWA Builder] Offline page updated from refreshOffline event: ' + response.url);
|
||||||
|
return cache.put(offlinePageRequest, response);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
@ -1,57 +0,0 @@
|
|||||||
// This is the "Offline page" service worker
|
|
||||||
|
|
||||||
const CACHE = "pwabuilder-page";
|
|
||||||
|
|
||||||
const offlineFallbackPage = "/offline.html";
|
|
||||||
|
|
||||||
// Install stage sets up the offline page in the cache and opens a new cache
|
|
||||||
self.addEventListener("install", function (event) {
|
|
||||||
console.log("[PWA Builder] Install Event processing");
|
|
||||||
|
|
||||||
event.waitUntil(
|
|
||||||
caches.open(CACHE).then(function (cache) {
|
|
||||||
console.log("[PWA Builder] Cached offline page during install");
|
|
||||||
/*
|
|
||||||
if (offlineFallbackPage === "/html/offline.html") {
|
|
||||||
return cache.add(new Response("TODO: Update the value of the offlineFallbackPage constant in the serviceworker."));
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
return cache.add(offlineFallbackPage);
|
|
||||||
})
|
|
||||||
);
|
|
||||||
});
|
|
||||||
|
|
||||||
// If any fetch fails, it will show the offline page.
|
|
||||||
self.addEventListener("fetch", function (event) {
|
|
||||||
if (event.request.method !== "GET") return;
|
|
||||||
|
|
||||||
event.respondWith(
|
|
||||||
fetch(event.request).catch(function (error) {
|
|
||||||
// The following validates that the request was for a navigation to a new document
|
|
||||||
if (
|
|
||||||
event.request.destination !== "document" ||
|
|
||||||
event.request.mode !== "navigate"
|
|
||||||
) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
console.error("[PWA Builder] Network request Failed. Serving offline page " + error);
|
|
||||||
return caches.open(CACHE).then(function (cache) {
|
|
||||||
return cache.match(offlineFallbackPage);
|
|
||||||
});
|
|
||||||
})
|
|
||||||
);
|
|
||||||
});
|
|
||||||
|
|
||||||
// This is an event that can be fired from your page to tell the SW to update the offline page
|
|
||||||
self.addEventListener("refreshOffline", function () {
|
|
||||||
const offlinePageRequest = new Request(offlineFallbackPage);
|
|
||||||
|
|
||||||
return fetch(offlineFallbackPage).then(function (response) {
|
|
||||||
return caches.open(CACHE).then(function (cache) {
|
|
||||||
console.log("[PWA Builder] Offline page updated from refreshOffline event: " + response.url);
|
|
||||||
return cache.put(offlinePageRequest, response);
|
|
||||||
});
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
@ -13,7 +13,7 @@
|
|||||||
<link rel="icon" href="/static/images/icons/favicon.ico">
|
<link rel="icon" href="/static/images/icons/favicon.ico">
|
||||||
<link rel="icon" href="/static/images/icons/spider_ico_master.svg" type="image/svg+xml">
|
<link rel="icon" href="/static/images/icons/spider_ico_master.svg" type="image/svg+xml">
|
||||||
<link rel="apple-touch-icon" href="/static/images/icons/icon-apple.png">
|
<link rel="apple-touch-icon" href="/static/images/icons/icon-apple.png">
|
||||||
<link rel="manifest" href="/static/manifest.webmanifest">
|
<link rel="manifest" href="/static/pwa/manifest.webmanifest">
|
||||||
<link rel="stylesheet" href="/static/css/rel/style.min.css">
|
<link rel="stylesheet" href="/static/css/rel/style.min.css">
|
||||||
|
|
||||||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@5.2.3/dist/css/bootstrap.min.css"
|
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@5.2.3/dist/css/bootstrap.min.css"
|
||||||
|
@ -6,12 +6,6 @@
|
|||||||
{% endblock %}
|
{% endblock %}
|
||||||
{% block head %}
|
{% block head %}
|
||||||
{{ super() }}
|
{{ super() }}
|
||||||
<script defer src="https://cdnjs.cloudflare.com/ajax/libs/echarts/5.4.1/echarts.min.js"
|
|
||||||
integrity="sha512-OTbGFYPLe3jhy4bUwbB8nls0TFgz10kn0TLkmyA+l3FyivDs31zsXCjOis7YGDtE2Jsy0+fzW+3/OVoPVujPmQ=="
|
|
||||||
crossorigin="anonymous" referrerpolicy="no-referrer"></script>
|
|
||||||
<!--
|
|
||||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/echarts/5.4.1/echarts.js" integrity="sha512-ZYpFIosmEiTC+nL/30hJsFwTKXarRcUQeW1kV97gKOo6xzWhVzHwmEDLRMFceo9ALdXwyVLviVz6vm389kBexQ==" crossorigin="anonymous" referrerpolicy="no-referrer"></script>
|
|
||||||
-->
|
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|
||||||
</head>
|
</head>
|
||||||
@ -92,5 +86,8 @@ var band_frequencies={{bands["bands"]|tojson|safe}};
|
|||||||
|
|
||||||
{% block app_scripts %}
|
{% block app_scripts %}
|
||||||
{{ super() }}
|
{{ super() }}
|
||||||
|
<script defer src="https://cdnjs.cloudflare.com/ajax/libs/echarts/5.4.1/echarts.min.js"
|
||||||
|
integrity="sha512-OTbGFYPLe3jhy4bUwbB8nls0TFgz10kn0TLkmyA+l3FyivDs31zsXCjOis7YGDtE2Jsy0+fzW+3/OVoPVujPmQ=="
|
||||||
|
crossorigin="anonymous" referrerpolicy="no-referrer"></script>
|
||||||
<script defer src="static/js/rel/plot.min.js"></script>
|
<script defer src="static/js/rel/plot.min.js"></script>
|
||||||
{% endblock app_scripts %}
|
{% endblock app_scripts %}
|
@ -307,8 +307,7 @@ def spots():
|
|||||||
|
|
||||||
@app.route("/service-worker.js", methods=["GET"])
|
@app.route("/service-worker.js", methods=["GET"])
|
||||||
def sw():
|
def sw():
|
||||||
return app.send_static_file("service-worker.js")
|
return app.send_static_file("pwa/service-worker.js")
|
||||||
|
|
||||||
|
|
||||||
@app.route("/offline.html")
|
@app.route("/offline.html")
|
||||||
def root():
|
def root():
|
||||||
@ -471,7 +470,7 @@ def add_security_headers(resp):
|
|||||||
resp.headers["X-Frame-Options"] = "SAMEORIGIN"
|
resp.headers["X-Frame-Options"] = "SAMEORIGIN"
|
||||||
resp.headers["X-Content-Type-Options"] = "nosniff"
|
resp.headers["X-Content-Type-Options"] = "nosniff"
|
||||||
resp.headers["Referrer-Policy"] = "strict-origin-when-cross-origin"
|
resp.headers["Referrer-Policy"] = "strict-origin-when-cross-origin"
|
||||||
resp.headers["Cache-Control"] = "public, no-cache, no-store, must-revalidate"
|
resp.headers["Cache-Control"] = "public, no-cache, must-revalidate, max-age=604800"
|
||||||
resp.headers["Pragma"] = "no-cache"
|
resp.headers["Pragma"] = "no-cache"
|
||||||
|
|
||||||
resp.headers["Content-Security-Policy"] = "\
|
resp.headers["Content-Security-Policy"] = "\
|
||||||
|
Loading…
Reference in New Issue
Block a user