Added difficulty chart to mining dashboard
This commit is contained in:
parent
8f9804a996
commit
1c575f1c93
@ -1,11 +1,12 @@
|
||||
<div class="container-xl">
|
||||
<div class="main-title" i18n="mining.difficulty" *ngIf="widget">Difficulty (1y)</div>
|
||||
<div [class]="widget === false ? 'container-xl' : ''">
|
||||
|
||||
<div *ngIf="difficultyObservable$ | async" class="" echarts [initOpts]="chartInitOptions" [options]="chartOptions"></div>
|
||||
<div class="text-center loadingGraphs" *ngIf="isLoading">
|
||||
<div class="spinner-border text-light"></div>
|
||||
</div>
|
||||
|
||||
<div class="card-header mb-0 mb-lg-4">
|
||||
<div class="card-header mb-0 mb-lg-4" [style]="widget ? 'display:none' : ''">
|
||||
<form [formGroup]="radioGroupForm" class="formRadioGroup" *ngIf="(difficultyObservable$ | async) as diffChanges">
|
||||
<div class="btn-group btn-group-toggle" ngbRadioGroup name="radioBasic" formControlName="dateSpan">
|
||||
<label ngbButtonLabel class="btn-primary btn-sm" [routerLink]="['/mining/difficulty' | relativeUrl]" *ngIf="diffChanges.availableTimespanDay >= 90">
|
||||
@ -30,7 +31,7 @@
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<table class="table table-borderless table-sm text-center">
|
||||
<table class="table table-borderless table-sm text-center" *ngIf="!widget">
|
||||
<thead>
|
||||
<tr>
|
||||
<th i18n="mining.rank">Block</th>
|
||||
|
@ -0,0 +1,10 @@
|
||||
.main-title {
|
||||
position: relative;
|
||||
color: #ffffff91;
|
||||
margin-top: -13px;
|
||||
font-size: 10px;
|
||||
text-transform: uppercase;
|
||||
font-weight: 500;
|
||||
text-align: center;
|
||||
padding-bottom: 3px;
|
||||
}
|
@ -1,4 +1,4 @@
|
||||
import { Component, Inject, LOCALE_ID, OnInit } from '@angular/core';
|
||||
import { Component, Inject, Input, LOCALE_ID, OnInit } from '@angular/core';
|
||||
import { EChartsOption } from 'echarts';
|
||||
import { Observable } from 'rxjs';
|
||||
import { map, share, startWith, switchMap, tap } from 'rxjs/operators';
|
||||
@ -21,6 +21,8 @@ import { FormBuilder, FormGroup } from '@angular/forms';
|
||||
`],
|
||||
})
|
||||
export class DifficultyChartComponent implements OnInit {
|
||||
@Input() widget: boolean = false;
|
||||
|
||||
radioGroupForm: FormGroup;
|
||||
|
||||
chartOptions: EChartsOption = {};
|
||||
@ -99,7 +101,7 @@ export class DifficultyChartComponent implements OnInit {
|
||||
prepareChartOptions(data) {
|
||||
this.chartOptions = {
|
||||
title: {
|
||||
text: $localize`:@@mining.difficulty:Difficulty`,
|
||||
text: this.widget? '' : $localize`:@@mining.difficulty:Difficulty`,
|
||||
left: 'center',
|
||||
textStyle: {
|
||||
color: '#FFF',
|
||||
|
@ -26,8 +26,11 @@
|
||||
<div class="col">
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<app-difficulty [showProgress]=false [showHalving]=true></app-difficulty>
|
||||
Imagine more stuff down there
|
||||
<app-difficulty-chart [widget]=true></app-difficulty-chart>
|
||||
<div class=""><a href="" [routerLink]="['/mining/difficulty' | relativeUrl]" i18n="dashboard.view-more">View more
|
||||
»</a></div>
|
||||
<!-- <app-difficulty [showProgress]=false [showHalving]=true></app-difficulty>
|
||||
Imagine more stuff down there -->
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -31,7 +31,7 @@
|
||||
}
|
||||
}
|
||||
|
||||
.main-title {
|
||||
.main-title {
|
||||
position: relative;
|
||||
color: #ffffff91;
|
||||
margin-top: -13px;
|
||||
|
Loading…
x
Reference in New Issue
Block a user