mirror of
https://github.com/fankes/beszel.git
synced 2025-10-19 09:49:28 +08:00
Adds a version listing in the hub for each agent.
This commit is contained in:
@@ -1,6 +1,7 @@
|
|||||||
package agent
|
package agent
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"beszel"
|
||||||
"beszel/internal/entities/container"
|
"beszel/internal/entities/container"
|
||||||
"beszel/internal/entities/system"
|
"beszel/internal/entities/system"
|
||||||
"bytes"
|
"bytes"
|
||||||
@@ -143,6 +144,7 @@ func (a *Agent) getSystemStats() (*system.Info, *system.Stats) {
|
|||||||
Cpu: systemStats.Cpu,
|
Cpu: systemStats.Cpu,
|
||||||
MemPct: systemStats.MemPct,
|
MemPct: systemStats.MemPct,
|
||||||
DiskPct: systemStats.DiskPct,
|
DiskPct: systemStats.DiskPct,
|
||||||
|
Vers: beszel.Version,
|
||||||
}
|
}
|
||||||
|
|
||||||
// add host info
|
// add host info
|
||||||
|
@@ -45,6 +45,7 @@ type Info struct {
|
|||||||
Cpu float64 `json:"cpu"`
|
Cpu float64 `json:"cpu"`
|
||||||
MemPct float64 `json:"mp"`
|
MemPct float64 `json:"mp"`
|
||||||
DiskPct float64 `json:"dp"`
|
DiskPct float64 `json:"dp"`
|
||||||
|
Vers string `json:"v"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// Final data structure to return to the hub
|
// Final data structure to return to the hub
|
||||||
|
@@ -55,6 +55,7 @@ import {
|
|||||||
PauseCircleIcon,
|
PauseCircleIcon,
|
||||||
PlayCircleIcon,
|
PlayCircleIcon,
|
||||||
Trash2Icon,
|
Trash2Icon,
|
||||||
|
Wifi,
|
||||||
} from 'lucide-react'
|
} from 'lucide-react'
|
||||||
import { useMemo, useState } from 'react'
|
import { useMemo, useState } from 'react'
|
||||||
import { $systems, pb } from '@/lib/stores'
|
import { $systems, pb } from '@/lib/stores'
|
||||||
@@ -135,6 +136,14 @@ export default function SystemsTable() {
|
|||||||
},
|
},
|
||||||
header: ({ column }) => sortableHeader(column, 'System', Server),
|
header: ({ column }) => sortableHeader(column, 'System', Server),
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
accessorKey: 'info.v',
|
||||||
|
cell: (info) => {
|
||||||
|
return(
|
||||||
|
<div>{info.getValue() as string}</div>)
|
||||||
|
},
|
||||||
|
header: ({ column }) => sortableHeader(column, 'Version', Wifi),
|
||||||
|
},
|
||||||
{
|
{
|
||||||
accessorKey: 'info.cpu',
|
accessorKey: 'info.cpu',
|
||||||
cell: CellFormatter,
|
cell: CellFormatter,
|
||||||
|
1
beszel/site/src/types.d.ts
vendored
1
beszel/site/src/types.d.ts
vendored
@@ -6,6 +6,7 @@ export interface SystemRecord extends RecordModel {
|
|||||||
status: 'up' | 'down' | 'paused' | 'pending'
|
status: 'up' | 'down' | 'paused' | 'pending'
|
||||||
port: string
|
port: string
|
||||||
info: SystemInfo
|
info: SystemInfo
|
||||||
|
agentVersion: string
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface SystemInfo {
|
export interface SystemInfo {
|
||||||
|
Reference in New Issue
Block a user