Add difficulty adjustment table in mining dashboard
This commit is contained in:
		
							parent
							
								
									f8117f9888
								
							
						
					
					
						commit
						dd37a99b39
					
				@ -1,6 +1,6 @@
 | 
			
		||||
<div [class]="widget === false ? 'full-container' : ''">
 | 
			
		||||
 | 
			
		||||
  <div class="card-header mb-0 mb-md-4" [style]="widget ? 'display:none' : ''">
 | 
			
		||||
  <div *ngIf="!tableOnly" class="card-header mb-0 mb-md-4" [style]="widget ? 'display:none' : ''">
 | 
			
		||||
    <form [formGroup]="radioGroupForm" class="formRadioGroup" *ngIf="(hashrateObservable$ | async) as hashrates">
 | 
			
		||||
      <div class="btn-group btn-group-toggle" ngbRadioGroup name="radioBasic" formControlName="dateSpan">
 | 
			
		||||
        <label ngbButtonLabel class="btn-primary btn-sm" *ngIf="hashrates.availableTimespanDay >= 90">
 | 
			
		||||
@ -25,17 +25,16 @@
 | 
			
		||||
    </form>
 | 
			
		||||
  </div>
 | 
			
		||||
 | 
			
		||||
  <div *ngIf="hashrateObservable$ | async" [class]="!widget ? 'chart' : 'chart-widget'"
 | 
			
		||||
  <div *ngIf="(hashrateObservable$ | async) && !tableOnly" [class]="!widget ? 'chart' : 'chart-widget'"
 | 
			
		||||
    echarts [initOpts]="chartInitOptions" [options]="chartOptions"></div>
 | 
			
		||||
  <div class="text-center loadingGraphs" *ngIf="isLoading">
 | 
			
		||||
    <div class="spinner-border text-light"></div>
 | 
			
		||||
  </div>
 | 
			
		||||
  
 | 
			
		||||
  <!-- <div class="mt-3" *ngIf="!widget">
 | 
			
		||||
  <div class="mt-3" *ngIf="tableOnly || !widget">
 | 
			
		||||
    <table class="table table-borderless table-sm text-center">
 | 
			
		||||
      <thead>
 | 
			
		||||
        <tr>
 | 
			
		||||
          <th i18n="mining.rank">Block</th>
 | 
			
		||||
          <th class="d-none d-md-block" i18n="block.timestamp">Timestamp</th>
 | 
			
		||||
          <th i18n="mining.adjusted">Adjusted</th>
 | 
			
		||||
          <th i18n="mining.difficulty">Difficulty</th>
 | 
			
		||||
@ -44,15 +43,13 @@
 | 
			
		||||
      </thead>
 | 
			
		||||
      <tbody *ngIf="(hashrateObservable$ | async) as data">
 | 
			
		||||
        <tr *ngFor="let diffChange of data.difficulty">
 | 
			
		||||
          <td><a [routerLink]="['/block' | relativeUrl, diffChange.height]">{{ diffChange.height }}</a></td>
 | 
			
		||||
          <td class="d-none d-md-block">‎{{ diffChange.timestamp * 1000 | date:'yyyy-MM-dd HH:mm' }}</td>
 | 
			
		||||
          <td><app-time-since [time]="diffChange.timestamp" [fastRender]="true"></app-time-since></td>
 | 
			
		||||
          <td class="d-none d-md-block">{{ formatNumber(diffChange.difficulty, locale, '1.2-2') }}</td>
 | 
			
		||||
          <td class="d-block d-md-none">{{ diffChange.difficultyShorten }}</td>
 | 
			
		||||
          <td>{{ diffChange.difficultyShorten }}</td>
 | 
			
		||||
          <td [style]="diffChange.change >= 0 ? 'color: #42B747' : 'color: #B74242'">{{ formatNumber(diffChange.change, locale, '1.2-2') }}%</td>
 | 
			
		||||
        </tr>
 | 
			
		||||
      </tbody>
 | 
			
		||||
    </table>
 | 
			
		||||
  </div> -->
 | 
			
		||||
  </div>
 | 
			
		||||
 | 
			
		||||
</div>
 | 
			
		||||
 | 
			
		||||
@ -22,7 +22,8 @@ import { selectPowerOfTen } from 'src/app/bitcoin.utils';
 | 
			
		||||
  `],
 | 
			
		||||
})
 | 
			
		||||
export class HashrateChartComponent implements OnInit {
 | 
			
		||||
  @Input() widget: boolean = false;
 | 
			
		||||
  @Input() tableOnly = false;
 | 
			
		||||
  @Input() widget = false;
 | 
			
		||||
  @Input() right: number | string = 45;
 | 
			
		||||
  @Input() left: number | string = 75;
 | 
			
		||||
 | 
			
		||||
@ -114,7 +115,7 @@ export class HashrateChartComponent implements OnInit {
 | 
			
		||||
                }
 | 
			
		||||
                return {
 | 
			
		||||
                  availableTimespanDay: availableTimespanDay,
 | 
			
		||||
                  difficulty: tableData
 | 
			
		||||
                  difficulty: this.tableOnly ? tableData.slice(0, 8) : tableData
 | 
			
		||||
                };
 | 
			
		||||
              }),
 | 
			
		||||
            );
 | 
			
		||||
 | 
			
		||||
@ -44,11 +44,10 @@
 | 
			
		||||
      </div>
 | 
			
		||||
    </div>
 | 
			
		||||
 | 
			
		||||
    <!-- pools hashrate -->
 | 
			
		||||
    <!-- pool dominance -->
 | 
			
		||||
    <div class="col">
 | 
			
		||||
      <div class="card" style="height: 385px">
 | 
			
		||||
        <div class="card-body">
 | 
			
		||||
          <!-- pool dominance -->
 | 
			
		||||
          <h5 class="card-title">
 | 
			
		||||
            <a href="" [routerLink]="['/mining/hashrate/pools' | relativeUrl]" i18n="mining.pool-historical-dominance">
 | 
			
		||||
              Mining Pools Dominance (1y)
 | 
			
		||||
@ -59,5 +58,18 @@
 | 
			
		||||
      </div>
 | 
			
		||||
    </div>
 | 
			
		||||
 | 
			
		||||
    <div class="col">
 | 
			
		||||
      <div class="card" style="height: 385px">
 | 
			
		||||
        <div class="card-body">
 | 
			
		||||
          <h5 class="card-title">
 | 
			
		||||
            <a href="" [routerLink]="['/mining/hashrate' | relativeUrl]" i18n="mining.pool-historical-dominance">
 | 
			
		||||
              Adjusments
 | 
			
		||||
            </a>
 | 
			
		||||
          </h5>
 | 
			
		||||
          <app-hashrate-chart [tableOnly]=true [widget]=true></app-hashrate-chart>
 | 
			
		||||
        </div>
 | 
			
		||||
      </div>
 | 
			
		||||
    </div>
 | 
			
		||||
 | 
			
		||||
  </div>
 | 
			
		||||
</div>
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user