diff options
| -rw-r--r-- | static/icon-192.png | bin | 0 -> 936 bytes | |||
| -rw-r--r-- | static/icon-512.png | bin | 0 -> 3206 bytes | |||
| -rw-r--r-- | static/index.html | 3 | ||||
| -rw-r--r-- | static/manifest.json | 14 | ||||
| -rw-r--r-- | tests/test_frontend.py | 9 |
5 files changed, 26 insertions, 0 deletions
diff --git a/static/icon-192.png b/static/icon-192.png Binary files differnew file mode 100644 index 0000000..30e1c5d --- /dev/null +++ b/static/icon-192.png diff --git a/static/icon-512.png b/static/icon-512.png Binary files differnew file mode 100644 index 0000000..8126f4d --- /dev/null +++ b/static/icon-512.png diff --git a/static/index.html b/static/index.html index 958580f..434e496 100644 --- a/static/index.html +++ b/static/index.html @@ -8,6 +8,9 @@ <meta name="apple-mobile-web-app-status-bar-style" content="black-translucent"> <meta name="apple-mobile-web-app-title" content="deck-it"> <meta name="theme-color" content="#24273a"> +<link rel="manifest" href="manifest.json"> +<link rel="icon" href="icon-192.png"> +<link rel="apple-touch-icon" href="icon-192.png"> <link rel="stylesheet" href="vendor/gridstack/gridstack.min.css"> <link rel="stylesheet" href="theme.css"> <link rel="stylesheet" href="deck.css"> diff --git a/static/manifest.json b/static/manifest.json new file mode 100644 index 0000000..1813283 --- /dev/null +++ b/static/manifest.json @@ -0,0 +1,14 @@ +{ + "name": "deck-it", + "short_name": "deck-it", + "description": "Tablet dashboard and stream-deck for this desktop.", + "start_url": "./", + "scope": "./", + "display": "fullscreen", + "background_color": "#24273a", + "theme_color": "#24273a", + "icons": [ + { "src": "icon-192.png", "sizes": "192x192", "type": "image/png" }, + { "src": "icon-512.png", "sizes": "512x512", "type": "image/png" } + ] +} diff --git a/tests/test_frontend.py b/tests/test_frontend.py index d86468d..1111f89 100644 --- a/tests/test_frontend.py +++ b/tests/test_frontend.py @@ -4,6 +4,7 @@ from pathlib import Path sys.path.insert(0, str(Path(__file__).resolve().parent.parent)) import http.client +import json import os import socket import tempfile @@ -55,6 +56,14 @@ class Frontend(unittest.TestCase): for asset in ("app.js", "deck.css", "vendor/gridstack/gridstack-all.js"): self.assertIn(asset, text) + def test_pwa_manifest(self): + self.assertIn(b'rel="manifest"', self.get("/")[1]) + manifest = json.loads(self.get("/manifest.json")[1]) + self.assertEqual(manifest["display"], "fullscreen") + self.assertEqual(manifest["start_url"], "./") + for size in (192, 512): + self.assertEqual(self.get(f"/icon-{size}.png")[0], 200) + def test_vendor_assets_served(self): for path in ("/vendor/gridstack/gridstack-all.js", "/vendor/gridstack/gridstack.min.css"): self.assertEqual(self.get(path)[0], 200, path) |
