Refine built-in web app experience

This commit is contained in:
Artem Kokos
2026-05-21 21:47:33 +07:00
parent 61b21c63ea
commit f55e00bce1
11 changed files with 1320 additions and 456 deletions

View File

@@ -30,7 +30,10 @@ class UiSecurityTests(unittest.IsolatedAsyncioTestCase):
self.assertEqual(response.headers["x-content-type-options"], "nosniff")
self.assertEqual(response.headers["x-frame-options"], "DENY")
self.assertIn("default-src 'self'", response.headers["content-security-policy"])
self.assertIn("script-src 'self' 'unsafe-eval'", response.headers["content-security-policy"])
self.assertIn(
"script-src 'self' 'unsafe-eval'",
response.headers["content-security-policy"],
)
self.assertIn(
"style-src 'self' 'unsafe-inline'",
response.headers["content-security-policy"],
@@ -40,10 +43,10 @@ class UiSecurityTests(unittest.IsolatedAsyncioTestCase):
index_html = Path("static/index.html").read_text(encoding="utf-8")
app_js = Path("static/app.js").read_text(encoding="utf-8")
self.assertIn('/static/vendor/tailwindcdn.js', index_html)
self.assertIn('/static/ui.css', index_html)
self.assertIn('/static/vendor/vue.global.prod.js', index_html)
self.assertIn('/static/app.js', index_html)
self.assertIn("/static/vendor/tailwindcdn.js", index_html)
self.assertIn("/static/ui.css", index_html)
self.assertIn("/static/vendor/vue.global.prod.js", index_html)
self.assertIn("/static/app.js", index_html)
self.assertNotIn("https://unpkg.com", index_html)
self.assertNotIn("https://cdn.tailwindcss.com", index_html)
self.assertNotIn("https://fonts.googleapis.com", index_html)
@@ -52,6 +55,12 @@ class UiSecurityTests(unittest.IsolatedAsyncioTestCase):
self.assertIn("sessionStorage", app_js)
self.assertIn("/system/info", app_js)
self.assertIn("serverInfo", app_js)
self.assertIn("Комнаты, сцены и свет", index_html)
self.assertIn("Устройства и группы", index_html)
self.assertIn("Собрать комнату из найденных ламп", index_html)
self.assertIn("Повторяющееся расписание", index_html)
self.assertIn("Гостевые и админ-ключи", index_html)
self.assertIn("О сервере", index_html)
self.assertIn("СЕРВЕР", index_html)
self.assertIn("Запущен", index_html)
self.assertNotIn("ОБЗОР", index_html)
self.assertNotIn("tab === 'overview'", app_js)