From 6d4b2abd33f0ac17042f37d5491611c3499ca6e0 Mon Sep 17 00:00:00 2001 From: Admin9705 <9705@duck.com> Date: Mon, 19 May 2025 11:16:54 -0400 Subject: [PATCH 1/4] refactor: update number formatting to use standard K/M/B/T suffixes instead of MIL/BIL/TRI --- frontend/static/js/new-main.js | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/frontend/static/js/new-main.js b/frontend/static/js/new-main.js index 2da053cb..d3fe6ae7 100644 --- a/frontend/static/js/new-main.js +++ b/frontend/static/js/new-main.js @@ -2069,7 +2069,7 @@ let huntarrUI = { }); }, - // Format large numbers with appropriate suffixes (K, MIL, BIL, TRI) + // Format large numbers with appropriate suffixes (K, M, B, T) formatLargeNumber: function(num) { if (num < 1000) { // 0-999: Display as is @@ -2084,20 +2084,20 @@ let huntarrUI = { // 100,000-999,999: Display with K (no decimal) (e.g., 982K) return Math.floor(num / 1000) + 'K'; } else if (num < 10000000) { - // 1,000,000-9,999,999: Display with single decimal and MIL (e.g., 9.7 MIL) - return (num / 1000000).toFixed(1) + ' MIL'; + // 1,000,000-9,999,999: Display with single decimal and M (e.g., 9.7M) + return (num / 1000000).toFixed(1) + 'M'; } else if (num < 100000000) { - // 10,000,000-99,999,999: Display with single decimal and MIL (e.g., 99.7 MIL) - return (num / 1000000).toFixed(1) + ' MIL'; + // 10,000,000-99,999,999: Display with single decimal and M (e.g., 99.7M) + return (num / 1000000).toFixed(1) + 'M'; } else if (num < 1000000000) { - // 100,000,000-999,999,999: Display with MIL (no decimal) - return Math.floor(num / 1000000) + ' MIL'; + // 100,000,000-999,999,999: Display with M (no decimal) + return Math.floor(num / 1000000) + 'M'; } else if (num < 1000000000000) { - // 1B - 999B: Display with single decimal and BIL - return (num / 1000000000).toFixed(1) + ' BIL'; + // 1B - 999B: Display with single decimal and B + return (num / 1000000000).toFixed(1) + 'B'; } else { - // 1T+: Display with TRI - return (num / 1000000000000).toFixed(1) + ' TRI'; + // 1T+: Display with T + return (num / 1000000000000).toFixed(1) + 'T'; } }, From 8e18156d92805fd5f39cad5bc2ef04f4798618c1 Mon Sep 17 00:00:00 2001 From: Admin9705 <9705@duck.com> Date: Mon, 19 May 2025 11:33:31 -0400 Subject: [PATCH 2/4] refactor: remove stats collection date from tooltips --- frontend/static/js/stats-tooltips.js | 4 ---- 1 file changed, 4 deletions(-) diff --git a/frontend/static/js/stats-tooltips.js b/frontend/static/js/stats-tooltips.js index 35c8eccf..4dcd6e9c 100644 --- a/frontend/static/js/stats-tooltips.js +++ b/frontend/static/js/stats-tooltips.js @@ -170,10 +170,6 @@ function showStatsTooltip(e) { Monthly average: ${monthlyAvg} - -
- Stats collected since: ${startTime.toLocaleDateString()} -
`; // Position tooltip initially From a4508c8c797d314b8ef47a9263ac6548b5b98b5f Mon Sep 17 00:00:00 2001 From: Admin9705 <9705@duck.com> Date: Mon, 19 May 2025 11:36:21 -0400 Subject: [PATCH 3/4] feat: expose raw stats data globally for more accurate tooltip values --- frontend/static/js/new-main.js | 4 ++++ frontend/static/js/stats-tooltips.js | 10 +++++++++- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/frontend/static/js/new-main.js b/frontend/static/js/new-main.js index d3fe6ae7..5a3d8540 100644 --- a/frontend/static/js/new-main.js +++ b/frontend/static/js/new-main.js @@ -2041,6 +2041,10 @@ let huntarrUI = { }) .then(data => { if (data.success && data.stats) { + // Store raw stats data globally for tooltips to access + window.mediaStats = data.stats; + + // Update display this.updateStatsDisplay(data.stats); } else { console.error('Failed to load statistics:', data.message || 'Unknown error'); diff --git a/frontend/static/js/stats-tooltips.js b/frontend/static/js/stats-tooltips.js index 4dcd6e9c..1a15b0e2 100644 --- a/frontend/static/js/stats-tooltips.js +++ b/frontend/static/js/stats-tooltips.js @@ -119,7 +119,15 @@ function showStatsTooltip(e) { const target = e.currentTarget; const app = target.getAttribute('data-app'); const type = target.getAttribute('data-type'); - const rawValue = parseInt(target.textContent.replace(/[^0-9]/g, '') || '0'); + + // Try to get exact value from API data if available via window.mediaStats + let rawValue; + if (window.mediaStats && window.mediaStats[app] && typeof window.mediaStats[app][type] !== 'undefined') { + rawValue = window.mediaStats[app][type]; + } else { + // Fallback to parsing from display text + rawValue = parseInt(target.textContent.replace(/[^0-9]/g, '') || '0'); + } // App-specific details with proper color coding const appDetails = { From 4d24894319305f278216521cef10ea398bc51d19 Mon Sep 17 00:00:00 2001 From: Admin9705 <9705@duck.com> Date: Mon, 19 May 2025 11:41:02 -0400 Subject: [PATCH 4/4] feat: hide deny symbols in circular progress indicators while keeping red circle --- frontend/static/css/hide-deny-icon.css | 17 +++++++++++++++++ frontend/templates/components/head.html | 1 + 2 files changed, 18 insertions(+) create mode 100644 frontend/static/css/hide-deny-icon.css diff --git a/frontend/static/css/hide-deny-icon.css b/frontend/static/css/hide-deny-icon.css new file mode 100644 index 00000000..4f89c381 --- /dev/null +++ b/frontend/static/css/hide-deny-icon.css @@ -0,0 +1,17 @@ +/** + * Hide deny symbol inside circular progress indicators + * This keeps the red circle but removes the minus/stop icon inside it + */ + +/* Hide the deny/minus symbol that's created by pseudo-elements */ +.hourly-cap-status.danger .hourly-cap-icon:before, +.hourly-cap-status.danger .hourly-cap-icon::before { + display: none !important; +} + +/* Also remove any other minus/stop symbols that might be in the SVG */ +.api-progress-circle .deny-symbol, +.api-progress-circle .stop-symbol, +.api-progress-circle .minus-symbol { + display: none !important; +} diff --git a/frontend/templates/components/head.html b/frontend/templates/components/head.html index bc906703..88f08e86 100644 --- a/frontend/templates/components/head.html +++ b/frontend/templates/components/head.html @@ -14,6 +14,7 @@ +