fix: add °, use hash pipe, less decimals >= 100

This commit is contained in:
mrv777 2024-09-28 22:01:37 -05:00
parent 18671b2ef2
commit 7097ca180b
3 changed files with 9 additions and 8 deletions

View File

@ -18,8 +18,7 @@
<div class="flex justify-content-between mb-3">
<div>
<span class="block text-500 font-medium mb-3">Hash Rate</span>
<div class="text-900 font-medium text-xl">{{info.hashRate | number: '1.2-2'}}
<small>Gh/s</small>
<div class="text-900 font-medium text-xl">{{info.hashRate * 1000000000 | hashSuffix}}
</div>
</div>
<div class="flex align-items-center justify-content-center bg-orange-100 border-round"
@ -130,7 +129,7 @@
<div class="grid text-center">
<div class="col-6">
<p-knob [min]="20" [max]="maxTemp" [readonly]="true" [(ngModel)]="info.temp"
valueTemplate="{value}C"
valueTemplate="{value}°C"
[valueColor]="info.temp >= 70 ? '#ff0000' : 'var(--primary-color, Black)'">
</p-knob>
ASIC Temperature
@ -183,8 +182,8 @@
<div class="grid text-center">
<div class="col-6">
<p-knob [min]="100" [max]="maxFrequency" [readonly]="true" [(ngModel)]="info.frequency"
valueTemplate="{value}Mhz"></p-knob>
ASIC Frequency
valueTemplate="{value}"></p-knob>
ASIC Frequency (MHz)
</div>
<div class="col-6">
<p-knob [min]="0.9" [max]="1.8" [readonly]="true" [(ngModel)]="info.coreVoltageActual"

View File

@ -34,11 +34,11 @@
<ng-container *ngFor="let axeOs$ of swarm">
<tr *ngIf="axeOs$ | async as axe">
<td><a [href]="'http://'+axe.ip" target="_blank">{{axe.ip}}</a></td>
<td>{{axe.hashRate | number: '1.2-2'}} <small>Gh/s</small></td>
<td>{{axe.hashRate * 1000000000 | hashSuffix}}</td>
<td>{{axe.uptimeSeconds | dateAgo}}</td>
<td>{{axe.sharesAccepted}}</td>
<td>{{axe.power | number: '1.2-2'}} <small>W</small> </td>
<td>{{axe.temp}} <small>C</small></td>
<td>{{axe.temp}}°<small>C</small></td>
<td>{{axe.bestDiff}}</td>
<td>{{axe.version}}</td>
<td><p-button icon="pi pi-pencil" pp-button (click)="edit(axe)"></p-button></td>

View File

@ -28,9 +28,11 @@ export class HashSuffixPipe implements PipeTransform {
if (scaledValue < 10) {
return scaledValue.toFixed(2) + suffix;
} else if (scaledValue < 100) {
return scaledValue.toFixed(1) + suffix;
}
return scaledValue.toFixed(1) + suffix;
return scaledValue.toFixed(0) + suffix;
}