소스 수정

This commit is contained in:
2025-12-28 16:27:46 +09:00
parent 56451c8070
commit 1fc6a9ccd9
6 changed files with 89 additions and 15 deletions

View File

@@ -138,9 +138,20 @@ const thresholds = ref(JSON.parse(JSON.stringify(defaultThresholds)))
async function fetchThresholds() {
try {
const data = await $fetch('/api/settings/thresholds')
const data = await $fetch('/api/settings/thresholds') as any
if (data) {
thresholds.value = data as typeof defaultThresholds
// 기본값과 병합 (API 응답이 불완전할 수 있음)
thresholds.value = {
server: {
cpu: { ...defaultThresholds.server.cpu, ...data.server?.cpu },
memory: { ...defaultThresholds.server.memory, ...data.server?.memory },
disk: { ...defaultThresholds.server.disk, ...data.server?.disk }
},
container: {
cpu: { ...defaultThresholds.container.cpu, ...data.container?.cpu },
memory: { ...defaultThresholds.container.memory, ...data.container?.memory }
}
}
}
} catch (err) {
console.error('Failed to fetch thresholds:', err)