Update favicon and title in index.html; add leaf.svg for branding

This commit is contained in:
Salman Qureshi
2025-08-10 03:31:18 +05:30
parent 04332c3516
commit b8b562141e
3 changed files with 20 additions and 4 deletions

View File

@@ -2,9 +2,9 @@
<html lang="en">
<head>
<meta charset="UTF-8" />
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
<link rel="icon" type="image/svg+xml" href="/leaf.svg" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Vite + React</title>
<title>SeedBox Lite - Stream Torrents Instantly</title>
</head>
<body>
<div id="root"></div>

10
client/public/leaf.svg Normal file
View File

@@ -0,0 +1,10 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32" width="32" height="32">
<defs>
<linearGradient id="leafGradient" x1="0%" y1="0%" x2="100%" y2="100%">
<stop offset="0%" style="stop-color:#22c55e;stop-opacity:1" />
<stop offset="100%" style="stop-color:#16a34a;stop-opacity:1" />
</linearGradient>
</defs>
<path d="M8 24c0-8 4-12 12-14 2 8-2 12-8 14-2-2-4-4-4 0z" fill="url(#leafGradient)" stroke="#15803d" stroke-width="1"/>
<path d="M12 20c2-4 6-6 8-8" stroke="#15803d" stroke-width="1" fill="none"/>
</svg>

After

Width:  |  Height:  |  Size: 548 B

View File

@@ -1304,16 +1304,22 @@ app.get('/api/cache/stats', async (req, res) => {
return parseFloat((bytes / Math.pow(k, i)).toFixed(2)) + ' ' + sizes[i];
};
// Cache limit (5GB default)
const cacheLimitBytes = 5 * 1024 * 1024 * 1024; // 5GB in bytes
const usagePercentage = cacheLimitBytes > 0 ? (downloadedBytes / cacheLimitBytes) * 100 : 0;
const stats = {
totalSizeFormatted: formatBytes(downloadedBytes), // Use actual downloaded data
totalSize: downloadedBytes,
activeTorrents,
cacheSize: downloadedBytes, // Use downloaded bytes for cache calculation
totalTorrentSize: cacheSize, // Total size of all torrents
totalTorrentSizeFormatted: formatBytes(cacheSize)
totalTorrentSizeFormatted: formatBytes(cacheSize),
cacheLimitFormatted: formatBytes(cacheLimitBytes),
usagePercentage: Math.round(usagePercentage * 100) / 100 // Round to 2 decimal places
};
console.log(`📊 Cache stats: ${formatBytes(downloadedBytes)} downloaded (${activeTorrents} torrents, ${formatBytes(cacheSize)} total)`);
console.log(`📊 Cache stats: ${formatBytes(downloadedBytes)} downloaded (${activeTorrents} torrents, ${usagePercentage.toFixed(1)}% of 5GB limit)`);
res.json(stats);
} catch (error) {
console.error('Error getting cache stats:', error);