From 88d6307ce06ff67a353e18966d6ccbea05565efc Mon Sep 17 00:00:00 2001 From: henrygd Date: Mon, 28 Apr 2025 19:37:00 -0400 Subject: [PATCH] Add FreeBSD icon --- beszel/internal/agent/system.go | 3 +++ beszel/internal/entities/system/system.go | 1 + beszel/site/src/components/routes/system.tsx | 6 +++++- beszel/site/src/components/ui/icons.tsx | 12 ++++++++++++ beszel/site/src/lib/enums.ts | 2 +- 5 files changed, 22 insertions(+), 2 deletions(-) diff --git a/beszel/internal/agent/system.go b/beszel/internal/agent/system.go index a1a129f..6269565 100644 --- a/beszel/internal/agent/system.go +++ b/beszel/internal/agent/system.go @@ -31,6 +31,9 @@ func (a *Agent) initializeSystemInfo() { } else if strings.Contains(platform, "indows") { a.systemInfo.KernelVersion = strings.Replace(platform, "Microsoft ", "", 1) + " " + version a.systemInfo.Os = system.Windows + } else if platform == "freebsd" { + a.systemInfo.Os = system.Freebsd + a.systemInfo.KernelVersion = version } else { a.systemInfo.Os = system.Linux } diff --git a/beszel/internal/entities/system/system.go b/beszel/internal/entities/system/system.go index e298911..08c8d6b 100644 --- a/beszel/internal/entities/system/system.go +++ b/beszel/internal/entities/system/system.go @@ -70,6 +70,7 @@ const ( Linux Os = iota Darwin Windows + Freebsd ) type Info struct { diff --git a/beszel/site/src/components/routes/system.tsx b/beszel/site/src/components/routes/system.tsx index 5606e81..14540cf 100644 --- a/beszel/site/src/components/routes/system.tsx +++ b/beszel/site/src/components/routes/system.tsx @@ -32,7 +32,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, WindowsIcon, AppleIcon } from "../ui/icons" +import { ChartAverage, ChartMax, Rows, TuxIcon, WindowsIcon, AppleIcon, FreeBsdIcon } from "../ui/icons" import { useIntersectionObserver } from "@/lib/use-intersection-observer" import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from "../ui/select" import { timeTicks } from "d3-time" @@ -276,6 +276,10 @@ export default function SystemDetail({ name }: { name: string }) { Icon: WindowsIcon, value: system.info.k, }, + [Os.FreeBSD]: { + Icon: FreeBsdIcon, + value: system.info.k, + }, } let uptime: React.ReactNode diff --git a/beszel/site/src/components/ui/icons.tsx b/beszel/site/src/components/ui/icons.tsx index 272ec8d..7800264 100644 --- a/beszel/site/src/components/ui/icons.tsx +++ b/beszel/site/src/components/ui/icons.tsx @@ -38,6 +38,18 @@ export function AppleIcon(props: SVGProps) { ) } +// Apache 2.0 https://github.com/Templarian/MaterialDesign/blob/master/LICENSE +export function FreeBsdIcon(props: SVGProps) { + return ( + + + + ) +} + // ion icons (MIT) https://github.com/ionic-team/ionicons/blob/main/LICENSE export function DockerIcon(props: SVGProps) { return ( diff --git a/beszel/site/src/lib/enums.ts b/beszel/site/src/lib/enums.ts index 8c42574..ded663a 100644 --- a/beszel/site/src/lib/enums.ts +++ b/beszel/site/src/lib/enums.ts @@ -2,7 +2,7 @@ export enum Os { Linux = 0, Darwin, Windows, - // FreeBSD, + FreeBSD, } export enum ChartType {