From 80df0efccd5529370455fdc583896fd701a36ffc Mon Sep 17 00:00:00 2001 From: henrygd Date: Sat, 5 Apr 2025 17:33:41 -0400 Subject: [PATCH] add correct icon / label for windows build number --- beszel/site/src/components/routes/system.tsx | 14 ++++++++++++-- beszel/site/src/components/ui/icons.tsx | 15 +++++++++++++++ 2 files changed, 27 insertions(+), 2 deletions(-) diff --git a/beszel/site/src/components/routes/system.tsx b/beszel/site/src/components/routes/system.tsx index 6d4e534..f6a27c0 100644 --- a/beszel/site/src/components/routes/system.tsx +++ b/beszel/site/src/components/routes/system.tsx @@ -22,7 +22,7 @@ import { Separator } from "../ui/separator" import { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger } from "../ui/tooltip" import { Button } from "../ui/button" import { Input } from "../ui/input" -import { ChartAverage, ChartMax, Rows, TuxIcon } from "../ui/icons" +import { ChartAverage, ChartMax, Rows, TuxIcon, WindowsIcon } from "../ui/icons" import { useIntersectionObserver } from "@/lib/use-intersection-observer" import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from "../ui/select" import { timeTicks } from "d3-time" @@ -251,6 +251,12 @@ export default function SystemDetail({ name }: { name: string }) { if (!system.info) { return [] } + let version = system.info.k ?? "" + const buildIndex = version.indexOf(" Build") + const isWindows = buildIndex !== -1 + if (isWindows) { + version = version.substring(0, buildIndex) + } let uptime: React.ReactNode if (system.info.u < 172800) { const hours = Math.trunc(system.info.u / 3600) @@ -268,7 +274,11 @@ export default function SystemDetail({ name }: { name: string }) { hide: system.info.h === system.host || system.info.h === system.name, }, { value: uptime, Icon: ClockArrowUp, label: t`Uptime`, hide: !system.info.u }, - { value: system.info.k, Icon: TuxIcon, label: t({ comment: "Linux kernel", message: "Kernel" }) }, + { + value: version, + Icon: isWindows ? WindowsIcon : TuxIcon, + label: isWindows ? t`Windows build` : t({ comment: "Linux kernel", message: "Kernel" }), + }, { value: `${system.info.m} (${system.info.c}c${system.info.t ? `/${system.info.t}t` : ""})`, Icon: CpuIcon, diff --git a/beszel/site/src/components/ui/icons.tsx b/beszel/site/src/components/ui/icons.tsx index d0489c0..8fe4060 100644 --- a/beszel/site/src/components/ui/icons.tsx +++ b/beszel/site/src/components/ui/icons.tsx @@ -12,6 +12,21 @@ export function TuxIcon(props: SVGProps) { ) } +// meteor icons (MIT) https://github.com/zkreations/icons/blob/main/LICENSE +export function WindowsIcon(props: SVGProps) { + return ( + + + + ) +} + // MingCute Apache License 2.0 https://github.com/Richard9394/MingCute export function Rows(props: SVGProps) { return (