diff --git a/src/app/components/splash/splash.component.html b/src/app/components/splash/splash.component.html
index 9ce1fb1..af416c7 100644
--- a/src/app/components/splash/splash.component.html
+++ b/src/app/components/splash/splash.component.html
@@ -18,7 +18,7 @@
- stratum+tcp://public-pool-web.airdns.org:21496
+ stratum+tcp://public-pool.airdns.org:21496
username: <your BTC address>.<worker name>, password: x
@@ -53,5 +53,30 @@
+
+
+
+
Found Blocks
+
+
+
+ | Height |
+ Address |
+ Worker |
+ Session |
+
+
+
+
+ | {{ block.height }} |
+ {{ block.minerAddress }} |
+ {{ block.worker }} |
+ {{ block.sessionId }} |
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/app/components/splash/splash.component.scss b/src/app/components/splash/splash.component.scss
index 1f6bb98..5d1b1e8 100644
--- a/src/app/components/splash/splash.component.scss
+++ b/src/app/components/splash/splash.component.scss
@@ -11,6 +11,6 @@
}
.card {
- max-width: 1000px;
+ max-width: 1024px;
margin: 0 auto;
}
\ No newline at end of file
diff --git a/src/app/components/splash/splash.component.ts b/src/app/components/splash/splash.component.ts
index 8dfa50c..9c7c290 100644
--- a/src/app/components/splash/splash.component.ts
+++ b/src/app/components/splash/splash.component.ts
@@ -1,6 +1,6 @@
import { Component } from '@angular/core';
import { FormControl } from '@angular/forms';
-import { map, Observable } from 'rxjs';
+import { map, Observable, shareReplay } from 'rxjs';
import { HashSuffixPipe } from '../../pipes/hash-suffix.pipe';
import { AppService } from '../../services/app.service';
@@ -16,14 +16,16 @@ export class SplashComponent {
public address: FormControl;
public chartData$: Observable;
+ public blockData$: Observable;
public chartOptions: any;
constructor(private appService: AppService) {
- this.chartData$ = this.appService.getInfo().pipe(
- map((info: any) => {
- console.log(info)
+ const info$ = this.appService.getInfo().pipe(shareReplay({ refCount: true, bufferSize: 1 }));
+ this.blockData$ = info$.pipe(map(info => info.blockData));
+ this.chartData$ = info$.pipe(
+ map((info: any) => {
return {
labels: info.chartData.map((d: any) => d.label),
datasets: [
diff --git a/src/app/services/app.service.ts b/src/app/services/app.service.ts
index 757ccae..8529316 100644
--- a/src/app/services/app.service.ts
+++ b/src/app/services/app.service.ts
@@ -1,5 +1,6 @@
import { HttpClient } from '@angular/common/http';
import { Injectable } from '@angular/core';
+import { Observable } from 'rxjs';
import { environment } from '../../environments/environment';
@@ -13,6 +14,6 @@ export class AppService {
) { }
public getInfo() {
- return this.httpClient.get(`${environment.API_URL}/api/info`);
+ return this.httpClient.get(`${environment.API_URL}/api/info`) as Observable;
}
}