소스 수정

This commit is contained in:
2025-12-28 17:26:32 +09:00
parent 4312a942dc
commit 24741e2445
3 changed files with 37 additions and 22 deletions

View File

@@ -32,7 +32,15 @@ export default defineEventHandler(async (event) => {
SELECT
snapshot_id,
cpu_percent,
cpu_temp,
load_percent,
memory_percent,
memory_total,
memory_used,
memory_free,
swap_percent,
swap_total,
swap_used,
is_online,
collected_at
FROM server_snapshots

View File

@@ -455,10 +455,10 @@ async function collectServerData(target: ServerTarget) {
await execute(`
INSERT INTO server_snapshots (
target_id, os_name, os_version, host_name, uptime_seconds, uptime_str, ip_address,
cpu_name, cpu_count, cpu_percent, memory_total, memory_used, memory_percent,
cpu_name, cpu_count, cpu_percent, memory_total, memory_used, memory_free, memory_percent,
swap_total, swap_used, swap_percent, is_online, api_version, cpu_temp,
load_1, load_5, load_15, load_percent, collected_at
) VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11, $12, $13, $14, $15, $16, $17, $18, $19, $20, $21, $22, $23, $24)
) VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11, $12, $13, $14, $15, $16, $17, $18, $19, $20, $21, $22, $23, $24, $25)
`, [
target.target_id,
system?.os_name || system?.linux_distro || null,
@@ -472,6 +472,7 @@ async function collectServerData(target: ServerTarget) {
cpu?.total ?? quicklook?.cpu ?? null,
mem?.total || null,
mem?.used || null,
mem?.free || null,
mem?.percent || null,
memswap?.total || null,
memswap?.used || null,