Docker 파일
This commit is contained in:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user