Skip to content

Commit 93c315b

Browse files
authored
Merge pull request #468 from plexguide/dev
Dev
2 parents 149d7d7 + 4d24894 commit 93c315b

File tree

4 files changed

+42
-16
lines changed

4 files changed

+42
-16
lines changed
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
/**
2+
* Hide deny symbol inside circular progress indicators
3+
* This keeps the red circle but removes the minus/stop icon inside it
4+
*/
5+
6+
/* Hide the deny/minus symbol that's created by pseudo-elements */
7+
.hourly-cap-status.danger .hourly-cap-icon:before,
8+
.hourly-cap-status.danger .hourly-cap-icon::before {
9+
display: none !important;
10+
}
11+
12+
/* Also remove any other minus/stop symbols that might be in the SVG */
13+
.api-progress-circle .deny-symbol,
14+
.api-progress-circle .stop-symbol,
15+
.api-progress-circle .minus-symbol {
16+
display: none !important;
17+
}

frontend/static/js/new-main.js

Lines changed: 15 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2041,6 +2041,10 @@ let huntarrUI = {
20412041
})
20422042
.then(data => {
20432043
if (data.success && data.stats) {
2044+
// Store raw stats data globally for tooltips to access
2045+
window.mediaStats = data.stats;
2046+
2047+
// Update display
20442048
this.updateStatsDisplay(data.stats);
20452049
} else {
20462050
console.error('Failed to load statistics:', data.message || 'Unknown error');
@@ -2069,7 +2073,7 @@ let huntarrUI = {
20692073
});
20702074
},
20712075

2072-
// Format large numbers with appropriate suffixes (K, MIL, BIL, TRI)
2076+
// Format large numbers with appropriate suffixes (K, M, B, T)
20732077
formatLargeNumber: function(num) {
20742078
if (num < 1000) {
20752079
// 0-999: Display as is
@@ -2084,20 +2088,20 @@ let huntarrUI = {
20842088
// 100,000-999,999: Display with K (no decimal) (e.g., 982K)
20852089
return Math.floor(num / 1000) + 'K';
20862090
} else if (num < 10000000) {
2087-
// 1,000,000-9,999,999: Display with single decimal and MIL (e.g., 9.7 MIL)
2088-
return (num / 1000000).toFixed(1) + ' MIL';
2091+
// 1,000,000-9,999,999: Display with single decimal and M (e.g., 9.7M)
2092+
return (num / 1000000).toFixed(1) + 'M';
20892093
} else if (num < 100000000) {
2090-
// 10,000,000-99,999,999: Display with single decimal and MIL (e.g., 99.7 MIL)
2091-
return (num / 1000000).toFixed(1) + ' MIL';
2094+
// 10,000,000-99,999,999: Display with single decimal and M (e.g., 99.7M)
2095+
return (num / 1000000).toFixed(1) + 'M';
20922096
} else if (num < 1000000000) {
2093-
// 100,000,000-999,999,999: Display with MIL (no decimal)
2094-
return Math.floor(num / 1000000) + ' MIL';
2097+
// 100,000,000-999,999,999: Display with M (no decimal)
2098+
return Math.floor(num / 1000000) + 'M';
20952099
} else if (num < 1000000000000) {
2096-
// 1B - 999B: Display with single decimal and BIL
2097-
return (num / 1000000000).toFixed(1) + ' BIL';
2100+
// 1B - 999B: Display with single decimal and B
2101+
return (num / 1000000000).toFixed(1) + 'B';
20982102
} else {
2099-
// 1T+: Display with TRI
2100-
return (num / 1000000000000).toFixed(1) + ' TRI';
2103+
// 1T+: Display with T
2104+
return (num / 1000000000000).toFixed(1) + 'T';
21012105
}
21022106
},
21032107

frontend/static/js/stats-tooltips.js

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,15 @@ function showStatsTooltip(e) {
119119
const target = e.currentTarget;
120120
const app = target.getAttribute('data-app');
121121
const type = target.getAttribute('data-type');
122-
const rawValue = parseInt(target.textContent.replace(/[^0-9]/g, '') || '0');
122+
123+
// Try to get exact value from API data if available via window.mediaStats
124+
let rawValue;
125+
if (window.mediaStats && window.mediaStats[app] && typeof window.mediaStats[app][type] !== 'undefined') {
126+
rawValue = window.mediaStats[app][type];
127+
} else {
128+
// Fallback to parsing from display text
129+
rawValue = parseInt(target.textContent.replace(/[^0-9]/g, '') || '0');
130+
}
123131

124132
// App-specific details with proper color coding
125133
const appDetails = {
@@ -170,10 +178,6 @@ function showStatsTooltip(e) {
170178
<span class="tooltip-label">Monthly average:</span>
171179
<span class="tooltip-value">${monthlyAvg}</span>
172180
</div>
173-
174-
<div class="tooltip-date">
175-
Stats collected since: ${startTime.toLocaleDateString()}
176-
</div>
177181
`;
178182

179183
// Position tooltip initially

frontend/templates/components/head.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
<link rel="icon" href="/static/logo/16.png">
1515
<link rel="stylesheet" href="/static/css/apps-double-scroll-fix.css">
1616
<link rel="stylesheet" href="/static/css/responsive-fix.css">
17+
<link rel="stylesheet" href="/static/css/hide-deny-icon.css">
1718
<!-- Better logo visibility handling -->
1819
<style>
1920
.logo, .login-logo {

0 commit comments

Comments
 (0)