diff --git a/beszel/internal/entities/system/system.go b/beszel/internal/entities/system/system.go
index 41f9909..ee5b239 100644
--- a/beszel/internal/entities/system/system.go
+++ b/beszel/internal/entities/system/system.go
@@ -45,12 +45,11 @@ type NetIoStats struct {
}
type Info struct {
- Hostname string `json:"h"`
- KernelVersion string `json:"k"`
-
- Cores int `json:"c"`
- Threads int `json:"t"`
- CpuModel string `json:"m"`
+ Hostname string `json:"h"`
+ KernelVersion string `json:"k,omitempty"`
+ Cores int `json:"c"`
+ Threads int `json:"t"`
+ CpuModel string `json:"m"`
// Os string `json:"o"`
Uptime uint64 `json:"u"`
Cpu float64 `json:"cpu"`
diff --git a/beszel/site/src/components/routes/system.tsx b/beszel/site/src/components/routes/system.tsx
index 7fc4603..5d5e581 100644
--- a/beszel/site/src/components/routes/system.tsx
+++ b/beszel/site/src/components/routes/system.tsx
@@ -12,7 +12,6 @@ import {
MonitorIcon,
StretchHorizontalIcon,
XIcon,
- BinaryIcon
} from 'lucide-react'
import ChartTimeSelect from '../charts/chart-time-select'
import {
@@ -27,6 +26,7 @@ import { scaleTime } from 'd3-scale'
import { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger } from '../ui/tooltip'
import { Button, buttonVariants } from '../ui/button'
import { Input } from '../ui/input'
+import { TuxIcon } from '../ui/icons'
const CpuChart = lazy(() => import('../charts/cpu-chart'))
const ContainerCpuChart = lazy(() => import('../charts/container-cpu-chart'))
@@ -200,13 +200,37 @@ export default function SystemDetail({ name }: { name: string }) {
setDockerNetChartData(dockerNetData)
}, [])
- const uptime = useMemo(() => {
- let uptime = system.info?.u || 0
- if (uptime < 172800) {
- return `${Math.trunc(uptime / 3600)} hours`
+ // values for system info bar
+ const systemInfo = useMemo(() => {
+ if (!system.info) {
+ return []
}
- return `${Math.trunc(system.info?.u / 86400)} days`
- }, [system.info?.u])
+ console.log('doing')
+ let uptime: number | string = system.info.u
+ if (system.info.u < 172800) {
+ uptime = `${Math.trunc(uptime / 3600)} hours`
+ } else {
+ uptime = `${Math.trunc(system.info?.u / 86400)} days`
+ }
+ return [
+ { value: system.host, Icon: GlobeIcon },
+ {
+ value: system.info.h,
+ Icon: MonitorIcon,
+ label: 'Hostname',
+ // hide if hostname is same as host or name
+ hide: system.info.h === system.host || system.info.h === system.name,
+ },
+ { value: uptime, Icon: ClockArrowUp, label: 'Uptime' },
+ { value: system.info.k, Icon: TuxIcon, label: 'Kernel' },
+ { value: `${system.info.m} (${system.info.c}c/${system.info.t}t)`, Icon: CpuIcon },
+ ] as {
+ value: string | number | undefined
+ label?: string
+ Icon: any
+ hide?: boolean
+ }[]
+ }, [system.info])
/** Space for tooltip if more than 12 containers */
const bottomSpacing = useMemo(() => {
@@ -253,58 +277,31 @@ export default function SystemDetail({ name }: { name: string }) {
{system.status}
-