Add server hardware/network detail view with Proxmox sync and agent reporting
Servers & Tasks only tracked scheduled tasks — there was no overview of the servers themselves and no way to see CPU/RAM/disk/IP info. Add a clickable server overview (visible to every role, not just admins) that opens a per-server detail page. - servers table gains an agent-reported hardware/network snapshot (IPs, CPU model/cores/load, memory, disks) and an optional link to a Proxmox VM/LXC (integration + node + guest type + vmid). - Proxmox adapter gains getGuestDetail(): live cores/memory/disk from /config, live cpu/mem/uptime from /status/current, and IPs (LXC net config directly, QEMU via a best-effort guest-agent call that degrades gracefully when the agent isn't installed). - New GET /api/servers/:id/detail combines whichever hardware source applies (live Proxmox vs. last agent report) with a DNS reverse-lookup against the DNS module's own record cache, so matching hostnames show up next to each IP. New PATCH /api/servers/:id manages the Proxmox link. - agent/linux/report-tasks.sh now also collects and reports IPs, CPU/memory/disk info on every check-in (load-average-based CPU number, not instantaneous, to keep the agent a cheap oneshot). - Extracted the per-server task table into a shared ServerTaskTable component so the all-servers view and the new detail page render tasks identically. Verified server-side end-to-end against the real dev server (agent report -> detail endpoint -> DNS match) and the Proxmox adapter against a mock HTTPS server covering LXC/QEMU config parsing and the guest-agent-unavailable fallback. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
1 parent
1f0e6a9d4c
commit
b9409d3095
15 files changed
+2206
-140
No files matched your search
@@ -181,6 +181,54 @@ export interface ServerRecord {
|
||||
apiTokenPrefix: string;
|
||||
createdAt: string;
|
||||
lastSeenAt: string | null;
|
||||
proxmoxIntegrationId: number | null;
|
||||
proxmoxNode: string | null;
|
||||
proxmoxGuestType: "qemu" | "lxc" | null;
|
||||
proxmoxVmid: number | null;
|
||||
}
|
||||
|
||||
export interface ServerHardware {
|
||||
source: "proxmox" | "agent" | "none";
|
||||
error?: string;
|
||||
integrationId?: number;
|
||||
integrationName?: string;
|
||||
status?: string;
|
||||
cpuModel?: string;
|
||||
cpuCores?: number | null;
|
||||
cpuUsagePercent?: number | null;
|
||||
cpuLoadPercent?: number | null;
|
||||
memTotalBytes?: number | null;
|
||||
memUsedBytes?: number | null;
|
||||
diskBytes?: number | null;
|
||||
disks?: { mount: string; sizeBytes: number; usedBytes: number }[];
|
||||
uptime?: number | null;
|
||||
guestAgentAvailable?: boolean;
|
||||
}
|
||||
|
||||
export interface DnsMatch {
|
||||
recordName: string;
|
||||
recordType: string;
|
||||
ip: string;
|
||||
zoneName: string | null;
|
||||
providerName: string;
|
||||
providerType: string;
|
||||
}
|
||||
|
||||
export interface ServerDetail {
|
||||
server: ServerRecord;
|
||||
ipAddresses: string[];
|
||||
hardware: ServerHardware;
|
||||
dnsMatches: DnsMatch[];
|
||||
}
|
||||
|
||||
export interface ServerUpdateInput {
|
||||
name?: string;
|
||||
hostname?: string;
|
||||
description?: string;
|
||||
proxmoxIntegrationId?: number | null;
|
||||
proxmoxNode?: string | null;
|
||||
proxmoxGuestType?: "qemu" | "lxc" | null;
|
||||
proxmoxVmid?: number | null;
|
||||
}
|
||||
|
||||
export type ScheduleType = "cron" | "systemd_timer" | "docker" | "backup" | "update" | "n8n_workflow" | "manual";
|
||||
@@ -486,6 +534,9 @@ export const api = {
|
||||
request<{ server: ServerRecord; token: string }>(`/api/servers/${id}/rotate-token`, {
|
||||
method: "POST",
|
||||
}),
|
||||
update: (id: number, data: ServerUpdateInput) =>
|
||||
request<{ server: ServerRecord }>(`/api/servers/${id}`, { method: "PATCH", body: JSON.stringify(data) }),
|
||||
detail: (id: number) => request<ServerDetail>(`/api/servers/${id}/detail`),
|
||||
remove: (id: number) => request<void>(`/api/servers/${id}`, { method: "DELETE" }),
|
||||
},
|
||||
tasks: {
|
||||
|
||||
Reference in new issue
Block a user