From 4142567d5b0541502fb30f38fdf52e8309c32227 Mon Sep 17 00:00:00 2001 From: Daniel Garcia Briseno Date: Thu, 26 Mar 2026 14:07:01 -0400 Subject: [PATCH 1/4] Add link to new dashboard to stats dashboard --- docroot/statistics/index.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/docroot/statistics/index.php b/docroot/statistics/index.php index cbe30746..ca684f7f 100644 --- a/docroot/statistics/index.php +++ b/docroot/statistics/index.php @@ -13,7 +13,7 @@ Helioviewer.org - Usage Statistics - + + diff --git a/docroot/statistics/statistics.css b/docroot/statistics/statistics.css index 90f7fd9e..84325479 100644 --- a/docroot/statistics/statistics.css +++ b/docroot/statistics/statistics.css @@ -51,6 +51,8 @@ body{font-family:Arial, Helvetica, sans-serif;} } +#dashboard-links { margin-top: 20px; font-size: 1.2em; } + @media screen and (max-width: 800px) { #header {font-size: 24px;} } diff --git a/docroot/statistics/statistics.php b/docroot/statistics/statistics.php new file mode 100644 index 00000000..d9fafd91 --- /dev/null +++ b/docroot/statistics/statistics.php @@ -0,0 +1,69 @@ + + + + + + Helioviewer.org - Statistics + + + + +
+ + +
+
Loading endpoints dashboard...
+
+
+ +
Loading movies dashboard...
+
+
+ +
Loading jhelioviewer dashboard...
+
+
+
+
+ + + + + + diff --git a/docroot/statistics/superset.css b/docroot/statistics/superset.css new file mode 100644 index 00000000..8f532602 --- /dev/null +++ b/docroot/statistics/superset.css @@ -0,0 +1,82 @@ +html, body { + height: 100%; + margin: 0; + padding: 0; + background-color: #1a1a1a; + color: #e0e0e0; +} +#main { + display: flex; + flex-direction: column; + height: 100vh; + background-color: #1a1a1a; +} +#header { + flex-shrink: 0; + background-color: #2a2a2a; + padding: 5px 10px; + display: flex; + align-items: center; + gap: 10px; +} +#header img { + height: 30px; + width: auto; +} +#headerText { + color: #e0e0e0; + font-size: 14px; + margin: 0; +} +.dashboard-box { + text-align: center; + width: 100%; + height: 100%; + display: flex; + flex-direction: column; + justify-content: space-between; +} +.dashboard { + flex: 1; + display: flex; + flex-direction: column; + width: 100vw; + min-height: 0; + margin: 0; + padding: 0; +} +.dashboard iframe { + width: 100%; + height: 100%; + border: none; + display: block; +} +.error { + display: none; + padding: 10px; + margin: 10px; + background-color: #5c1c1c; + color: #ff8a80; + border-radius: 4px; +} +.loader { + padding: 10px; + margin: 10px; + text-align: center; + font-size: 14px; + color: #e0e0e0; + animation-name: wiggle; + animation-duration: 1s; + animation-direction: alternate-reverse; + animation-iteration-count: infinite; + animation-timing-function: ease-in-out; +} +@keyframes wiggle { + from { + transform: translateX(-10px); + } + to { + transform: translateX(10px); + } +} + diff --git a/docroot/statistics/superset.js b/docroot/statistics/superset.js index d50b5f4e..f296e229 100644 --- a/docroot/statistics/superset.js +++ b/docroot/statistics/superset.js @@ -27,7 +27,7 @@ async function fetchGuestToken(guest_token_url, dashboard_id) { } } -async function embedDashboard(dashboard_container, loading_element, error_div, superset_url, getGuestToken) { +async function embedDashboard(id, dashboard_container, loading_element, error_div, superset_url, getGuestToken) { try { const guestToken = await getGuestToken(); @@ -36,7 +36,7 @@ async function embedDashboard(dashboard_container, loading_element, error_div, s // Embed the dashboard supersetEmbeddedSdk.embedDashboard({ - id: DASHBOARD_ID, + id: id, supersetDomain: superset_url, mountPoint: dashboard_container, fetchGuestToken: () => guestToken, diff --git a/settings/Config.Example.ini b/settings/Config.Example.ini index 6d943c98..58e74f3c 100644 --- a/settings/Config.Example.ini +++ b/settings/Config.Example.ini @@ -197,3 +197,6 @@ coordinator_url = 'http://coordinator' superset_url = 'http://localhost:8088' superset_sidecar_url = 'http://localhost:8087' superset_coverage_dashboard_id = 'your-dashboard-id-here' +superset_statistics_dashboard_id = 'your-dashboard-id-here' +superset_movies_dashboard_id = 'your-dashboard-id-here' +superset_movies_jpx_dashboard_id = 'your-dashboard-id-here' From 41998054ab77553e11a49e2f4f17025bfcbf31e8 Mon Sep 17 00:00:00 2001 From: Daniel Garcia Briseno Date: Fri, 27 Mar 2026 11:32:26 -0400 Subject: [PATCH 4/4] Add tabs for statistics charts --- docroot/statistics/statistics.php | 41 +++++++++++++++++++++++-------- docroot/statistics/superset.css | 39 ++++++++++++++++++++++++++--- 2 files changed, 67 insertions(+), 13 deletions(-) diff --git a/docroot/statistics/statistics.php b/docroot/statistics/statistics.php index d9fafd91..81e1a65b 100644 --- a/docroot/statistics/statistics.php +++ b/docroot/statistics/statistics.php @@ -14,21 +14,33 @@
+ +
+ + +
-
Loading endpoints dashboard...
-
-
+
+
Loading endpoints dashboard...
+
+
+
-
Loading movies dashboard...
-
-
+
+
Loading movies dashboard...
+
+
+
-
Loading jhelioviewer dashboard...
-
-
+
+
Loading jhelioviewer dashboard...
+
+
+
@@ -64,6 +76,15 @@ () => fetchGuestToken(GUEST_TOKEN_URL, dashboard.id) ) }); + + document.querySelectorAll('.tab').forEach((tab) => { + tab.addEventListener('click', () => { + document.querySelectorAll('.tab').forEach(t => t.classList.remove('active')); + document.querySelectorAll('.tab-panel').forEach(p => p.classList.remove('active')); + tab.classList.add('active'); + document.getElementById(tab.dataset.tab + '-tab').classList.add('active'); + }); + }); diff --git a/docroot/statistics/superset.css b/docroot/statistics/superset.css index 8f532602..43923e0f 100644 --- a/docroot/statistics/superset.css +++ b/docroot/statistics/superset.css @@ -28,13 +28,46 @@ html, body { font-size: 14px; margin: 0; } +#tab-bar { + flex-shrink: 0; + display: flex; + background-color: #2a2a2a; + border-bottom: 2px solid #444; +} +.tab { + padding: 8px 20px; + background: none; + border: none; + color: #aaa; + font-size: 14px; + cursor: pointer; +} +.tab:hover { + color: #e0e0e0; + background-color: #333; +} +.tab.active { + color: #fff; + border-bottom: 2px solid #4da6ff; + margin-bottom: -2px; +} +.tab-panel { + display: none; + flex: 1; + min-height: 0; +} +.tab-panel.active { + display: flex; + flex-direction: column; + flex: 1; + min-height: 0; +} .dashboard-box { - text-align: center; + flex: 1; + min-height: 0; width: 100%; - height: 100%; display: flex; flex-direction: column; - justify-content: space-between; } .dashboard { flex: 1;