82 lines
3.8 KiB
HTML
82 lines
3.8 KiB
HTML
<app-indexing-progress *ngIf="!widget"></app-indexing-progress>
|
|
|
|
<div [class]="widget === false ? 'full-container' : ''">
|
|
|
|
<div *ngIf="widget">
|
|
<div class="pool-distribution" *ngIf="(hashrateObservable$ | async) as hashrates; else loadingStats">
|
|
<div class="item">
|
|
<h5 class="card-title" i18n="mining.hashrate">Hashrate</h5>
|
|
<p class="card-text">
|
|
{{ hashrates.currentHashrate | amountShortener: 1 : 'H/s' }}
|
|
</p>
|
|
</div>
|
|
<div class="item">
|
|
<h5 class="card-title" i18n="block.difficulty">Difficulty</h5>
|
|
<p class="card-text" *ngIf="network === 'signet'">
|
|
{{ hashrates.currentDifficulty | amountShortener : 5 }}
|
|
</p>
|
|
<p class="card-text" *ngIf="network !== 'signet'">
|
|
{{ hashrates.currentDifficulty | amountShortener : 2 }}
|
|
</p>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="card-header mb-0 mb-md-4" [style]="widget ? 'display:none' : ''">
|
|
<div class="d-flex d-md-block align-items-baseline">
|
|
<span i18n="mining.hashrate-difficulty">Hashrate & Difficulty</span>
|
|
<button class="btn p-0 pl-2" style="margin: 0 0 4px 0px" (click)="onSaveChart()">
|
|
<fa-icon [icon]="['fas', 'download']" [fixedWidth]="true"></fa-icon>
|
|
</button>
|
|
</div>
|
|
|
|
<form [formGroup]="radioGroupForm" class="formRadioGroup" *ngIf="(hashrateObservable$ | async) as stats">
|
|
<div class="btn-group btn-group-toggle" ngbRadioGroup name="radioBasic" formControlName="dateSpan">
|
|
<label ngbButtonLabel class="btn-primary btn-sm" *ngIf="stats.blockCount >= 12960">
|
|
<input ngbButton type="radio" [value]="'3m'" fragment="3m" [routerLink]="['/graphs/mining/hashrate-difficulty' | relativeUrl]" [attr.data-cy]="'3m'"> 3M
|
|
</label>
|
|
<label ngbButtonLabel class="btn-primary btn-sm" *ngIf="stats.blockCount >= 25920">
|
|
<input ngbButton type="radio" [value]="'6m'" fragment="6m" [routerLink]="['/graphs/mining/hashrate-difficulty' | relativeUrl]" [attr.data-cy]="'6m'"> 6M
|
|
</label>
|
|
<label ngbButtonLabel class="btn-primary btn-sm" *ngIf="stats.blockCount >= 52560">
|
|
<input ngbButton type="radio" [value]="'1y'" fragment="1y" [routerLink]="['/graphs/mining/hashrate-difficulty' | relativeUrl]" [attr.data-cy]="'1y'"> 1Y
|
|
</label>
|
|
<label ngbButtonLabel class="btn-primary btn-sm" *ngIf="stats.blockCount >= 105120">
|
|
<input ngbButton type="radio" [value]="'2y'" fragment="2y" [routerLink]="['/graphs/mining/hashrate-difficulty' | relativeUrl]" [attr.data-cy]="'2y'"> 2Y
|
|
</label>
|
|
<label ngbButtonLabel class="btn-primary btn-sm" *ngIf="stats.blockCount >= 157680">
|
|
<input ngbButton type="radio" [value]="'3y'" fragment="3y" [routerLink]="['/graphs/mining/hashrate-difficulty' | relativeUrl]" [attr.data-cy]="'3y'"> 3Y
|
|
</label>
|
|
<label ngbButtonLabel class="btn-primary btn-sm">
|
|
<input ngbButton type="radio" [value]="'all'" fragment="all" [routerLink]="['/graphs/mining/hashrate-difficulty' | relativeUrl]" [attr.data-cy]="'all'"> ALL
|
|
</label>
|
|
</div>
|
|
</form>
|
|
</div>
|
|
|
|
<div [class]="!widget ? 'chart' : 'chart-widget'" echarts [initOpts]="chartInitOptions" [options]="chartOptions"
|
|
(chartInit)="onChartInit($event)">
|
|
</div>
|
|
<div class="text-center loadingGraphs" *ngIf="isLoading">
|
|
<div class="spinner-border text-light"></div>
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<ng-template #loadingStats>
|
|
<div class="pool-distribution">
|
|
<div class="item">
|
|
<h5 class="card-title" i18n="mining.hashrate">Hashrate</h5>
|
|
<p class="card-text">
|
|
<span class="skeleton-loader skeleton-loader-big"></span>
|
|
</p>
|
|
</div>
|
|
<div class="item">
|
|
<h5 class="card-title" i18n="block.difficulty">Difficulty</h5>
|
|
<p class="card-text">
|
|
<span class="skeleton-loader skeleton-loader-big"></span>
|
|
</p>
|
|
</div>
|
|
</div>
|
|
</ng-template>
|