mirror of
https://github.com/crocofied/CoreControl.git
synced 2025-12-17 15:36:50 +00:00
server_history model
This commit is contained in:
parent
21dd61c597
commit
1ae8b3e324
@ -269,7 +269,7 @@ func getServers(db *sql.DB) []Server {
|
||||
|
||||
func checkAndUpdateStatus(db *sql.DB, client *http.Client, apps []Application) {
|
||||
var notificationTemplate string
|
||||
err := db.QueryRow("SELECT notification_text FROM settings LIMIT 1").Scan(¬ificationTemplate)
|
||||
err := db.QueryRow("SELECT notification_text_application FROM settings LIMIT 1").Scan(¬ificationTemplate)
|
||||
if err != nil || notificationTemplate == "" {
|
||||
notificationTemplate = "The application !name (!url) went !status!"
|
||||
}
|
||||
|
||||
@ -0,0 +1,12 @@
|
||||
-- CreateTable
|
||||
CREATE TABLE "server_history" (
|
||||
"id" SERIAL NOT NULL,
|
||||
"serverId" INTEGER NOT NULL DEFAULT 1,
|
||||
"online" BOOLEAN NOT NULL DEFAULT true,
|
||||
"cpuUsage" TEXT,
|
||||
"ramUsage" TEXT,
|
||||
"diskUsage" TEXT,
|
||||
"createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
||||
|
||||
CONSTRAINT "server_history_pkey" PRIMARY KEY ("id")
|
||||
);
|
||||
@ -32,6 +32,16 @@ model uptime_history {
|
||||
createdAt DateTime @default(now())
|
||||
}
|
||||
|
||||
model server_history {
|
||||
id Int @id @default(autoincrement())
|
||||
serverId Int @default(1)
|
||||
online Boolean @default(true)
|
||||
cpuUsage String?
|
||||
ramUsage String?
|
||||
diskUsage String?
|
||||
createdAt DateTime @default(now())
|
||||
}
|
||||
|
||||
model server {
|
||||
id Int @id @default(autoincrement())
|
||||
host Boolean @default(false)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user