Replace difficulty adjustment timestamp with block height

This commit is contained in:
nymkappa 2022-03-07 18:06:07 +01:00
parent 5d16a30cf2
commit b7254e7aca
No known key found for this signature in database
GPG Key ID: E155910B16E8BD04
4 changed files with 60 additions and 26 deletions

View File

@ -31,25 +31,23 @@
<div class="spinner-border text-light"></div> <div class="spinner-border text-light"></div>
</div> </div>
<div [class]="!widget ? 'mt-3 p-2' : 'ml-4 mr-4 mt-1'" *ngIf="tableOnly" style="min-height: 295px"> <table *ngIf="tableOnly" class="table latest-transactions" style="min-height: 295px">
<table class="table table-borderless table-sm text-left" [class]="widget ? 'compact' : ''"> <thead>
<thead> <tr>
<tr> <th class="d-none d-md-block" i18n="block.height">Height</th>
<th class="d-none d-md-block" i18n="block.timestamp">Timestamp</th> <th i18n="mining.adjusted" class="text-left">Adjusted</th>
<th i18n="mining.adjusted">Adjusted</th> <th i18n="mining.difficulty" class="text-right">Difficulty</th>
<th i18n="mining.difficulty" class="text-right">Difficulty</th> <th i18n="mining.change" class="text-right">Change</th>
<th i18n="mining.change" class="text-right">Change</th> </tr>
</tr> </thead>
</thead> <tbody *ngIf="(hashrateObservable$ | async) as data">
<tbody *ngIf="(hashrateObservable$ | async) as data"> <tr *ngFor="let diffChange of data.difficulty">
<tr *ngFor="let diffChange of data.difficulty"> <td class="d-none d-md-block"><a [routerLink]="['/block' | relativeUrl, diffChange.height]">{{ diffChange.height }}</a></td>
<td class="d-none d-md-block">&lrm;{{ diffChange.timestamp * 1000 | date:'yyyy-MM-dd HH:mm' }}</td> <td class="text-left"><app-time-since [time]="diffChange.timestamp" [fastRender]="true"></app-time-since></td>
<td><app-time-since [time]="diffChange.timestamp" [fastRender]="true"></app-time-since></td> <td class="text-right">{{ diffChange.difficultyShorten }}</td>
<td class="text-right">{{ diffChange.difficultyShorten }}</td> <td class="text-right" [style]="diffChange.change >= 0 ? 'color: #42B747' : 'color: #B74242'">{{ formatNumber(diffChange.change, locale, '1.2-2') }}%</td>
<td class="text-right" [style]="diffChange.change >= 0 ? 'color: #42B747' : 'color: #B74242'">{{ formatNumber(diffChange.change, locale, '1.2-2') }}%</td> </tr>
</tr> </tbody>
</tbody> </table>
</table>
</div>
</div> </div>

View File

@ -49,7 +49,43 @@
} }
} }
.compact td { .latest-transactions {
padding: 0 !important; width: 100%;
margin: 0.15rem !important; text-align: left;
table-layout:fixed;
tr, td, th {
border: 0px;
}
td {
width: 25%;
}
.table-cell-satoshis {
display: none;
text-align: right;
@media (min-width: 576px) {
display: table-cell;
}
@media (min-width: 768px) {
display: none;
}
@media (min-width: 1100px) {
display: table-cell;
}
}
.table-cell-fiat {
display: none;
text-align: right;
@media (min-width: 485px) {
display: table-cell;
}
@media (min-width: 768px) {
display: none;
}
@media (min-width: 992px) {
display: table-cell;
}
}
.table-cell-fees {
text-align: right;
}
} }

View File

@ -115,7 +115,7 @@ export class HashrateChartComponent implements OnInit {
} }
return { return {
availableTimespanDay: availableTimespanDay, availableTimespanDay: availableTimespanDay,
difficulty: this.tableOnly ? (this.isMobile() ? tableData.slice(0, 12) : tableData.slice(0, 9)) : tableData difficulty: this.tableOnly ? tableData.slice(0, 5) : tableData
}; };
}), }),
); );

View File

@ -112,7 +112,7 @@
<div class="card" style="height: 385px"> <div class="card" style="height: 385px">
<div class="card-body"> <div class="card-body">
<h5 class="card-title"> <h5 class="card-title">
Adjusments Adjustments
</h5> </h5>
<app-hashrate-chart [tableOnly]=true [widget]=true></app-hashrate-chart> <app-hashrate-chart [tableOnly]=true [widget]=true></app-hashrate-chart>
<div class="mt-1"><a [routerLink]="['/mining/hashrate' | relativeUrl]" i18n="dashboard.view-more">View more <div class="mt-1"><a [routerLink]="['/mining/hashrate' | relativeUrl]" i18n="dashboard.view-more">View more