Skip to content

Commit

Permalink
Merge pull request #253 from Server2003User/master
Browse files Browse the repository at this point in the history
Add device firmware version to WebUI
  • Loading branch information
Hunter275 authored Jun 23, 2024
2 parents 6b268b7 + 3aedc7b commit 8942468
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions src/components/Sidebar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,18 @@ import {
SettingsIcon,
UsersIcon,
ZapIcon,
BatteryMediumIcon
BatteryMediumIcon,
CpuIcon
} from "lucide-react";

export interface SidebarProps {
children?: React.ReactNode;
}

export const Sidebar = ({ children }: SidebarProps): JSX.Element => {
const { hardware, nodes } = useDevice();
const { hardware, nodes, metadata } = useDevice();
const myNode = nodes.get(hardware.myNodeNum);
const myMetadata = metadata.get(0);
const { activePage, setActivePage, setDialogOpen } = useDevice();

interface NavLink {
Expand Down Expand Up @@ -84,6 +86,10 @@ export const Sidebar = ({ children }: SidebarProps): JSX.Element => {
<ZapIcon size={24} viewBox={'0 0 36 24'}/>
<Subtle>{myNode?.deviceMetrics?.voltage.toPrecision(3) ?? "UNK"} volts</Subtle>
</div>
<div className="flex items-center">
<CpuIcon size={24} viewBox={'0 0 36 24'}/>
<Subtle>v{ myMetadata?.firmwareVersion ?? "UNK"}</Subtle>
</div>
</div>

<SidebarSection label="Navigation">
Expand All @@ -103,3 +109,4 @@ export const Sidebar = ({ children }: SidebarProps): JSX.Element => {
</div>
);
};

0 comments on commit 8942468

Please sign in to comment.