更新首页
This commit is contained in:
@@ -72,6 +72,7 @@ model News {
|
||||
id Int @id @default(autoincrement())
|
||||
title String
|
||||
summary String @default("")
|
||||
content String? @db.Text
|
||||
source String @default("")
|
||||
url String @default("")
|
||||
publishedAt DateTime
|
||||
@@ -98,6 +99,69 @@ model Alert {
|
||||
@@index([createdAt])
|
||||
}
|
||||
|
||||
|
||||
// 服务器监控: 对接 komari 公开 API
|
||||
model ServerNode {
|
||||
id Int @id @default(autoincrement())
|
||||
uuid String @unique
|
||||
name String
|
||||
cpuName String @default("")
|
||||
os String @default("")
|
||||
region String @default("")
|
||||
memTotal BigInt @default(0)
|
||||
diskTotal BigInt @default(0)
|
||||
cpuCores Int @default(0)
|
||||
// 最新实时快照
|
||||
cpuUsage Float @default(0)
|
||||
ramUsed BigInt @default(0)
|
||||
swapUsed BigInt @default(0)
|
||||
load1 Float @default(0)
|
||||
load5 Float @default(0)
|
||||
load15 Float @default(0)
|
||||
diskUsed BigInt @default(0)
|
||||
netIn BigInt @default(0)
|
||||
netOut BigInt @default(0)
|
||||
uptime BigInt @default(0)
|
||||
process Int @default(0)
|
||||
connections Int @default(0)
|
||||
status String @default("unknown") // online | offline | unknown
|
||||
recordedAt DateTime
|
||||
createdAt DateTime @default(now())
|
||||
updatedAt DateTime @updatedAt
|
||||
}
|
||||
|
||||
// 时序历史: 每节点每分钟一条 (komari records 1 分钟粒度)
|
||||
model ServerNodeHistory {
|
||||
id Int @id @default(autoincrement())
|
||||
uuid String
|
||||
period DateTime
|
||||
cpu Float @default(0)
|
||||
ram BigInt @default(0)
|
||||
load Float @default(0)
|
||||
disk BigInt @default(0)
|
||||
netIn BigInt @default(0)
|
||||
netOut BigInt @default(0)
|
||||
process Int @default(0)
|
||||
connections Int @default(0)
|
||||
createdAt DateTime @default(now())
|
||||
|
||||
@@unique([uuid, period])
|
||||
@@index([uuid, period])
|
||||
}
|
||||
|
||||
// 服务健康检查: 本应用自检 (健康端点 / DB / 第三方)
|
||||
model ServiceCheck {
|
||||
id Int @id @default(autoincrement())
|
||||
name String @unique
|
||||
url String
|
||||
status String @default("unknown") // up | down | unknown
|
||||
latencyMs Int @default(0)
|
||||
message String @default("")
|
||||
lastCheckAt DateTime
|
||||
createdAt DateTime @default(now())
|
||||
updatedAt DateTime @updatedAt
|
||||
}
|
||||
|
||||
model Econ_SowInventory {
|
||||
id Int @id @default(autoincrement())
|
||||
month String @unique
|
||||
|
||||
Reference in New Issue
Block a user