Scale heat theme to real hashrate range
This commit is contained in:
@@ -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(() => {
|
||||
|
||||
Reference in New Issue
Block a user