mirror of
https://github.com/fankes/beszel.git
synced 2025-10-19 17:59:28 +08:00
add correct icon / label for windows build number
This commit is contained in:
@@ -22,7 +22,7 @@ import { Separator } from "../ui/separator"
|
|||||||
import { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger } from "../ui/tooltip"
|
import { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger } from "../ui/tooltip"
|
||||||
import { Button } from "../ui/button"
|
import { Button } from "../ui/button"
|
||||||
import { Input } from "../ui/input"
|
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 { useIntersectionObserver } from "@/lib/use-intersection-observer"
|
||||||
import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from "../ui/select"
|
import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from "../ui/select"
|
||||||
import { timeTicks } from "d3-time"
|
import { timeTicks } from "d3-time"
|
||||||
@@ -251,6 +251,12 @@ export default function SystemDetail({ name }: { name: string }) {
|
|||||||
if (!system.info) {
|
if (!system.info) {
|
||||||
return []
|
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
|
let uptime: React.ReactNode
|
||||||
if (system.info.u < 172800) {
|
if (system.info.u < 172800) {
|
||||||
const hours = Math.trunc(system.info.u / 3600)
|
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,
|
hide: system.info.h === system.host || system.info.h === system.name,
|
||||||
},
|
},
|
||||||
{ value: uptime, Icon: ClockArrowUp, label: t`Uptime`, hide: !system.info.u },
|
{ 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` : ""})`,
|
value: `${system.info.m} (${system.info.c}c${system.info.t ? `/${system.info.t}t` : ""})`,
|
||||||
Icon: CpuIcon,
|
Icon: CpuIcon,
|
||||||
|
@@ -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
|
// MingCute Apache License 2.0 https://github.com/Richard9394/MingCute
|
||||||
export function Rows(props: SVGProps<SVGSVGElement>) {
|
export function Rows(props: SVGProps<SVGSVGElement>) {
|
||||||
return (
|
return (
|
||||||
|
Reference in New Issue
Block a user