Simplify pool details table

This commit is contained in:
Mononaut 2024-03-15 07:40:44 +00:00
parent c12e664b9a
commit 120ffdb0f4
No known key found for this signature in database
GPG Key ID: A3F058E41374C04E

View File

@ -85,10 +85,9 @@
<div class="col-lg-6">
<table class="table table-borderless table-striped">
<tbody>
<!-- Hashrate desktop -->
<tr *ngIf="!isMobile()" class="taller-row">
<td class="data">
<!-- Hashrate -->
<tr [class.taller-row]="!isMobile()">
<td [class.data]="!isMobile()" [attr.colspan]="isMobile() ? 2 : 1">
<table class="table table-xs table-data">
<thead>
<tr>
@ -111,57 +110,10 @@
</table>
</td>
</tr>
<!-- Hashrate mobile -->
<tr *ngIf="isMobile()">
<td colspan="2">
<table class="table table-xs table-data">
<thead>
<tr>
<th scope="col" class="data-title clip text-center" style="width: 33%" i18n="mining.reward">Reward</th>
<th scope="col" class="data-title clip text-center" style="width: 33%" i18n="mining.hashrate">Hashrate (24h)</th>
<th scope="col" class="data-title clip text-center" style="width: 33%" i18n="latest-blocks.avg_health" *ngIf="auditAvailable">Avg Health</th>
</tr>
</thead>
<tbody>
<td class="text-center"><app-amount [satoshis]="poolStats.totalReward" digitsInfo="1.0-0" [noFiat]="true"></app-amount></td>
<td class="text-center">{{ poolStats.estimatedHashrate | amountShortener : 1 : 'H/s' }}</td>
<td *ngIf="auditAvailable; else emptyTd" class="text-center"><span class="health-badge badge" [class.badge-success]="poolStats.avgBlockHealth >= 99"
[class.badge-warning]="poolStats.avgBlockHealth >= 75 && poolStats.avgBlockHealth < 99" [class.badge-danger]="poolStats.avgBlockHealth < 75"
*ngIf="poolStats.avgBlockHealth != null; else nullHealth">{{ poolStats.avgBlockHealth }}%</span>
<ng-template #nullHealth>
<span class="health-badge badge badge-secondary" i18n="unknown">Unknown</span>
</ng-template>
</td>
</tbody>
</table>
</td>
</tr>
<!-- Mined blocks desktop -->
<tr *ngIf="!isMobile()" class="taller-row">
<td class="data">
<table class="table table-xs table-data">
<thead>
<tr>
<th scope="col" class="data-title text-center" style="width: 33%" i18n="24h">Blocks (24h)</th>
<th scope="col" class="data-title text-center" style="width: 33%" i18n="1w">1w</th>
<th scope="col" class="data-title text-center" style="width: 33%" i18n="all">All</th>
</tr>
</thead>
<tbody>
<td class="text-center">{{ formatNumber(poolStats.blockCount['24h'], this.locale, '1.0-0') }} ({{ formatNumber(100 *
poolStats.blockShare['24h'], this.locale, '1.0-0') }}%)</td>
<td class="text-center">{{ formatNumber(poolStats.blockCount['1w'], this.locale, '1.0-0') }} ({{ formatNumber(100 *
poolStats.blockShare['1w'], this.locale, '1.0-0') }}%)</td>
<td class="text-center">{{ formatNumber(poolStats.blockCount['all'], this.locale, '1.0-0') }} ({{ formatNumber(100 *
poolStats.blockShare['all'], this.locale, '1.0-0') }}%)</td>
</tbody>
</table>
</td>
</tr>
<!-- Mined blocks mobile -->
<tr *ngIf="isMobile()">
<td colspan=2>
<!-- Mined blocks -->
<tr [class.taller-row]="!isMobile()">
<td [class.data]="!isMobile()" [attr.colspan]="isMobile() ? 2 : 1">
<table class="table table-xs table-data">
<thead>
<tr>