Docker 파일

This commit is contained in:
2025-12-28 14:31:12 +09:00
parent ba7a208da9
commit 6196c03e46
23 changed files with 302 additions and 355 deletions

View File

@@ -1,15 +1,17 @@
import { getDb } from '../../utils/db'
import { query } from '../../utils/db'
export default defineEventHandler(() => {
const db = getDb()
export default defineEventHandler(async () => {
let rows: any[] = []
try {
rows = await query(`
SELECT category, metric, warning, critical, danger, updated_at
FROM thresholds
ORDER BY category, metric
`)
} catch (e) {
rows = []
}
const rows = db.prepare(`
SELECT category, metric, warning, critical, danger, updated_at
FROM thresholds
ORDER BY category, metric
`).all() as any[]
// 카테고리별로 그룹화
const result: Record<string, Record<string, { warning: number; critical: number; danger: number }>> = {}
for (const row of rows) {