Skip to content

Commit

Permalink
fix: Temp suffix & 5v marker (#448)
Browse files Browse the repository at this point in the history
  • Loading branch information
mrv777 authored Nov 4, 2024
1 parent 7e46c48 commit b5d0ea5
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -99,10 +99,15 @@ <h6>Power <span style="float: right;">{{info.power}} W</span></h6>
<div class="col-12">

<h6>Input Voltage <span style="float: right;">{{info.voltage}} V</span></h6>
<p-progressBar [value]="(info.voltage / 5.5) * 100" [style]="{ height: '6px' }" >
<ng-template pTemplate="content" let-value>
</ng-template>
</p-progressBar>
<div class="relative">
<p-progressBar [value]="(info.voltage / 5.5) * 100" [style]="{ height: '6px' }">
<ng-template pTemplate="content" let-value></ng-template>
</p-progressBar>
<!-- Add marker at 5.0V (90.91% of 5.5V) -->
<div class="absolute bg-white" style="left: 90.5%; top: 0; width: 3px; height: 6px;">
<small class="absolute text-white" style="top: -1.25rem; transform: translateX(-50%)">5.0</small>
</div>
</div>
<span class="danger" *ngIf="info.voltage < 4.8">&nbsp; Danger: Low voltage</span>
</div>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ export class HomeComponent {
data: [],
fill: false,
backgroundColor: primaryColor + '30',
borderColor: primaryColor + '30',
borderColor: primaryColor + '60',
tension: 0,
pointRadius: 0,
borderWidth: 2,
Expand Down Expand Up @@ -103,7 +103,11 @@ export class HomeComponent {
if (label) {
label += ': ';
}
label += HashSuffixPipe.transform(tooltipItem.raw);
if (tooltipItem.dataset.label === 'ASIC Temp') {
label += tooltipItem.raw + '°C';
} else {
label += HashSuffixPipe.transform(tooltipItem.raw);
}
return label;
}
}
Expand Down Expand Up @@ -139,7 +143,8 @@ export class HomeComponent {
display: true,
position: 'right',
ticks: {
color: textColorSecondary
color: textColorSecondary,
callback: (value: number) => value + '°C'
},
grid: {
drawOnChartArea: false,
Expand Down

0 comments on commit b5d0ea5

Please sign in to comment.