Skip to content

Commit

Permalink
BM1368 voltage dropdown, log scrolling, restart button
Browse files Browse the repository at this point in the history
  • Loading branch information
benjamin-wilson committed Mar 12, 2024
1 parent b958b85 commit e23e23d
Show file tree
Hide file tree
Showing 7 changed files with 29 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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 },
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ export class HomeComponent {
datasets: [
{
type: 'line',
label: '10 Minute',
label: 'Hashrate',
data: [],
fill: false,
backgroundColor: primaryColor,
Expand Down Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,11 @@ <h5>Overview</h5>
<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>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ export class LogsComponent implements OnDestroy, AfterViewChecked {

public showLogs = false;

public stopScroll: boolean = false;

constructor(
private websocketService: WebsocketService,
private systemService: SystemService
Expand Down Expand Up @@ -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' });
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@


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

</div>

</div>
Original file line number Diff line number Diff line change
Expand Up @@ -132,4 +132,10 @@
}
}
}
}

#restart {
bottom: 2rem;
position: absolute;
left: 8rem;
}

0 comments on commit e23e23d

Please sign in to comment.