Skip to content
Merged

Dev #468

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions frontend/static/css/hide-deny-icon.css
Original file line number Diff line number Diff line change
@@ -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;
}
26 changes: 15 additions & 11 deletions frontend/static/js/new-main.js
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand Down Expand Up @@ -2069,7 +2073,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
Expand All @@ -2084,20 +2088,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';
}
},

Expand Down
14 changes: 9 additions & 5 deletions frontend/static/js/stats-tooltips.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {
Expand Down Expand Up @@ -170,10 +178,6 @@ function showStatsTooltip(e) {
<span class="tooltip-label">Monthly average:</span>
<span class="tooltip-value">${monthlyAvg}</span>
</div>

<div class="tooltip-date">
Stats collected since: ${startTime.toLocaleDateString()}
</div>
`;

// Position tooltip initially
Expand Down
1 change: 1 addition & 0 deletions frontend/templates/components/head.html
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
<link rel="icon" href="/static/logo/16.png">
<link rel="stylesheet" href="/static/css/apps-double-scroll-fix.css">
<link rel="stylesheet" href="/static/css/responsive-fix.css">
<link rel="stylesheet" href="/static/css/hide-deny-icon.css">
<!-- Better logo visibility handling -->
<style>
.logo, .login-logo {
Expand Down
Loading