fix: use formatNezhaInfo

This commit is contained in:
hamster1963
2024-12-02 14:23:55 +08:00
parent 3d4bd79ad5
commit ac5632ae69
2 changed files with 50 additions and 41 deletions

View File

@@ -27,6 +27,17 @@ export function formatNezhaInfo(now: number, serverInfo: NezhaServer) {
platform: serverInfo.host.platform || "",
net_out_transfer: serverInfo.state.net_out_transfer || 0,
net_in_transfer: serverInfo.state.net_in_transfer || 0,
arch: serverInfo.host.arch || "",
mem_total: serverInfo.host.mem_total || 0,
swap_total: serverInfo.host.swap_total || 0,
disk_total: serverInfo.host.disk_total || 0,
boot_time: serverInfo.host.boot_time || 0,
platform_version: serverInfo.host.platform_version || "",
cpu_info: serverInfo.host.cpu || [],
gpu_info: serverInfo.host.gpu || [],
load_1: serverInfo.state.load_1?.toFixed(2) || 0.0,
load_5: serverInfo.state.load_5?.toFixed(2) || 0.0,
load_15: serverInfo.state.load_15?.toFixed(2) || 0.0,
};
}