This commit is contained in:
SuriyaR 2019-08-07 11:47:48 +05:30
parent 7ff9209919
commit 6d3e777697
7 changed files with 49 additions and 39 deletions

View File

@ -1147,13 +1147,6 @@ export class BlockchainBlockController {
.catch(err_msg => {
next(err_msg);
});
console.log("SELECT a.hash, a.tarket_difficulty, a.date FROM(select 1 as hash, (total_difficulty_"+alog_type+" - LAG(total_difficulty_"+alog_type+") OVER (ORDER BY total_difficulty_"+alog_type+")) AS tarket_difficulty, \
DATE_TRUNC('minute', timestamp at time zone '" +
process.env.TIME_ZONE +
"') as date \
from blockchain_block where " +
timeIntervalQry +
" order by height) as a WHERE a.tarket_difficulty IS NOT NULL");
let date = [],
//DifficultyCuckaroo = [],
//DifficultyCuckatoo = [],

View File

@ -34,6 +34,7 @@
"MINUTE" : "minute",
"BLOCKS_PER_PAGE" : "Blöcke pro Seite",
"TOTAL_DIFFICULTY" : "Gesamtschwierigkeit",
"TARGET_DIFFICULTY" : "Zielschwierigkeit",
"TRANSACTIONS_BY_TIME" : "Transaktionen im Zeitverlauf",
"BLOCKS" : "Blöcke",
"BLOCK" : "Block",

View File

@ -34,6 +34,7 @@
"BLOCKS_PER_PAGE" : "Blocks per page",
"MINUTE" : "minute",
"TOTAL_DIFFICULTY" : "Total Difficulty",
"TARGET_DIFFICULTY" : "Target Difficulty",
"TRANSACTIONS_BY_TIME" : "Transactions over time",
"BLOCKS" : "Blocks",
"BLOCK" : "Block",

View File

@ -14,23 +14,34 @@
<div class="day_filter" *ngIf="this.title!='Transactions over time'">
<a href="JavaScript:void(0);" *ngIf="this.title=='Total Difficulty'" (click)="
ChartFromView('', '', '1 day', true, false); selectedItem = 6
ChartFromView('', '', '1 day', comp.Type); selectedItem = 6; comp.difficultyRange = '1 day'
" id="6" #item6 [ngClass]="{ active: selectedItem == item6.id, txt_primay: true }">1 Day</a>
<a href="JavaScript:void(0);" (click)="
ChartFromView('', '', '1 week', true, false); selectedItem = 1
ChartFromView('', '', '1 week', comp.Type); selectedItem = 1; comp.difficultyRange = '1 week'
" id="1" #item1 [ngClass]="{ active: selectedItem == item1.id, txt_primay: true }">1 {{'home.WEEK' | translate}}</a>
<a href="JavaScript:void(0);" (click)="
ChartFromView('', '', '15 days', true, false); selectedItem = 2
ChartFromView('', '', '15 days', comp.Type); selectedItem = 2; comp.difficultyRange = '15 days'
" id="2" #item2 [ngClass]="{ active: selectedItem == item2.id, day15_txt: true }">15 {{'home.DAYS' | translate}}</a>
<a href="JavaScript:void(0);" (click)="
ChartFromView('', '', '30 days', true, false); selectedItem = 3
ChartFromView('', '', '30 days', comp.Type); selectedItem = 3; comp.difficultyRange = '30 days'
" id="3" #item3 [ngClass]="{ active: selectedItem == item3.id, day30_txt: true }">30 {{'home.DAYS' | translate}}</a>
<a href="JavaScript:void(0);" (click)="
ChartFromView('', '', '60 days', true, false); selectedItem = 4
ChartFromView('', '', '60 days', comp.Type); selectedItem = 4; comp.difficultyRange = '60 days'
" id="4" #item4 [ngClass]="{ active: selectedItem == item4.id, day60_txt: true }">60 {{'home.DAYS' | translate}}</a>
<a href="JavaScript:void(0);" (click)="
ChartFromView('', '', '3 months', true, false); selectedItem = 5
ChartFromView('', '', '3 months', comp.Type); selectedItem = 5; comp.difficultyRange = '3 months'
" id="5" #item5 [ngClass]="{ active: selectedItem == item5.id, day3m_txt: true }">3 {{'home.MONTHS' | translate}}</a>
</div>
<div class="day_filter" *ngIf="this.title!='Transactions over time'">
<a href="JavaScript:void(0);" (click)="
ChartFromView('', '', comp.difficultyRange,'cuckatoo'); selectedItem12 = 1
" id="1" #item121 [ngClass]="{ active: selectedItem12 == item121.id, txt_primay: true }">Cuckoo</a>
<a href="JavaScript:void(0);" (click)="
ChartFromView('', '', comp.difficultyRange,'progpow'); selectedItem12 = 2
" id="2" #item122 [ngClass]="{ active: selectedItem12 == item122.id, txt_primay: true }">ProgPow</a>
<a href="JavaScript:void(0);" (click)="
ChartFromView('', '', comp.difficultyRange,'randomx'); selectedItem12 = 3
" id="3" #item123 [ngClass]="{ active: selectedItem12 == item123.id, txt_primay: true }">RandomX</a>
</div>
<div class="day_filter" *ngIf="this.title=='Transactions over time'">
<a href="JavaScript:void(0);" (click)="ChartFromView(GraphtDate, GraphtHour, GraphtInput,'Input'); selectedItem8 = 1" id="1" #item1

View File

@ -23,6 +23,9 @@ export class GraphDetailComponent implements OnInit {
public chartType : any = [];
public selectedItem: Number = 3;
public selectedItem8: Number = 2;
public selectedItem12: Number = 1;
public Type: any = '';
public GraphtInput: any;
public GraphtOutput: any;
@ -36,12 +39,11 @@ export class GraphDetailComponent implements OnInit {
private comp: GraphListComponent,
private titleService: Title,
public translate: TransServiceService
) {
) {}
ngOnInit() {
if(this.title=='Total Difficulty'){
this.selectedItem = 6;
}
}
ngOnInit() {
var self = this;
var x = setInterval(function() {
self.TimeArr = self.chartService.GetTimer()
@ -194,10 +196,11 @@ export class GraphDetailComponent implements OnInit {
) {
// (p1, p2, p3, p4, p5) for (fromDate, ToDate, interval, fordifficult, forblocks) for difficult and nar chart
// AND For heatmap and others - It will change
this.comp.Type = p4 != '' ? p4 : this.comp.Type == '' ? 'cuckatoo' : this.comp.Type;
switch (this.chartType) {
case 'total-difficulty':
this.comp.Difficultyreq(p1, p2, p3).then(res => {
this.comp.Difficultyreq(p1, p2, p3, p4).then(res => {
this.hashdata = this.comp.linearGraphData;
this.hashdata.layout.height = 500;
this.title = 'Total Difficulty';

View File

@ -2,7 +2,7 @@
<div class="col-md-6 col-lg-4 mb-4">
<div class="box_shadow">
<div class="blocks">
<h2 class="chart_heading d-inline-block">{{'home.TOTAL_DIFFICULTY' | translate}}</h2>
<h2 class="chart_heading d-inline-block">{{'home.TARGET_DIFFICULTY' | translate}}</h2>
<!-- <span class="txn_count" *ngIf="this.lg_last.length > 0"><span *ngFor="let l of lg_last">{{
this.l | number</span>
}}</span> -->
@ -25,38 +25,38 @@
</div>
<div class="day_filter">
<a href="JavaScript:void(0);" (click)="
Difficultyreq('', '', '1 day',''); selectedItem = 6
Difficultyreq('', '', '1 day',''); selectedItem = 6; difficultyRange = '1 day'
" id="6" #item6 [ngClass]="{ active: selectedItem == item6.id, txt_primay: true }">1 Day</a>
<a href="JavaScript:void(0);" (click)="
Difficultyreq('', '', '1 week',''); selectedItem = 1
Difficultyreq('', '', '1 week',''); selectedItem = 1; difficultyRange = '1 week'
" id="1" #item1 [ngClass]="{ active: selectedItem == item1.id, txt_primay: true }">1 {{'home.WEEK' | translate}}</a>
<a href="JavaScript:void(0);" (click)="
Difficultyreq('', '', '15 days',''); selectedItem = 2
Difficultyreq('', '', '15 days',''); selectedItem = 2; difficultyRange = '15 days'
" id="2" #item2 [ngClass]="{ active: selectedItem == item2.id, day15_txt: true }">15 {{'home.DAYS' | translate}}</a>
<a href="JavaScript:void(0);" (click)="
Difficultyreq('', '', '30 days',''); selectedItem = 3
Difficultyreq('', '', '30 days',''); selectedItem = 3; difficultyRange = '30 days'
" id="3" #item3 [ngClass]="{ active: selectedItem == item3.id, day30_txt: true }">30 {{'home.DAYS' | translate}}</a>
<a href="JavaScript:void(0);" (click)="
Difficultyreq('', '', '60 days',''); selectedItem = 4
Difficultyreq('', '', '60 days',''); selectedItem = 4; difficultyRange = '60 days'
" id="4" #item4 [ngClass]="{ active: selectedItem == item4.id, day60_txt: true }">60 {{'home.DAYS' | translate}}</a>
<a href="JavaScript:void(0);" (click)="
Difficultyreq('', '', '3 months',''); selectedItem = 5
Difficultyreq('', '', '3 months',''); selectedItem = 5; difficultyRange = '3 months'
" id="5" #item5 [ngClass]="{ active: selectedItem == item5.id, day3m_txt: true }">3 {{'home.MONTHS' | translate}}</a>
</div>
<div class="day_filter">
<a href="JavaScript:void(0);" (click)="
Difficultyreq('', '', '1 day','cuckatoo'); selectedItem12 = 1
" id="1" #item12 [ngClass]="{ active: selectedItem12 == item12.id, txt_primay: true }">Cuckoo</a>
<a href="JavaScript:void(0);" (click)="
Difficultyreq('', '', '1 day','progpow'); selectedItem12 = 2
" id="2" #item12 [ngClass]="{ active: selectedItem12 == item12.id, txt_primay: true }">ProgPow</a>
<a href="JavaScript:void(0);" (click)="
Difficultyreq('', '', '1 day','randomx'); selectedItem12 = 3
" id="3" #item12 [ngClass]="{ active: selectedItem12 == item12.id, txt_primay: true }">RandomX</a>
</div>
<div class="explore_all text-right">
<a routerLink="/chart/total-difficulty"><span class="text-uppercase d-block">{{'home.EXPLORE_IT' | translate}} <i
<div class="d-inline float-left difficulty_filter">
<a href="JavaScript:void(0);" (click)="
Difficultyreq('', '', difficultyRange,'cuckatoo'); selectedItem12 = 1
" id="1" #item121 [ngClass]="{ active: selectedItem12 == item121.id, txt_primay: true }">Cuckoo</a>
<a href="JavaScript:void(0);" (click)="
Difficultyreq('', '', difficultyRange,'progpow'); selectedItem12 = 2
" id="2" #item122 [ngClass]="{ active: selectedItem12 == item122.id, txt_primay: true }">ProgPow</a>
<a href="JavaScript:void(0);" (click)="
Difficultyreq('', '', difficultyRange,'randomx'); selectedItem12 = 3
" id="3" #item123 [ngClass]="{ active: selectedItem12 == item123.id, txt_primay: true }">RandomX</a>
</div>
<a routerLink="/chart/total-difficulty"><span class="text-uppercase">{{'home.EXPLORE_IT' | translate}} <i
class="fa fa-long-arrow-right"></i></span></a>
</div>
</div>

View File

@ -56,6 +56,7 @@ export class GraphListComponent implements OnInit {
public tDate: any;
public tHour: any;
public Type: any = '';
public difficultyRange: any = '1 day';
viewchartvar: boolean;
@ -380,7 +381,7 @@ export class GraphListComponent implements OnInit {
interval = '',
type = ''
) {
this.Type = this.Type == '' ? type != '' ? type : 'cuckatoo' : this.Type;
this.Type = type != '' ? type : this.Type == '' ? 'cuckatoo' : this.Type;
return new Promise((resolve, reject) => {
let params = new HttpParams();
params = params.append('FromDate', fromDate);