add correct icon / label for windows build number

This commit is contained in:
henrygd
2025-04-05 17:33:41 -04:00
parent 3f1f4c7596
commit 80df0efccd
2 changed files with 27 additions and 2 deletions

View File

@@ -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,

View File

@@ -12,6 +12,21 @@ export function TuxIcon(props: SVGProps<SVGSVGElement>) {
)
}
// meteor icons (MIT) https://github.com/zkreations/icons/blob/main/LICENSE
export function WindowsIcon(props: SVGProps<SVGSVGElement>) {
return (
<svg viewBox="0 0 24 24" {...props}>
<path
fill="none"
stroke="currentColor"
strokeLinejoin="round"
strokeWidth="2"
d="M2 12h20m-11.3 8.3V3.7M2 5l20-3v20L2 19Z"
/>
</svg>
)
}
// MingCute Apache License 2.0 https://github.com/Richard9394/MingCute
export function Rows(props: SVGProps<SVGSVGElement>) {
return (