Skip to content

Commit a0e8757

Browse files
authored
Chart data source selection (#955)
* Unify data types for the statistics data * Add chart data source selection * Apply patch for dropdowns on the dashboard * Use api for suggestedMax values / Set precision to 3 for asic voltage * Reload chart after source selection * Add chart data selection label None * Add loadPreviousData and limitDataPoints functions / Apply patch for reload optimization * Integrate changes after rebase * Revert "Unify data types for the statistics data" * Use enum for data sources * Clean up comments * Apply patch for dropdown color and width * Add parameters to the statistics data request * Use column list as parameter * Decouple display and backend labels * Use local storage and data request with parameters * Update API specification and clean up * Remove delay for test data to fix distorted data with ng serve * Wider drop-down menu to prevent cut-off * Filter out vrTemp from drop-down menu if not available (e.g. for Ultra) * Remove the <small> option * Fix hashrate conversion for the title --------- Co-authored-by: duckaxe <>
1 parent bbddfdc commit a0e8757

File tree

10 files changed

+567
-235
lines changed

10 files changed

+567
-235
lines changed

main/http_server/axe-os/src/app/components/home/home.component.html

Lines changed: 25 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
<span class="block text-500 font-medium mb-3">Hashrate</span>
3131
<div class="text-900 font-medium text-2xl flex align-items-center gap-2">
3232
<span *ngIf="!info.power_fault">
33-
{{info.hashRate * 1000000000 | hashSuffix}}
33+
{{info.hashRate | hashSuffix}}
3434
</span>
3535
<span *ngIf="info.power_fault" class="text-red-500">
3636
Not available - Power fault
@@ -47,7 +47,7 @@
4747
</ng-container>
4848

4949
<div class="text-500 text-xs" *ngIf="!info.power_fault && info.expectedHashrate">
50-
Expected: {{info.expectedHashrate * 1000000000 | hashSuffix}}
50+
Expected: {{info.expectedHashrate | hashSuffix}}
5151
</div>
5252
</div>
5353
</div>
@@ -58,7 +58,7 @@
5858
<span class="block text-500 font-medium mb-3">Efficiency</span>
5959
<div class="text-900 font-medium text-2xl flex align-items-center gap-2">
6060
<span *ngIf="!info.power_fault">
61-
{{info.power / (info.hashRate/1000) | number: '1.2-2'}} <small>J/Th</small>
61+
{{info.power / (info.hashRate / 1000000000000) | number: '1.2-2'}} J/Th
6262
</span>
6363
<span *ngIf="info.power_fault" class="text-red-500">
6464
Not available - Power fault
@@ -70,12 +70,12 @@
7070
<ng-container *ngIf="!info.power_fault">
7171
Average:
7272
<span class="text-green-500 font-medium">
73-
{{calculateEfficiencyAverage(hashrateData, powerData) | number: '1.2-2'}} <small>J/Th</small>
73+
{{calculateEfficiencyAverage(hashrateData, powerData) | number: '1.2-2'}} J/Th
7474
</span>
7575
</ng-container>
7676

7777
<div class="text-500 text-xs" *ngIf="!info.power_fault && info.expectedHashrate">
78-
Expected: {{info.power / (info.expectedHashrate/1000) | number: '1.2-2'}} J/Th
78+
Expected: {{info.power / (info.expectedHashrate / 1000000000000) | number: '1.2-2'}} J/Th
7979
</div>
8080
</div>
8181
</div>
@@ -134,7 +134,26 @@
134134

135135
<div class="col-12" *ngIf="!info.power_fault">
136136
<div class="card">
137-
<p-chart #chart id="chart" [data]="chartData" [options]="chartOptions"></p-chart>
137+
<form [formGroup]="form">
138+
<div class="flex flex-nowrap justify-content-between mb-3">
139+
<p-dropdown
140+
[options]="dataSourceLabels(info)"
141+
optionLabel="name"
142+
optionValue="value"
143+
formControlName="chartY1Data"
144+
styleClass="w-10rem p-dropdown--border-color-primary p-dropdown--small">
145+
</p-dropdown>
146+
<p-dropdown
147+
[options]="dataSourceLabels(info)"
148+
optionLabel="name"
149+
optionValue="value"
150+
formControlName="chartY2Data"
151+
styleClass="w-10rem border-500 p-dropdown--small">
152+
</p-dropdown>
153+
</div>
154+
155+
<p-chart #chart id="chart" [data]="chartData" [options]="chartOptions"></p-chart>
156+
</form>
138157
</div>
139158
</div>
140159

0 commit comments

Comments
 (0)