mirror of
https://github.com/skot/ESP-Miner.git
synced 2025-06-30 20:00:42 +02:00
fix: Add overheat alert, knob colors & max, chart dots & label
This commit is contained in:
@ -21,8 +21,7 @@ import { ANSIPipe } from './pipes/ansi.pipe';
|
|||||||
import { DateAgoPipe } from './pipes/date-ago.pipe';
|
import { DateAgoPipe } from './pipes/date-ago.pipe';
|
||||||
import { HashSuffixPipe } from './pipes/hash-suffix.pipe';
|
import { HashSuffixPipe } from './pipes/hash-suffix.pipe';
|
||||||
import { PrimeNGModule } from './prime-ng.module';
|
import { PrimeNGModule } from './prime-ng.module';
|
||||||
|
import { MessageModule } from 'primeng/message';
|
||||||
|
|
||||||
|
|
||||||
const components = [
|
const components = [
|
||||||
AppComponent,
|
AppComponent,
|
||||||
@ -55,7 +54,8 @@ const components = [
|
|||||||
BrowserAnimationsModule,
|
BrowserAnimationsModule,
|
||||||
CommonModule,
|
CommonModule,
|
||||||
PrimeNGModule,
|
PrimeNGModule,
|
||||||
AppLayoutModule
|
AppLayoutModule,
|
||||||
|
MessageModule
|
||||||
],
|
],
|
||||||
providers: [
|
providers: [
|
||||||
{ provide: LocationStrategy, useClass: HashLocationStrategy },
|
{ provide: LocationStrategy, useClass: HashLocationStrategy },
|
||||||
|
@ -1,7 +1,13 @@
|
|||||||
<ng-template #loading>
|
<ng-template #loading>
|
||||||
<h4>Loading...</h4>
|
<h4>Loading...</h4>
|
||||||
</ng-template>
|
</ng-template>
|
||||||
<ng-container>
|
<ng-container *ngIf="info$ | async as info; else loading">
|
||||||
|
<!-- Temp warning alert -->
|
||||||
|
<p-message *ngIf="info.overheat_mode"
|
||||||
|
severity="error"
|
||||||
|
styleClass="w-full mb-4 py-4 border-round-xl"
|
||||||
|
text="Bitaxe has overheated - See settings">
|
||||||
|
</p-message>
|
||||||
|
|
||||||
<div class="grid" *ngIf="info$ | async as info; else loading">
|
<div class="grid" *ngIf="info$ | async as info; else loading">
|
||||||
<div class="col-12">
|
<div class="col-12">
|
||||||
@ -95,14 +101,15 @@
|
|||||||
<h5>Power</h5>
|
<h5>Power</h5>
|
||||||
<div class="grid text-center">
|
<div class="grid text-center">
|
||||||
<div class="col-4">
|
<div class="col-4">
|
||||||
<p-knob [min]="3" [max]="50" [readonly]="true" [(ngModel)]="info.power"
|
<p-knob [min]="3" [max]="max(50, info.power)" [readonly]="true" [(ngModel)]="info.power"
|
||||||
valueTemplate="{value}W"></p-knob>
|
valueTemplate="{value}W"></p-knob>
|
||||||
Power
|
Power
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="col-4">
|
<div class="col-4">
|
||||||
<p-knob [min]="4.5" [max]="5.5" [readonly]="true" [(ngModel)]="info.voltage"
|
<p-knob [min]="4.5" [max]="5.5" [readonly]="true" [(ngModel)]="info.voltage"
|
||||||
valueTemplate="{value}V"></p-knob>
|
valueTemplate="{value}V"
|
||||||
|
[valueColor]="info.voltage < 4.8 ? '#ff0000' : 'var(--primary-color, Black)'"></p-knob>
|
||||||
Input Voltage
|
Input Voltage
|
||||||
<span class="danger" *ngIf="info.voltage < 4.8"> Danger: Low voltage</span>
|
<span class="danger" *ngIf="info.voltage < 4.8"> Danger: Low voltage</span>
|
||||||
</div>
|
</div>
|
||||||
@ -122,8 +129,10 @@
|
|||||||
<h5>Heat</h5>
|
<h5>Heat</h5>
|
||||||
<div class="grid text-center">
|
<div class="grid text-center">
|
||||||
<div class="col-6">
|
<div class="col-6">
|
||||||
<p-knob [min]="20" [max]="75" [readonly]="true" [(ngModel)]="info.temp"
|
<p-knob [min]="20" [max]="max(75, info.temp)" [readonly]="true" [(ngModel)]="info.temp"
|
||||||
valueTemplate="{value}C"></p-knob>
|
valueTemplate="{value}C"
|
||||||
|
[valueColor]="info.temp >= 70 ? '#ff0000' : 'var(--primary-color, Black)'">
|
||||||
|
</p-knob>
|
||||||
ASIC Temperature
|
ASIC Temperature
|
||||||
|
|
||||||
<span class="danger" *ngIf="info.temp >= 70">
|
<span class="danger" *ngIf="info.temp >= 70">
|
||||||
@ -132,7 +141,8 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="col-6" *ngIf="info.vrTemp > 0">
|
<div class="col-6" *ngIf="info.vrTemp > 0">
|
||||||
<p-knob [min]="20" [max]="145" [readonly]="true" [(ngModel)]="info.vrTemp"
|
<p-knob [min]="20" [max]="145" [readonly]="true" [(ngModel)]="info.vrTemp"
|
||||||
valueTemplate="{value}C"></p-knob>
|
valueTemplate="{value}C"
|
||||||
|
[valueColor]="info.vrTemp >= 105 ? '#ff0000' : 'var(--primary-color, Black)'"></p-knob>
|
||||||
Voltage Regulator Temperature
|
Voltage Regulator Temperature
|
||||||
|
|
||||||
<span class="danger" *ngIf="info.vrTemp >= 105">
|
<span class="danger" *ngIf="info.vrTemp >= 105">
|
||||||
@ -172,7 +182,7 @@
|
|||||||
<h5>Performance</h5>
|
<h5>Performance</h5>
|
||||||
<div class="grid text-center">
|
<div class="grid text-center">
|
||||||
<div class="col-6">
|
<div class="col-6">
|
||||||
<p-knob [min]="100" [max]="800" [readonly]="true" [(ngModel)]="info.frequency"
|
<p-knob [min]="100" [max]="max(800, info.frequency)" [readonly]="true" [(ngModel)]="info.frequency"
|
||||||
valueTemplate="{value}Mhz"></p-knob>
|
valueTemplate="{value}Mhz"></p-knob>
|
||||||
ASIC Frequency
|
ASIC Frequency
|
||||||
</div>
|
</div>
|
||||||
|
@ -12,7 +12,6 @@ import { ISystemInfo } from 'src/models/ISystemInfo';
|
|||||||
})
|
})
|
||||||
export class HomeComponent {
|
export class HomeComponent {
|
||||||
|
|
||||||
|
|
||||||
public info$: Observable<ISystemInfo>;
|
public info$: Observable<ISystemInfo>;
|
||||||
|
|
||||||
public quickLink$: Observable<string | undefined>;
|
public quickLink$: Observable<string | undefined>;
|
||||||
@ -46,7 +45,8 @@ export class HomeComponent {
|
|||||||
backgroundColor: primaryColor,
|
backgroundColor: primaryColor,
|
||||||
borderColor: primaryColor,
|
borderColor: primaryColor,
|
||||||
tension: .4,
|
tension: .4,
|
||||||
pointRadius: 1,
|
pointRadius: 2,
|
||||||
|
pointHoverRadius: 5,
|
||||||
borderWidth: 1
|
borderWidth: 1
|
||||||
},
|
},
|
||||||
|
|
||||||
@ -61,7 +61,19 @@ export class HomeComponent {
|
|||||||
labels: {
|
labels: {
|
||||||
color: textColor
|
color: textColor
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
tooltip: {
|
||||||
|
callbacks: {
|
||||||
|
label: function(tooltipItem: any) {
|
||||||
|
let label = tooltipItem.dataset.label || '';
|
||||||
|
if (label) {
|
||||||
|
label += ': ';
|
||||||
}
|
}
|
||||||
|
label += HashSuffixPipe.transform(tooltipItem.raw);
|
||||||
|
return label;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
},
|
},
|
||||||
scales: {
|
scales: {
|
||||||
x: {
|
x: {
|
||||||
@ -160,7 +172,9 @@ export class HomeComponent {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
max(a: number, b: number): number {
|
||||||
|
return Math.max(a, b);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user