From 1a767244a4c2925daf4a81f8ce61742ad51c1ade Mon Sep 17 00:00:00 2001 From: Florent Morselli Date: Fri, 5 Apr 2024 13:15:10 +0200 Subject: [PATCH] Implement PWA Collector and additional viewing templates Implemented a new Progressive Web App (PWA) Collector to fetch and manage service worker and manifest details. Additionally, created multiple HTML templates for manifest, service worker, and other PWA tabs to properly display the collected data in UI. --- .../Collector/serviceworker-tab.html.twig | 2 +- templates/Collector/template.html.twig | 44 ++++++++++++++----- 2 files changed, 33 insertions(+), 13 deletions(-) diff --git a/templates/Collector/serviceworker-tab.html.twig b/templates/Collector/serviceworker-tab.html.twig index ab7fc87..af145d1 100644 --- a/templates/Collector/serviceworker-tab.html.twig +++ b/templates/Collector/serviceworker-tab.html.twig @@ -32,7 +32,7 @@

Workbox

Status: {% if collector.workbox.enabled %} - enabled! + enabled {% else %} disabled {% endif %} diff --git a/templates/Collector/template.html.twig b/templates/Collector/template.html.twig index 354c3db..5ab231d 100644 --- a/templates/Collector/template.html.twig +++ b/templates/Collector/template.html.twig @@ -8,6 +8,28 @@ {% set text %}

+ Manifest + {% if collector.data.manifest.enabled %} + Enabled + {% else %} + Disabled + {% endif %} +
+
+ Service worker + {% if collector.data.serviceWorker.enabled %} + Enabled + {% else %} + Disabled + {% endif %} +
+
+ └ Workbox + {% if collector.workbox.enabled %} + Enabled + {% else %} + Disabled + {% endif %}
{% endset %} @@ -15,19 +37,7 @@ {% endblock %} {% block head %} - {# Optional. Here you can link to or define your own CSS and JS contents. #} - {# Use {{ parent() }} to extend the default styles instead of overriding them. #} {{ parent() }} -{% endblock %} - -{% block menu %} - - {{ source('@SpomkyLabsPwa/Collector/pwa.svg') }} - PWA - -{% endblock %} - -{% block panel %} +{% endblock %} + +{% block menu %} + + {{ source('@SpomkyLabsPwa/Collector/pwa.svg') }} + PWA + +{% endblock %} + +{% block panel %}

Progressive Web App