This commit is contained in:
Ben Wilson
2023-06-24 12:54:21 -04:00
parent 48516e468e
commit 3ba7ef8ca9
14 changed files with 355 additions and 62 deletions
@@ -2,23 +2,58 @@
<div class="card">
<p-table [rowHover]="true" [value]="clientInfo.workers" [tableStyle]="{ 'min-width': '50rem' }">
<p-table [rowHover]="true" groupRowsBy="name" dataKey="name" rowGroupMode="subheader"
[value]="clientInfo.workers" [tableStyle]="{ 'min-width': '50rem' }">
<ng-template pTemplate="header">
<tr>
<th>Name</th>
<th>ID</th>
<th>Session ID</th>
<th>Hash Rate</th>
<th>Best Luck</th>
<th>Best Difficulty</th>
<th>Uptime</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}} Gh/s</td>
<ng-template pTemplate="groupheader" let-worker let-rowIndex="rowIndex" let-expanded="expanded">
<tr [routerLink]="[worker.name]">
<td>
<button (click)="$event.stopImmediatePropagation()" type="button" pButton pRipple
[pRowToggler]="worker" class="p-button-text p-button-rounded p-button-plain mr-2"
[icon]="expanded ? 'pi pi-chevron-down' : 'pi pi-chevron-right'"></button>
<span class="worker-name font-bold ml-2">{{worker.name}} </span>
</td>
<td>
{{getSessionCount(worker.name, clientInfo.workers)}} Sessions
</td>
<td>
{{getTotalHashRate(worker.name, clientInfo.workers)}} GH/s
</td>
<td>
{{getBestDifficulty(worker.name, clientInfo.workers) | numberSuffix}}
</td>
<td>
{{getTotalUptime(worker.name, clientInfo.workers) | dateAgo}} (cumulative)
</td>
</tr>
</ng-template>
<ng-template pTemplate="rowexpansion" let-worker>
<tr [routerLink]="[worker.name, worker.sessionId]">
<td></td>
<td>{{worker.sessionId}}</td>
<td>{{worker.hashRate}} GH/s</td>
<td>{{worker.bestDifficulty | numberSuffix}}</td>
<td>{{worker.startTime | dateAgo}}</td>
</tr>
</ng-template>
</p-table>