BM1368 voltage dropdown, log scrolling, restart button

This commit is contained in:
Ben 2024-03-11 22:36:45 -04:00
parent b958b85d57
commit e23e23db5f
7 changed files with 29 additions and 7 deletions

View File

@ -68,6 +68,10 @@ export class EditComponent implements OnInit {
{ name: '1200', value: 1200 },
{ name: '1250', value: 1250 },
{ name: '1300', value: 1300 },
{ name: '1350', value: 1350 },
{ name: '1400', value: 1400 },
{ name: '1450', value: 1450 },
{ name: '1500', value: 1500 },
];
public BM1366CoreVoltage = [
{ name: '1100', value: 1100 },

View File

@ -40,7 +40,7 @@ export class HomeComponent {
datasets: [
{
type: 'line',
label: '10 Minute',
label: 'Hashrate',
data: [],
fill: false,
backgroundColor: primaryColor,
@ -135,14 +135,14 @@ export class HomeComponent {
if (info.ASICModel === eASICModel.BM1366) {
const version = parseInt(info.boardVersion);
if (version >= 400 && version < 500) {
return (info.frequency * ((894 * 6) / 1000))
return Math.floor(info.frequency * ((894 * 6) / 1000))
} else {
return (info.frequency * (894 / 1000))
return Math.floor(info.frequency * (894 / 1000))
}
} else if (info.ASICModel === eASICModel.BM1397) {
return (info.frequency * (672 / 1000))
return Math.floor(info.frequency * (672 / 1000))
} else if (info.ASICModel === eASICModel.BM1368) {
return (info.frequency * (1276 / 1000))
return Math.floor(info.frequency * (1276 / 1000))
}
return undefined;

View File

@ -37,7 +37,11 @@
<h2>Realtime Logs <button pButton (click)="toggleLogs()" style="margin-left: 15px;"
class="btn btn-secondary">{{showLogs
? 'Hide': 'Show'}}
Logs</button></h2>
Logs</button>
<button pButton style="margin-left: 15px;" class="btn btn-secondary" (click)="stopScroll = !stopScroll"
*ngIf="showLogs">{{stopScroll ? 'Start' : 'Stop'}} Scrolling</button>
</h2>
<div *ngIf="showLogs" id="logs" #scrollContainer>
<div *ngFor="let log of logs">₿ {{log | ANSI}}</div>

View File

@ -20,6 +20,8 @@ export class LogsComponent implements OnDestroy, AfterViewChecked {
public showLogs = false;
public stopScroll: boolean = false;
constructor(
private websocketService: WebsocketService,
private systemService: SystemService
@ -65,6 +67,9 @@ export class LogsComponent implements OnDestroy, AfterViewChecked {
}
ngAfterViewChecked(): void {
if(this.stopScroll == true){
return;
}
if (this.scrollContainer?.nativeElement != null) {
this.scrollContainer.nativeElement.scrollTo({ left: 0, top: this.scrollContainer.nativeElement.scrollHeight, behavior: 'smooth' });
}

View File

@ -4,4 +4,7 @@
<li *ngIf="item.separator" class="menu-separator"></li>
</ng-container>
<p-button id="restart" label="Restart" severity="danger"></p-button>
</ul>

View File

@ -9,7 +9,7 @@
<div class="layout-topbar-menu">
<p-button (click)="restart()" label="Restart" severity="danger"></p-button>
</div>
</div>

View File

@ -132,4 +132,10 @@
}
}
}
}
#restart {
bottom: 2rem;
position: absolute;
left: 8rem;
}