From 892f1137087d55f63d211f2fab6af627c3629330 Mon Sep 17 00:00:00 2001 From: KarthiKeyanZ Date: Fri, 23 Dec 2022 10:16:25 +0000 Subject: [PATCH] angular changes --- .../components/footer/footer.component.html | 94 +- .../components/header/header.component.html | 4 +- .../home-layout/home-layout.component.html | 2 +- .../components/loading/loading.component.css | 0 .../components/loading/loading.component.html | 17 + .../components/loading/loading.component.ts | 15 + .../siteheader/siteheader.component.html | 97 +- .../subloading/subloading.component.css | 0 .../subloading/subloading.component.html | 1 + .../subloading/subloading.component.ts | 13 + src/app/shared/services/chart.service.ts | 18 +- src/app/shared/shared.module.ts | 4 + src/app/view/api-view/api-view.component.html | 37 +- .../block-detail/block-detail.component.ts | 2 +- .../graph-detail/graph-detail.component.html | 2 +- .../block-detail-list.component.html | 251 ++- .../block-detail-list.component.ts | 146 +- .../home/graph-list/graph-list.component.css | 18 + .../home/graph-list/graph-list.component.html | 851 ++++------ .../home/graph-list/graph-list.component.ts | 636 +++++--- src/app/view/home/home-worksapce.component.ts | 74 +- .../view/home/home-workspace.component.html | 38 + src/app/view/home/home.module.ts | 2 + .../latestblocks/latestblocks.component.html | 179 +- .../latestblocks/latestblocks.component.ts | 96 +- src/assets/css/OpenLayers/style.css | 516 ++++++ src/assets/css/ol.css | 282 ++++ src/assets/css/responsive.css | 225 ++- src/assets/css/style.css | 422 +++-- src/assets/geojson.json | 3 + src/assets/img/blank.gif | Bin 0 -> 42 bytes src/assets/img/dark_bg1.png | Bin 612726 -> 551696 bytes src/assets/img/down-arrow.png | Bin 0 -> 1938 bytes src/assets/img/ftrlogo_dark.png | Bin 177903 -> 103896 bytes src/assets/img/ftrlogo_light.png | Bin 177383 -> 108197 bytes src/assets/img/hyperlink.png | Bin 0 -> 16191 bytes src/assets/img/icon.png | Bin 0 -> 2532 bytes src/assets/img/light-bg.png | Bin 0 -> 1045745 bytes src/assets/img/marker.png | Bin 0 -> 601 bytes src/assets/img/vite.png | Bin 0 -> 40714 bytes src/assets/js/OpenLayers/51pool.online.min.js | 3 + src/assets/js/OpenLayers/OpenLayers.js | 1443 +++++++++++++++++ src/index.html | 4 +- src/styles.css | 232 ++- 44 files changed, 4383 insertions(+), 1344 deletions(-) create mode 100644 src/app/shared/components/loading/loading.component.css create mode 100644 src/app/shared/components/loading/loading.component.html create mode 100644 src/app/shared/components/loading/loading.component.ts create mode 100644 src/app/shared/components/subloading/subloading.component.css create mode 100644 src/app/shared/components/subloading/subloading.component.html create mode 100644 src/app/shared/components/subloading/subloading.component.ts create mode 100644 src/app/view/home/home-workspace.component.html create mode 100644 src/assets/css/OpenLayers/style.css create mode 100644 src/assets/css/ol.css create mode 100644 src/assets/geojson.json create mode 100644 src/assets/img/blank.gif create mode 100644 src/assets/img/down-arrow.png create mode 100644 src/assets/img/hyperlink.png create mode 100644 src/assets/img/icon.png create mode 100644 src/assets/img/light-bg.png create mode 100644 src/assets/img/marker.png create mode 100644 src/assets/img/vite.png create mode 100644 src/assets/js/OpenLayers/51pool.online.min.js create mode 100644 src/assets/js/OpenLayers/OpenLayers.js diff --git a/src/app/shared/components/footer/footer.component.html b/src/app/shared/components/footer/footer.component.html index da2cf45..78b44bf 100644 --- a/src/app/shared/components/footer/footer.component.html +++ b/src/app/shared/components/footer/footer.component.html @@ -1,45 +1,59 @@ - + + + \ No newline at end of file diff --git a/src/app/shared/components/header/header.component.html b/src/app/shared/components/header/header.component.html index 9b5a129..a68f7c1 100755 --- a/src/app/shared/components/header/header.component.html +++ b/src/app/shared/components/header/header.component.html @@ -3,7 +3,7 @@ Epic Cash API You are viewing - @@ -50,7 +50,7 @@ Epic Cash API You are viewing - diff --git a/src/app/shared/components/layouts/home-layout/home-layout.component.html b/src/app/shared/components/layouts/home-layout/home-layout.component.html index 8b705c4..d4c07e1 100755 --- a/src/app/shared/components/layouts/home-layout/home-layout.component.html +++ b/src/app/shared/components/layouts/home-layout/home-layout.component.html @@ -1,4 +1,4 @@ - +
diff --git a/src/app/shared/components/loading/loading.component.css b/src/app/shared/components/loading/loading.component.css new file mode 100644 index 0000000..e69de29 diff --git a/src/app/shared/components/loading/loading.component.html b/src/app/shared/components/loading/loading.component.html new file mode 100644 index 0000000..ed4edef --- /dev/null +++ b/src/app/shared/components/loading/loading.component.html @@ -0,0 +1,17 @@ +
+
+
+ +
+
+
\ No newline at end of file diff --git a/src/app/shared/components/loading/loading.component.ts b/src/app/shared/components/loading/loading.component.ts new file mode 100644 index 0000000..13209c3 --- /dev/null +++ b/src/app/shared/components/loading/loading.component.ts @@ -0,0 +1,15 @@ +import { Component, OnInit } from '@angular/core'; +import { Router } from '@angular/router'; +import { TransServiceService } from '../../services/trans-service.service'; + +@Component({ + selector: 'epic-explorer-loading', + templateUrl: './loading.component.html', + styleUrls: ['./loading.component.css'], +}) +export class LoadingComponent implements OnInit { + constructor() {} + + ngOnInit() {} + +} diff --git a/src/app/shared/components/siteheader/siteheader.component.html b/src/app/shared/components/siteheader/siteheader.component.html index 33d2b92..ff99996 100644 --- a/src/app/shared/components/siteheader/siteheader.component.html +++ b/src/app/shared/components/siteheader/siteheader.component.html @@ -1,27 +1,30 @@ diff --git a/src/app/shared/components/subloading/subloading.component.css b/src/app/shared/components/subloading/subloading.component.css new file mode 100644 index 0000000..e69de29 diff --git a/src/app/shared/components/subloading/subloading.component.html b/src/app/shared/components/subloading/subloading.component.html new file mode 100644 index 0000000..b01e024 --- /dev/null +++ b/src/app/shared/components/subloading/subloading.component.html @@ -0,0 +1 @@ +
\ No newline at end of file diff --git a/src/app/shared/components/subloading/subloading.component.ts b/src/app/shared/components/subloading/subloading.component.ts new file mode 100644 index 0000000..88788fa --- /dev/null +++ b/src/app/shared/components/subloading/subloading.component.ts @@ -0,0 +1,13 @@ +import { Component, OnInit } from '@angular/core'; + +@Component({ + selector: 'epic-explorer-subloading', + templateUrl: './subloading.component.html', + styleUrls: ['./subloading.component.css'], +}) +export class SubloadingComponent implements OnInit { + constructor() {} + + ngOnInit() {} + +} diff --git a/src/app/shared/services/chart.service.ts b/src/app/shared/services/chart.service.ts index 2b564ac..d7b4ebd 100644 --- a/src/app/shared/services/chart.service.ts +++ b/src/app/shared/services/chart.service.ts @@ -47,6 +47,16 @@ export class ChartService { catchError((error: HttpErrorResponse): any => throwError(error)) ); } + public apiGetEpicLTP(): Observable { + return this.http + .get(`https://api.vitex.net/api/v2/market?symbol=EPIC-002_USDT-000`) + .pipe( + map(res => { + return res; + }), + catchError((error: HttpErrorResponse): any => throwError(error)) + ); + } public getHttpheader(){ var network; @@ -61,10 +71,10 @@ export class ChartService { public getLatestblockdetails() { - if(this.socket==null){ - this.socket = io.connect(this.server, {transport: 'websocket', requestTimeout:100000000,query: 'network='+this.socketnetwork}); - this.socket.heartbeatTimeout = 200000 - } + // if(this.socket==null){ + // this.socket = io.connect(this.server, {transport: 'websocket', requestTimeout:100000000,query: 'network='+this.socketnetwork}); + // this.socket.heartbeatTimeout = 200000 + // } return Observable.create(observer => { this.socket.on("latestblockdetail", response => { observer.next(response); diff --git a/src/app/shared/shared.module.ts b/src/app/shared/shared.module.ts index 801ab76..cb915c4 100644 --- a/src/app/shared/shared.module.ts +++ b/src/app/shared/shared.module.ts @@ -16,6 +16,8 @@ import { ChartService} from '../shared/services/chart.service'; import { PlotlyComponent } from './components/plotly/plotly.component'; import { CustomLoader } from '../app.module'; +import { LoadingComponent } from './components/loading/loading.component'; +import { SubloadingComponent } from './components/subloading/subloading.component'; const components = [ @@ -25,6 +27,8 @@ const components = [ SearchComponent, SiteLayoutComponent, SiteheaderComponent, + LoadingComponent, + SubloadingComponent, PlotlyComponent ]; diff --git a/src/app/view/api-view/api-view.component.html b/src/app/view/api-view/api-view.component.html index 4ad7a30..edb2197 100644 --- a/src/app/view/api-view/api-view.component.html +++ b/src/app/view/api-view/api-view.component.html @@ -1,37 +1,62 @@ -
+ + +
diff --git a/src/app/view/block-view/block-detail/block-detail.component.ts b/src/app/view/block-view/block-detail/block-detail.component.ts index 868bc14..686b1bf 100644 --- a/src/app/view/block-view/block-detail/block-detail.component.ts +++ b/src/app/view/block-view/block-detail/block-detail.component.ts @@ -43,7 +43,7 @@ export class BlockDetailComponent implements OnInit { : false; }, 1000); this.titleService.setTitle(this.route.snapshot.data.title); - this.latestcomp.gettinglatesthashList().then(res => { + this.latestcomp.gettinglatesthashList(true).then(res => { this.latestblockHeight = this.latestcomp.latestblockdetail.block_height; }); } diff --git a/src/app/view/graph-view/graph-detail/graph-detail.component.html b/src/app/view/graph-view/graph-detail/graph-detail.component.html index b207c35..7041f86 100644 --- a/src/app/view/graph-view/graph-detail/graph-detail.component.html +++ b/src/app/view/graph-view/graph-detail/graph-detail.component.html @@ -1,4 +1,4 @@ -
+
-
+
+ + +
+
+ +
+
+
+
+ +
+ +
+ +
+ +

+ 1 Epic = ${{epicData.lastPrice}} +

+ +
+
+ + +
+ +
+
+
+ +
+
+
+
+
+ +

{{ "home.BLOCKCHAIN_HEIGHT" | translate }}

+

+ + +

+
+ +
+

Blockchain Size

+

+ G +

+
+
+
+
+
+
+

{{ "home.LATEST_BLOCK_AGE" | translate }}

+

+ + +

+ {{ latestblockdetail.letest_block_duration }} +
+
+

{{ "home.CIRCULATING_SUPPLY" | translate }}

+

+ + +

+ Epic +
+
+
+
+
+
+ +
+
+
+ +
+
+
+

{{ "home.CURRENT_TARGET_DIFF" | translate }}

+
+
+

+ Cuckoo +

+

+ + +

+
+
+

+ ProgPoW +

+ +

+ + +

+
+
+

+ RandomX +

+ +

+ + +

+
+
+
+
+

{{ "home.HASHRATE" | translate }}

+
+
+

+ Cuckoo +

+

+ Gps + +

+
+
+

+ ProgPoW +

+ +

+ Hps + +

+
+
+

+ RandomX +

+ +

+ Hps + +

+
+
+
+
+
+
+ +
+ +
- - - -
-
+
--> \ No newline at end of file diff --git a/src/app/view/home/block-detail-list/block-detail-list.component.ts b/src/app/view/home/block-detail-list/block-detail-list.component.ts index a574ca0..5289086 100644 --- a/src/app/view/home/block-detail-list/block-detail-list.component.ts +++ b/src/app/view/home/block-detail-list/block-detail-list.component.ts @@ -15,11 +15,32 @@ export class BlockDetailListComponent implements OnInit { public latestblockdetail: any = []; public prevouslatestblockdetails: any = []; public latestblockdetailObservable: any; + public epicData:any; private server = environment.domain; private socket; + ShowSecondBlock = false; + CTD_1; + CTD_2; + CTD_3; + NW_1; + NW_2; + NW_3; + Block_height; + Block_latest; + Block_supply; + timeout_1; + timeout_2; + timeout_3; + timeout_4; + timeout_5; + timeout_6; + timeout_7; + timeout_8; + timeout_9; @ViewChild("minhgt", { static: false }) elementView: ElementRef; minHeight: number; + apiInterval; constructor( private chartService: ChartService, @@ -29,13 +50,23 @@ export class BlockDetailListComponent implements OnInit { } ngOnInit() { - this.gettinglatesthashList(); + this.gettingprevioushashList(); this.getBlockDetails(); + this.getEpicLTP(); //console.log("Enter Nginit"); } ngAfterViewInit() { + setTimeout(() => { + this.gettinglatesthashList(false); + console.log('gettinglatesthashList v1'); + this.apiInterval = setInterval(() => { + console.log('gettinglatesthashList v2'); + this.gettinglatesthashList(false); + this.getEpicLTP(); + }, 60 * 1000); + }, 14 * 1000); // this.minHeight = this.elementView.nativeElement.offsetHeight; } @@ -57,8 +88,60 @@ export class BlockDetailListComponent implements OnInit { }); } - public gettinglatesthashList() { - return new Promise((resolve, reject) => { + public getEpicLTP() { + return new Promise((resolve, reject) => { + this.chartService + .apiGetEpicLTP() + .subscribe( + res => { + if (res["msg"] == 'ok') { + console.log(res.data); + this.epicData = res.data; + resolve(); + } + }, + error => {} + ); + }); + } + + public gettingprevioushashList() { + return new Promise((resolve, reject) => { + this.chartService + .apiGetRequest("", "/blockchain_block/previousblockdetails") + .subscribe( + res => { + if (res["status"] == 200) { + // var hasharray = res.response; + this.latestblockdetail = res.response; + // setInterval(() => this.incrementseconds(), 1000); + this.latestblockdetail["blink"] = false; + setTimeout(() => { + this.ShowSecondBlock = true; + }, 4000); + this.Block_height = res.response.block_height; + this.Block_latest = res.response.letest_block_num; + this.Block_supply = res.response.coin_existence; + this.CTD_1 = res.response.targetdifficultycuckatoo; + this.NW_1 = res.response.cuckoohashrate; + setTimeout(() => { + this.CTD_2 = res.response.targetdifficultyprogpow; + this.NW_2 = res.response.progpowhashrate; + }, 8000); + setTimeout(() => { + this.CTD_3 = res.response.targetdifficultyrandomx; + this.NW_3 = res.response.randomxhashrate; + }, 12000); + resolve(); + } + }, + error => {} + ); + }); + } + + public gettinglatesthashList(init) { + return new Promise((resolve, reject) => { this.chartService .apiGetRequest("", "/blockchain_block/latesblockdetails") .subscribe( @@ -68,6 +151,52 @@ export class BlockDetailListComponent implements OnInit { this.latestblockdetail = res.response; // setInterval(() => this.incrementseconds(), 1000); this.latestblockdetail["blink"] = false; + if(init){ + setTimeout(() => { + this.ShowSecondBlock = true; + }, 4000); + this.Block_height = res.response.block_height; + this.Block_latest = res.response.letest_block_num; + this.Block_supply = res.response.coin_existence; + this.CTD_1 = res.response.targetdifficultycuckatoo; + this.NW_1 = res.response.cuckoohashrate; + setTimeout(() => { + this.CTD_2 = res.response.targetdifficultyprogpow; + this.NW_2 = res.response.progpowhashrate; + }, 10000); + setTimeout(() => { + this.CTD_3 = res.response.targetdifficultyrandomx; + this.NW_3 = res.response.randomxhashrate; + }, 15000); + }else{ + this.timeout_1 = setTimeout(() => { + this.Block_height = res.response.block_height; + }, 5*1000); + this.timeout_2 = setTimeout(() => { + this.Block_latest = res.response.letest_block_num; + }, 10*1000); + this.timeout_3 = setTimeout(() => { + this.Block_supply = res.response.coin_existence; + }, 15*1000); + this.timeout_4 = setTimeout(() => { + this.NW_1 = res.response.cuckoohashrate; + }, 20*1000); + this.timeout_5 = setTimeout(() => { + this.NW_2 = res.response.progpowhashrate; + }, 25*1000); + this.timeout_6 = setTimeout(() => { + this.NW_3 = res.response.randomxhashrate; + }, 30*1000); + this.timeout_7 = setTimeout(() => { + this.CTD_1 = res.response.targetdifficultycuckatoo; + }, 35*1000); + this.timeout_8 = setTimeout(() => { + this.CTD_2 = res.response.targetdifficultyprogpow; + }, 40*1000); + this.timeout_9 = setTimeout(() => { + this.CTD_3 = res.response.targetdifficultyrandomx; + }, 45*1000); + } resolve(); } }, @@ -81,6 +210,17 @@ export class BlockDetailListComponent implements OnInit { } ngOnDestroy() { + clearInterval(this.apiInterval); + clearTimeout(this.timeout_1); + clearTimeout(this.timeout_2); + clearTimeout(this.timeout_3); + clearTimeout(this.timeout_4); + clearTimeout(this.timeout_5); + clearTimeout(this.timeout_6); + clearTimeout(this.timeout_7); + clearTimeout(this.timeout_8); + clearTimeout(this.timeout_9); + this.latestblockdetailObservable ? this.latestblockdetailObservable.unsubscribe() : null; diff --git a/src/app/view/home/graph-list/graph-list.component.css b/src/app/view/home/graph-list/graph-list.component.css index e69de29..bc2f2fc 100644 --- a/src/app/view/home/graph-list/graph-list.component.css +++ b/src/app/view/home/graph-list/graph-list.component.css @@ -0,0 +1,18 @@ + + #wrapper { + overflow: hidden; + width: 100%; + position: absolute; + top: 0px; + height: 100%; +} + +#mapdiv { + margin: auto; + position: relative; + top: 0; + width: 98%; + height: 100%; + border: 1px solid #fff; + border-radius: 0rem; +} \ No newline at end of file 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 bf8b67e..30c020f 100644 --- a/src/app/view/home/graph-list/graph-list.component.html +++ b/src/app/view/home/graph-list/graph-list.component.html @@ -1,43 +1,31 @@
-
+
-

{{'home.TARGET_DIFFICULTY' | translate}}

- - -
- +
+ - - -
@@ -45,7 +33,7 @@
1 {{'home.day' | translate}} + " id="6" #item6 [ngClass]="{ active: selectedItem == item6.id, txt_primary: true }">1 {{'day' | translate}} 1 {{'home.WEEK' | translate}} @@ -65,83 +53,54 @@ {{'home.All' | translate}} - - -
-
-
+
-
-

{{'home.TRANSACTIONS_BY_TIME' | translate}}

-
- - -
+ +
-

{{'home.BLOCKS' | translate}}

+

{{'home.BLOCKS' | translate}}

{{ this.brg_last | number }}
@@ -168,9 +127,6 @@ {{'home.All' | translate}} - - -
{{'home.EXPLORE_IT' | translate}} @@ -178,10 +134,10 @@
-
+
-

{{'home.SUPPLY_GROWTH' | translate}}

+

{{'home.SUPPLY_GROWTH' | translate}}

{{ this.gg_last | number }} Epic per block @@ -189,20 +145,7 @@
@@ -220,10 +163,6 @@ {{'home.All' | translate}} - - - -
- -
-
-
-

{{'home.TRANSACTION_FEES' | translate}}

- - -
- - -