mirror of
https://github.com/fankes/beszel.git
synced 2025-10-19 17:59:28 +08:00
feat: add kernel version text (#170)
This commit is contained in:
@@ -206,7 +206,9 @@ func (a *Agent) getSystemStats() (system.Info, system.Stats) {
|
||||
if info, err := host.Info(); err == nil {
|
||||
systemInfo.Uptime = info.Uptime
|
||||
systemInfo.Hostname = info.Hostname
|
||||
systemInfo.KernelVersion = info.KernelVersion
|
||||
}
|
||||
|
||||
// add cpu stats
|
||||
if info, err := cpu.Info(); err == nil && len(info) > 0 {
|
||||
systemInfo.CpuModel = info[0].ModelName
|
||||
|
@@ -46,6 +46,7 @@ type NetIoStats struct {
|
||||
|
||||
type Info struct {
|
||||
Hostname string `json:"h"`
|
||||
KernelVersion string `json:"k"`
|
||||
|
||||
Cores int `json:"c"`
|
||||
Threads int `json:"t"`
|
||||
|
@@ -12,6 +12,7 @@ import {
|
||||
MonitorIcon,
|
||||
StretchHorizontalIcon,
|
||||
XIcon,
|
||||
BinaryIcon
|
||||
} from 'lucide-react'
|
||||
import ChartTimeSelect from '../charts/chart-time-select'
|
||||
import {
|
||||
@@ -270,6 +271,18 @@ export default function SystemDetail({ name }: { name: string }) {
|
||||
</Tooltip>
|
||||
</TooltipProvider>
|
||||
)}
|
||||
{/* kernel */}
|
||||
<TooltipProvider>
|
||||
<Tooltip delayDuration={150}>
|
||||
<Separator orientation="vertical" className="h-4 bg-primary/30" />
|
||||
<TooltipTrigger asChild>
|
||||
<div className="flex gap-1.5 items-center">
|
||||
<BinaryIcon className="h-4 w-4" /> {system.info.k}
|
||||
</div>
|
||||
</TooltipTrigger>
|
||||
<TooltipContent>Kernel</TooltipContent>
|
||||
</Tooltip>
|
||||
</TooltipProvider>
|
||||
{system.info?.u && (
|
||||
<TooltipProvider>
|
||||
<Tooltip delayDuration={150}>
|
||||
|
2
beszel/site/src/types.d.ts
vendored
2
beszel/site/src/types.d.ts
vendored
@@ -12,6 +12,8 @@ export interface SystemRecord extends RecordModel {
|
||||
export interface SystemInfo {
|
||||
/** hostname */
|
||||
h: string
|
||||
/** kernel **/
|
||||
k: string
|
||||
/** cpu percent */
|
||||
cpu: number
|
||||
/** cpu threads */
|
||||
|
Reference in New Issue
Block a user