feat: add kernel version text (#170)

This commit is contained in:
Stavros
2024-09-17 20:43:58 +03:00
committed by GitHub
parent ec95f63806
commit 9cccefd3fa
4 changed files with 18 additions and 0 deletions

View File

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

View File

@@ -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"`

View File

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

View File

@@ -12,6 +12,8 @@ export interface SystemRecord extends RecordModel {
export interface SystemInfo {
/** hostname */
h: string
/** kernel **/
k: string
/** cpu percent */
cpu: number
/** cpu threads */