mirror of
https://github.com/skot/ESP-Miner.git
synced 2025-03-29 11:11:45 +01:00
pre selected frequency and voltage
This commit is contained in:
parent
75c70a3fe8
commit
10caab213c
@ -25,14 +25,76 @@
|
||||
<label>Stratum User: </label>
|
||||
<input formControlName="stratumUser" type="text">
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label>Frequency </label>
|
||||
<input formControlName="frequency" type="number">
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label>Core Voltage</label>
|
||||
<input formControlName="coreVoltage" type="number">
|
||||
</div>
|
||||
|
||||
<ng-container *ngIf="!devToolsOpen && ASICModel == eASICModel.BM1366">
|
||||
|
||||
<div class="form-group">
|
||||
<label>Frequency </label>
|
||||
<select formControlName="frequency">
|
||||
<option value="400">400</option>
|
||||
<option value="425">425</option>
|
||||
<option value="450">450</option>
|
||||
<option value="475">475</option>
|
||||
<option value="485">485 (default)</option>
|
||||
<option value="500">500</option>
|
||||
<option value="525">525</option>
|
||||
<option value="550">550</option>
|
||||
<option value="575">575</option>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label>Core Voltage </label>
|
||||
<select formControlName="coreVoltage">
|
||||
<option value="1100">1100</option>
|
||||
<option value="1150">1150</option>
|
||||
<option value="1200">1200 (default)</option>
|
||||
<option value="1250">1250</option>
|
||||
<option value="1300">1300</option>
|
||||
</select>
|
||||
</div>
|
||||
</ng-container>
|
||||
|
||||
<ng-container *ngIf="!devToolsOpen && ASICModel == eASICModel.BM1397">
|
||||
|
||||
<div class="form-group">
|
||||
<label>Frequency </label>
|
||||
<select formControlName="frequency">
|
||||
<option value="400">400</option>
|
||||
<option value="425">425 (default)</option>
|
||||
<option value="450">450</option>
|
||||
<option value="475">475</option>
|
||||
<option value="485">485</option>
|
||||
<option value="500">500</option>
|
||||
<option value="525">525</option>
|
||||
<option value="550">550</option>
|
||||
<option value="575">575</option>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label>Core Voltage </label>
|
||||
<select formControlName="coreVoltage">
|
||||
<option value="1300">1300</option>
|
||||
<option value="1350">1350</option>
|
||||
<option value="1400">1400 (default)</option>
|
||||
<option value="1450">1450</option>
|
||||
<option value="1500">1500</option>
|
||||
</select>
|
||||
</div>
|
||||
</ng-container>
|
||||
|
||||
<ng-container *ngIf="devToolsOpen === true">
|
||||
<div class="form-group">
|
||||
<label>Frequency </label>
|
||||
<input formControlName="frequency" type="number">
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label>Core Voltage</label>
|
||||
<input formControlName="coreVoltage" type="number">
|
||||
</div>
|
||||
</ng-container>
|
||||
|
||||
|
||||
</form>
|
||||
|
@ -1,8 +1,25 @@
|
||||
input {
|
||||
min-width: 500px
|
||||
min-width: 250px;
|
||||
max-width: 90%;
|
||||
}
|
||||
|
||||
select {
|
||||
min-width: 268px;
|
||||
max-width: 90%;
|
||||
}
|
||||
|
||||
.restart {
|
||||
margin-bottom: 1.5rem;
|
||||
|
||||
}
|
||||
|
||||
@media only screen and (min-width:900px) {
|
||||
|
||||
input {
|
||||
min-width: 500px
|
||||
}
|
||||
|
||||
select {
|
||||
min-width: 518px
|
||||
}
|
||||
}
|
@ -4,6 +4,7 @@ import { FormBuilder, FormGroup, Validators } from '@angular/forms';
|
||||
import { ToastrService } from 'ngx-toastr';
|
||||
import { LoadingService } from 'src/app/services/loading.service';
|
||||
import { SystemService } from 'src/app/services/system.service';
|
||||
import { eASICModel } from 'src/models/enum/eASICModel';
|
||||
|
||||
@Component({
|
||||
selector: 'app-edit',
|
||||
@ -17,6 +18,11 @@ export class EditComponent {
|
||||
public firmwareUpdateProgress: number | null = null;
|
||||
public websiteUpdateProgress: number | null = null;
|
||||
|
||||
|
||||
public devToolsOpen: boolean = false;
|
||||
public eASICModel = eASICModel;
|
||||
public ASICModel!: eASICModel;
|
||||
|
||||
constructor(
|
||||
private fb: FormBuilder,
|
||||
private systemService: SystemService,
|
||||
@ -24,9 +30,14 @@ export class EditComponent {
|
||||
private toastrService: ToastrService,
|
||||
private loadingService: LoadingService
|
||||
) {
|
||||
|
||||
window.addEventListener('resize', this.checkDevTools);
|
||||
this.checkDevTools();
|
||||
|
||||
this.systemService.getInfo()
|
||||
.pipe(this.loadingService.lockUIUntilComplete())
|
||||
.subscribe(info => {
|
||||
this.ASICModel = info.ASICModel;
|
||||
this.form = this.fb.group({
|
||||
stratumURL: [info.stratumURL, [Validators.required]],
|
||||
stratumPort: [info.stratumPort, [Validators.required]],
|
||||
@ -38,9 +49,26 @@ export class EditComponent {
|
||||
});
|
||||
});
|
||||
}
|
||||
private checkDevTools = () => {
|
||||
if (
|
||||
window.outerWidth - window.innerWidth > 160 ||
|
||||
window.outerHeight - window.innerHeight > 160
|
||||
) {
|
||||
this.devToolsOpen = true;
|
||||
} else {
|
||||
this.devToolsOpen = false;
|
||||
}
|
||||
};
|
||||
|
||||
public updateSystem() {
|
||||
this.systemService.updateSystem(this.form.value)
|
||||
|
||||
const form = this.form.value;
|
||||
|
||||
form.frequency = parseInt(form.frequency);
|
||||
form.coreVoltage = parseInt(form.coreVoltage);
|
||||
|
||||
|
||||
this.systemService.updateSystem(form)
|
||||
.pipe(this.loadingService.lockUIUntilComplete())
|
||||
.subscribe({
|
||||
next: () => {
|
||||
@ -124,4 +152,9 @@ export class EditComponent {
|
||||
});
|
||||
this.toastr.success('Success!', 'Bitaxe restarted');
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
@ -1,6 +1,7 @@
|
||||
import { HttpClient, HttpEvent } from '@angular/common/http';
|
||||
import { Injectable } from '@angular/core';
|
||||
import { delay, Observable, of } from 'rxjs';
|
||||
import { eASICModel } from 'src/models/enum/eASICModel';
|
||||
import { ISystemInfo } from 'src/models/ISystemInfo';
|
||||
|
||||
import { environment } from '../../environments/environment';
|
||||
@ -20,27 +21,27 @@ export class SystemService {
|
||||
} else {
|
||||
return of(
|
||||
{
|
||||
"power": 11.670000076293945,
|
||||
"voltage": 5208.75,
|
||||
"current": 2237.5,
|
||||
"fanSpeed": 82,
|
||||
"temp": 60,
|
||||
"hashRate": 0,
|
||||
"bestDiff": "0",
|
||||
"freeHeap": 200504,
|
||||
"coreVoltage": 1188,
|
||||
"ssid": "skimadtrees-secure",
|
||||
"wifiPass": "password",
|
||||
"wifiStatus": "Connected!",
|
||||
"sharesAccepted": 1,
|
||||
"sharesRejected": 0,
|
||||
"uptimeSeconds": 38,
|
||||
"ASICModel": "BM1366",
|
||||
"stratumURL": "192.168.1.242",
|
||||
"stratumPort": 3333,
|
||||
"stratumUser": "bc1q99n3pu025yyu0jlywpmwzalyhm36tg5u37w20d.bitaxe-U1",
|
||||
"frequency": 485,
|
||||
"version": "2.0",
|
||||
power: 11.670000076293945,
|
||||
voltage: 5208.75,
|
||||
current: 2237.5,
|
||||
fanSpeed: 82,
|
||||
temp: 60,
|
||||
hashRate: 0,
|
||||
bestDiff: "0",
|
||||
freeHeap: 200504,
|
||||
coreVoltage: 1200,
|
||||
ssid: "default",
|
||||
wifiPass: "password",
|
||||
wifiStatus: "Connected!",
|
||||
sharesAccepted: 1,
|
||||
sharesRejected: 0,
|
||||
uptimeSeconds: 38,
|
||||
ASICModel: eASICModel.BM1366,
|
||||
stratumURL: "192.168.1.242",
|
||||
stratumPort: 3333,
|
||||
stratumUser: "bc1q99n3pu025yyu0jlywpmwzalyhm36tg5u37w20d.bitaxe-U1",
|
||||
frequency: 485,
|
||||
version: "2.0",
|
||||
}
|
||||
).pipe(delay(1000));
|
||||
}
|
||||
|
@ -1,3 +1,5 @@
|
||||
import { eASICModel } from './enum/eASICModel';
|
||||
|
||||
export interface ISystemInfo {
|
||||
|
||||
power: number,
|
||||
@ -15,7 +17,7 @@ export interface ISystemInfo {
|
||||
sharesAccepted: number,
|
||||
sharesRejected: number,
|
||||
uptimeSeconds: number,
|
||||
ASICModel: string,
|
||||
ASICModel: eASICModel,
|
||||
stratumURL: string,
|
||||
stratumPort: number,
|
||||
stratumUser: string,
|
||||
|
4
main/http_server/axe-os/src/models/enum/eASICModel.ts
Normal file
4
main/http_server/axe-os/src/models/enum/eASICModel.ts
Normal file
@ -0,0 +1,4 @@
|
||||
export enum eASICModel {
|
||||
BM1366 = 'BM1366',
|
||||
BM1397 = 'BM1397'
|
||||
}
|
@ -94,7 +94,8 @@ button {
|
||||
|
||||
}
|
||||
|
||||
input {
|
||||
input,
|
||||
select {
|
||||
|
||||
font-size: 1rem;
|
||||
color: rgba(255, 255, 255, 0.87);
|
||||
|
Loading…
x
Reference in New Issue
Block a user