소스 수정
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user