Merge branch 'master' into simon/about-page-wallets-arrange

This commit is contained in:
wiz
2022-03-29 04:14:43 +00:00
committed by GitHub
20 changed files with 494 additions and 733 deletions

View File

@@ -25,7 +25,7 @@
<div class="time-difference"><app-time-since [time]="block.timestamp" [fastRender]="true"></app-time-since></div>
</div>
<div class="animated" [class]="showMiningInfo ? 'show' : 'hide'" *ngIf="block.extras?.pool != undefined">
<a class="badge badge-primary" [routerLink]="[('/mining/pool/' + block.extras.pool.id) | relativeUrl]">
<a class="badge badge-primary" [routerLink]="[('/mining/pool/' + block.extras.pool.slug) | relativeUrl]">
{{ block.extras.pool.name}}</a>
</div>
</div>

View File

@@ -25,7 +25,7 @@
</td>
<td class="pool text-left" [class]="widget ? 'widget' : ''">
<div class="tooltip-custom">
<a class="clear-link" [routerLink]="['/mining/pool' | relativeUrl, block.extras.pool.id]">
<a class="clear-link" [routerLink]="['/mining/pool' | relativeUrl, block.extras.pool.slug]">
<img width="25" height="25" src="{{ block.extras.pool['logo'] }}"
onError="this.src = './resources/mining-pools/default.svg'">
<span class="pool-name">{{ block.extras.pool.name }}</span>

View File

@@ -85,7 +85,7 @@
<td class="d-none d-md-block">{{ pool.rank }}</td>
<td class="text-right"><img width="25" height="25" src="{{ pool.logo }}"
onError="this.src = './resources/mining-pools/default.svg'"></td>
<td class=""><a [routerLink]="[('/mining/pool/' + pool.poolId) | relativeUrl]">{{ pool.name }}</a></td>
<td class=""><a [routerLink]="[('/mining/pool/' + pool.slug) | relativeUrl]">{{ pool.name }}</a></td>
<td class="" *ngIf="this.poolsWindowPreference === '24h' && !isLoading">{{ pool.lastEstimatedHashrate }} {{
miningStats.miningUnits.hashrateUnit }}</td>
<td class="">{{ pool['blockText'] }}</td>

View File

@@ -158,7 +158,7 @@ export class PoolRankingComponent implements OnInit {
}
}
},
data: pool.poolId,
data: pool.slug,
} as PieSeriesOption);
});

View File

@@ -30,9 +30,9 @@ export class PoolComponent implements OnInit {
};
blocks: BlockExtended[] = [];
poolId: number = undefined;
slug: string = undefined;
loadMoreSubject: BehaviorSubject<number> = new BehaviorSubject(this.poolId);
loadMoreSubject: BehaviorSubject<string> = new BehaviorSubject(this.slug);
constructor(
@Inject(LOCALE_ID) public locale: string,
@@ -43,23 +43,23 @@ export class PoolComponent implements OnInit {
}
ngOnInit(): void {
this.poolStats$ = this.route.params.pipe(map((params) => params.poolId))
this.poolStats$ = this.route.params.pipe(map((params) => params.slug))
.pipe(
switchMap((poolId: any) => {
switchMap((slug: any) => {
this.isLoading = true;
this.poolId = poolId;
this.loadMoreSubject.next(this.poolId);
return this.apiService.getPoolHashrate$(this.poolId)
this.slug = slug;
this.loadMoreSubject.next(this.slug);
return this.apiService.getPoolHashrate$(this.slug)
.pipe(
switchMap((data) => {
this.isLoading = false;
this.prepareChartOptions(data.hashrates.map(val => [val.timestamp * 1000, val.avgHashrate]));
return poolId;
return slug;
}),
);
}),
switchMap(() => {
return this.apiService.getPoolStats$(this.poolId);
return this.apiService.getPoolStats$(this.slug);
}),
map((poolStats) => {
let regexes = '"';
@@ -78,10 +78,10 @@ export class PoolComponent implements OnInit {
this.blocks$ = this.loadMoreSubject
.pipe(
switchMap((flag) => {
if (this.poolId === undefined) {
if (this.slug === undefined) {
return [];
}
return this.apiService.getPoolBlocks$(this.poolId, this.blocks[this.blocks.length - 1]?.height);
return this.apiService.getPoolBlocks$(this.slug, this.blocks[this.blocks.length - 1]?.height);
}),
tap((newBlocks) => {
this.blocks = this.blocks.concat(newBlocks);
@@ -180,7 +180,7 @@ export class PoolComponent implements OnInit {
}
loadMore() {
this.loadMoreSubject.next(this.poolId);
this.loadMoreSubject.next(this.slug);
}
trackByBlock(index: number, block: BlockExtended) {