Scale heat theme to real hashrate range

This commit is contained in:
Dorian
2026-05-06 19:30:36 +01:00
parent 243cd0daf3
commit 7e1f7a1a4b

View File

@@ -8,12 +8,11 @@ const auth = useAuthStore();
const stats = useStatsStore();
const route = useRoute();
const crt = ref(false);
const LOW_HASHRATE_THS = 10;
const TOP_HASHRATE_THS = 70;
const heatLevel = computed(() => {
const snap = stats.snapshot;
if (!snap?.miners.length) return 0;
const expected = snap.miners.reduce((sum, m) => sum + m.expectedHashrateThs, 0);
if (expected <= 0) return 0;
return Math.max(0, Math.min(1, snap.pool.combinedHashrateThs / expected));
const total = stats.snapshot?.pool.combinedHashrateThs ?? 0;
return Math.max(0, Math.min(1, (total - LOW_HASHRATE_THS) / (TOP_HASHRATE_THS - LOW_HASHRATE_THS)));
});
onMounted(() => {