feat: add docker monitoring and ui fixes

This commit is contained in:
mstfyldz
2026-06-03 00:58:54 +03:00
parent e5dc347a0b
commit 29d03604f9
24 changed files with 1682 additions and 553 deletions
+5 -5
View File
@@ -26,7 +26,7 @@ export async function GET(req: Request) {
export async function POST(req: Request) {
try {
const body = await req.json()
const { db_id, schedule, cloud_type, credentials } = body
const { db_id, schedule, cloud_type, credentials, gdrive_folder_id } = body
if (!db_id || !schedule || !cloud_type || !credentials) {
return NextResponse.json({ error: 'Missing fields' }, { status: 400 })
@@ -37,13 +37,13 @@ export async function POST(req: Request) {
if (existing.rows.length > 0) {
await pool.query(
`UPDATE backup_configs SET schedule=$1, cloud_type=$2, credentials=$3 WHERE db_id=$4`,
[schedule, cloud_type, credentials, db_id]
`UPDATE backup_configs SET schedule=$1, cloud_type=$2, credentials=$3, gdrive_folder_id=$4 WHERE db_id=$5`,
[schedule, cloud_type, credentials, gdrive_folder_id || null, db_id]
)
} else {
await pool.query(
`INSERT INTO backup_configs (id, db_id, schedule, cloud_type, credentials) VALUES ($1, $2, $3, $4, $5)`,
[generateId(), db_id, schedule, cloud_type, credentials]
`INSERT INTO backup_configs (id, db_id, schedule, cloud_type, credentials, gdrive_folder_id) VALUES ($1, $2, $3, $4, $5, $6)`,
[generateId(), db_id, schedule, cloud_type, credentials, gdrive_folder_id || null]
)
}