mirror of
https://github.com/skot/ESP-Miner.git
synced 2025-03-17 21:32:52 +01:00
Add overheat button and change loading service (#364)
* fix: change overheat check to button * fix: Handle errors on loading * fix: Simplify loading service * fix: error should use subscriber.error(
This commit is contained in:
parent
df0c9ed745
commit
1a4015f70c
@ -153,6 +153,16 @@
|
||||
|
||||
</ng-container>
|
||||
|
||||
<div class="col-12" *ngIf="form.get('overheat_mode')?.value === 1">
|
||||
<button pButton type="button" label="Disable Overheat Mode"
|
||||
class="p-button-danger w-full py-3"
|
||||
(click)="disableOverheatMode()">
|
||||
</button>
|
||||
<small class="block mt-1 text-center" style="color: #ff0000;">
|
||||
Make sure to reset Frequency and Voltage before clicking this button.
|
||||
</small>
|
||||
</div>
|
||||
|
||||
<div class="col-12 md:col-4">
|
||||
<div class="field-checkbox">
|
||||
<p-checkbox name="flipscreen" formControlName="flipscreen" inputId="flipscreen"
|
||||
@ -187,14 +197,6 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-12" *ngIf="form.get('overheat_mode')?.value === 1">
|
||||
<div class="field-checkbox">
|
||||
<p-checkbox name="overheat_mode" formControlName="overheat_mode" inputId="overheat_mode"
|
||||
[binary]="true"></p-checkbox>
|
||||
<label for="overheat_mode" style="color: #ff0000;">Disable Overheat Mode. Make sure to reset Frequency and Voltage</label>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="mt-2">
|
||||
<button pButton [disabled]="form.invalid" (click)="updateSystem()"
|
||||
class="btn btn-primary mr-2">Save</button>
|
||||
|
@ -199,8 +199,6 @@ export class EditComponent implements OnInit {
|
||||
delete form.stratumPassword;
|
||||
}
|
||||
|
||||
form.overheat_mode = form.overheat_mode ? 1 : 0;
|
||||
|
||||
this.systemService.updateSystem(this.uri, form)
|
||||
.pipe(this.loadingService.lockUIUntilComplete())
|
||||
.subscribe({
|
||||
@ -223,6 +221,11 @@ export class EditComponent implements OnInit {
|
||||
this.showWifiPassword = !this.showWifiPassword;
|
||||
}
|
||||
|
||||
disableOverheatMode() {
|
||||
this.form.patchValue({ overheat_mode: 0 });
|
||||
this.updateSystem();
|
||||
}
|
||||
|
||||
showFallbackStratumPassword: boolean = false;
|
||||
toggleFallbackStratumPasswordVisibility() {
|
||||
this.showFallbackStratumPassword = !this.showFallbackStratumPassword;
|
||||
|
@ -20,7 +20,7 @@ export class LoadingService {
|
||||
},
|
||||
error: (err) => {
|
||||
this.loading$.next(false);
|
||||
subscriber.next(err);
|
||||
subscriber.error(err);
|
||||
},
|
||||
complete: () => {
|
||||
this.loading$.next(false);
|
||||
@ -31,4 +31,3 @@ export class LoadingService {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user