Skip to content

Commit

Permalink
swarm refreshing
Browse files Browse the repository at this point in the history
  • Loading branch information
benjamin-wilson committed Nov 25, 2023
1 parent c1d92c7 commit 1fae878
Show file tree
Hide file tree
Showing 14 changed files with 426 additions and 224 deletions.
6 changes: 3 additions & 3 deletions main/http_server/axe-os/src/app/app-routing.module.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { NgModule } from '@angular/core';
import { RouterModule, Routes } from '@angular/router';

import { EditComponent } from './components/edit/edit.component';
import { HomeComponent } from './components/home/home.component';
import { SettingsComponent } from './components/settings/settings.component';
import { SwarmComponent } from './components/swarm/swarm.component';

const routes: Routes = [
Expand All @@ -11,8 +11,8 @@ const routes: Routes = [
component: HomeComponent
},
{
path: 'edit',
component: EditComponent
path: 'settings',
component: SettingsComponent
},
{
path: 'swarm',
Expand Down
2 changes: 1 addition & 1 deletion main/http_server/axe-os/src/app/app.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<div class="tab-container">
<div class="tab" [routerLink]="['/']" routerLinkActive="active" [routerLinkActiveOptions]="{exact:true}">Home
</div>
<div class="tab" [routerLink]="['edit']" routerLinkActive="active" [routerLinkActiveOptions]="{exact:true}">
<div class="tab" [routerLink]="['settings']" routerLinkActive="active" [routerLinkActiveOptions]="{exact:true}">
Settings
</div>
<div class="tab" [routerLink]="['swarm']" routerLinkActive="active" [routerLinkActiveOptions]="{exact:true}">
Expand Down
2 changes: 1 addition & 1 deletion main/http_server/axe-os/src/app/app.component.scss
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
}

.content {
padding-top: 26px;
padding-top: 50px;
padding-left: 5vw;
padding-right: 5vw;
border-left: 1px solid #304562;
Expand Down
16 changes: 10 additions & 6 deletions main/http_server/axe-os/src/app/app.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,24 +12,28 @@ import { EditComponent } from './components/edit/edit.component';
import { HeaderComponent } from './components/header/header.component';
import { HomeComponent } from './components/home/home.component';
import { LoadingComponent } from './components/loading/loading.component';
import { SettingsComponent } from './components/settings/settings.component';
import { SwarmComponent } from './components/swarm/swarm.component';
import { ANSIPipe } from './pipes/ansi.pipe';
import { DateAgoPipe } from './pipes/date-ago.pipe';
import { SwarmComponent } from './components/swarm/swarm.component';

const components = [
AppComponent,
HeaderComponent
HeaderComponent,
EditComponent,
HomeComponent,
LoadingComponent,
SettingsComponent
];

@NgModule({
declarations: [
...components,
EditComponent,
HomeComponent,
LoadingComponent,

ANSIPipe,
DateAgoPipe,
SwarmComponent
SwarmComponent,
SettingsComponent
],
imports: [
BrowserModule,
Expand Down
234 changes: 107 additions & 127 deletions main/http_server/axe-os/src/app/components/edit/edit.component.html
Original file line number Diff line number Diff line change
@@ -1,148 +1,128 @@
<div class="card">
<h2>Settings</h2>
<ng-container *ngIf="form != null">
<form [formGroup]="form">
<div class="form-group">
<label>Flip Screen</label>
<input formControlName="flipscreen" type="checkbox">
</div>
<!-- <div class="form-group">
<label>Invert Screen</label>
<input formControlName="invertscreen" type="checkbox">
</div> -->
<div class="form-group">
<label>WiFi SSID: </label>
<input formControlName="ssid" type="text">
</div>
<div class="form-group">
<label>WiFi Password: </label>
<input formControlName="wifiPass" type="password">
</div>
<div class="form-group">
<label>Stratum URL: (Do not include 'stratum+tcp://' or port</label>
<input formControlName="stratumURL" type="text">
</div>
<ng-container *ngIf="form != null">
<form [formGroup]="form">
<div class="form-group">
<label>Flip Screen</label>
<input formControlName="flipscreen" type="checkbox">
</div>
<!-- <div class="form-group">
<label>Invert Screen</label>
<input formControlName="invertscreen" type="checkbox">
</div> -->
<div class="form-group">
<label>WiFi SSID: </label>
<input formControlName="ssid" type="text">
</div>
<div class="form-group">
<label>WiFi Password: </label>
<input formControlName="wifiPass" type="password">
</div>
<div class="form-group">
<label>Stratum URL: (Do not include 'stratum+tcp://' or port</label>
<input formControlName="stratumURL" type="text">
</div>
<div class="form-group">
<label>Stratum Port:</label>
<input formControlName="stratumPort" type="number">
</div>
<div class="form-group">
<label>Stratum User: </label>
<input formControlName="stratumUser" type="text">
</div>

<ng-container *ngIf="!devToolsOpen && ASICModel == eASICModel.BM1366">

<div class="form-group">
<label>Stratum Port:</label>
<input formControlName="stratumPort" type="number">
<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>Stratum User: </label>
<input formControlName="stratumUser" type="text">
<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.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>

<ng-container *ngIf="!devToolsOpen && ASICModel == eASICModel.BM1397">

<div class="form-group">
<label>Invert Fan Polarity</label>
<input formControlName="invertfanpolarity" type="checkbox">
<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>Automatic Fan Control</label>
<input formControlName="autofanspeed" type="checkbox">
<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>


<div class="form-group" *ngIf="form.controls['autofanspeed'].value != true">
<label>Fan Speed {{form.controls['fanspeed'].value}}%
<b *ngIf="form.controls['fanspeed'].value < 33" style="color:red">Danger: Could Cause
Overheating</b> <b *ngIf="form.controls['fanspeed'].value == 100" style="color: #F2A900">S19
Simulator</b></label>
<input formControlName="fanspeed" type="range" [min]="0" [max]="100">
<ng-container *ngIf="devToolsOpen === true">
<div class="form-group">
<label>Frequency </label>
<input formControlName="frequency" type="number">
</div>
<div class="mt-2">
<button [disabled]="form.invalid" (click)="updateSystem()" class="btn btn-primary mr-2">Save</button>
<b style="line-height: 34px;">You must restart this device after saving for changes to take effect.</b>

<div class="form-group">
<label>Core Voltage</label>
<input formControlName="coreVoltage" type="number">
</div>
</ng-container>


</form>
</ng-container>
<div class="form-group">
<label>Invert Fan Polarity</label>
<input formControlName="invertfanpolarity" type="checkbox">
</div>

<div class="form-group">
<label>Automatic Fan Control</label>
<input formControlName="autofanspeed" type="checkbox">
</div>


</div>
<div class="form-group" *ngIf="form.controls['autofanspeed'].value != true">
<label>Fan Speed {{form.controls['fanspeed'].value}}%
<b *ngIf="form.controls['fanspeed'].value < 33" style="color:red">Danger: Could Cause
Overheating</b> <b *ngIf="form.controls['fanspeed'].value == 100" style="color: #F2A900">S19
Simulator</b></label>
<input formControlName="fanspeed" type="range" [min]="0" [max]="100">
</div>
<div class="mt-2">
<button [disabled]="form.invalid" (click)="updateSystem()" class="btn btn-primary mr-2">Save</button>
<b style="line-height: 34px;">You must restart this device after saving for changes to take effect.</b>
</div>

<div class="card">
<h2>Update Firmware <span *ngIf="firmwareUpdateProgress != null">{{firmwareUpdateProgress}}%</span></h2>
<input type="file" id="file" (change)="otaUpdate($event)" accept=".bin">
<br>
<small>(esp-miner.bin)</small>
</div>

<div class="card">
<h2>Update Website <span *ngIf="websiteUpdateProgress != null">{{websiteUpdateProgress}}%</span></h2>
<input type="file" id="file" (change)="otaWWWUpdate($event)" accept=".bin">
<br>
<small>(www.bin)</small>
</div>
</form>
</ng-container>
Loading

0 comments on commit 1fae878

Please sign in to comment.