From b07c52b5a702dd588836fecd32c13548bcffbc3d Mon Sep 17 00:00:00 2001 From: shunmugam Date: Tue, 7 Jan 2020 10:50:32 +0530 Subject: [PATCH] Check all button in target difficulty graph --- server/i18n/de.json | 1 + server/i18n/en.json | 1 + .../home/graph-list/graph-list.component.html | 15 ++++++++++++++ .../home/graph-list/graph-list.component.ts | 20 +++++++++++++++++-- 4 files changed, 35 insertions(+), 2 deletions(-) diff --git a/server/i18n/de.json b/server/i18n/de.json index 3954105..2fa81ec 100644 --- a/server/i18n/de.json +++ b/server/i18n/de.json @@ -61,6 +61,7 @@ "TRANSACTIONS_VS_DATE" : "Transaktionen gegen Datum", "DAYS" : "Tage", "MONTHS" : "Monate", + "All": "alle", "WEEK" : "Woche", "SEARCH_TEXT" : "Suche nach Hash oder Blockhöhe oder Ausgabe-Commit-ID", "BLOCK_REWARD" : "Block Belohnung", diff --git a/server/i18n/en.json b/server/i18n/en.json index dc1e8bd..0536826 100644 --- a/server/i18n/en.json +++ b/server/i18n/en.json @@ -61,6 +61,7 @@ "TRANSACTIONS_VS_DATE" : "Transactions by Date", "DAYS" : "days", "MONTHS" : "months", + "All" : "all", "WEEK" : "week", "SEARCH_TEXT" : "Search by hash, or block height or output commit ID", "BLOCK_REWARD" : "Block Reward", diff --git a/src/app/view/home/graph-list/graph-list.component.html b/src/app/view/home/graph-list/graph-list.component.html index 7321589..ad5fa14 100644 --- a/src/app/view/home/graph-list/graph-list.component.html +++ b/src/app/view/home/graph-list/graph-list.component.html @@ -61,6 +61,13 @@ 3 {{'home.MONTHS' | translate}} + + all {{'home.All' | translate}} + + +
@@ -391,6 +398,14 @@ 3 {{'home.MONTHS' | translate}} + + + + +
{{'home.EXPLORE_IT' | translate}} { let params = new HttpParams(); + + if(interval == "all") { + // this.Type="" + fromDate = "2019-09-29 06:00:00" + ToDate = "2019-11-20 20:29:59" + } + + + params = params.append('FromDate', fromDate); params = params.append('ToDate', ToDate); - params = params.append('Interval', interval); + params = params.append('Interval', (interval == "all")?"":interval); this.chartService .apiGetRequest(params, '/blockchain_block/stackblock') .subscribe( @@ -414,12 +423,19 @@ export class GraphListComponent implements OnInit { interval = '', type = '' ) { + this.Type = type != '' ? type : this.Type == '' ? 'all' : this.Type; + if(interval == "all") { + // this.Type="" + fromDate = "2019-09-29 00:00:00" + ToDate = "2019-11-20 23:29:59" + } + return new Promise((resolve, reject) => { let params = new HttpParams(); params = params.append('FromDate', fromDate); params = params.append('ToDate', ToDate); - params = params.append('Interval', interval); + params = params.append('Interval', (interval == "all")?"":interval); params = params.append('Type', this.Type); params = params.append('Difftype', difftype); this.chartService