charting, routing and stats

This commit is contained in:
Ben Wilson
2023-06-22 09:06:39 -04:00
parent f547adb550
commit b9337ae636
19 changed files with 443 additions and 22 deletions
@@ -1,5 +1,32 @@
<div class="card">
<pre>
{{clientInfo$ | async | json}}
</pre>
</div>
<ng-container *ngIf="clientInfo$ | async as clientInfo">
<div class="card">
<p-table [rowHover]="true" [value]="clientInfo.workers" [tableStyle]="{ 'min-width': '50rem' }">
<ng-template pTemplate="header">
<tr>
<th>Name</th>
<th>ID</th>
<th>Hash Rate</th>
<th>Best Luck</th>
</tr>
</ng-template>
<ng-template pTemplate="body" let-worker>
<tr [routerLink]="[worker.id]">
<td>{{worker.name}}</td>
<td>{{worker.id}}</td>
<td>{{worker.hashRate}}</td>
<td>{{worker.bestDifficulty}}</td>
</tr>
</ng-template>
</p-table>
</div>
</ng-container>
@@ -11,9 +11,13 @@ import { ClientService } from '../../services/client.service';
})
export class DashboardComponent {
public clientInfo$: Observable<any>;
constructor(private clientService: ClientService, private route: ActivatedRoute) {
this.clientInfo$ = this.clientService.getClientInfo(this.route.snapshot.params['address']);
}
}