Skip to content

Commit

Permalink
Merge branch 'patch-4'
Browse files Browse the repository at this point in the history
  • Loading branch information
Soltares committed Oct 16, 2024
2 parents 68e447d + 8b5283d commit d80e4cf
Showing 1 changed file with 13 additions and 6 deletions.
19 changes: 13 additions & 6 deletions ui/src/Nodes.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -152,14 +152,21 @@
</div>
<!-- Battery -->
<div title="Battery Level" class="text-sm font-normal bg-black/20 rounded p-1 min-w-11 h-7 text-center">
{node.deviceMetrics?.batteryLevel || 0}%
{#if node.deviceMetrics?.batteryLevel === 101}
<!-- device using external power -->
⚡︎
{:else}
{node.deviceMetrics?.batteryLevel || 0}%
{/if}
<div
class="h-0.5"
style="width: {node.deviceMetrics?.batteryLevel || 0}%; background-color: {node.deviceMetrics?.batteryLevel >= 70
? 'green'
: node.deviceMetrics?.batteryLevel >= 30
? 'yellow'
: 'red'};"
style="width: {node.deviceMetrics?.batteryLevel || 0}%; background-color: {node.deviceMetrics?.batteryLevel === 101
? 'steelblue'
: node.deviceMetrics?.batteryLevel >= 70
? 'green'
: node.deviceMetrics?.batteryLevel >= 30
? 'yellow'
: 'red'};"
></div>
</div>

Expand Down

0 comments on commit d80e4cf

Please sign in to comment.