Skip to content

Commit

Permalink
fix: chart
Browse files Browse the repository at this point in the history
  • Loading branch information
hamster1963 committed Dec 26, 2024
1 parent 93a90f4 commit 83122ad
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 3 deletions.
12 changes: 12 additions & 0 deletions app/(main)/ClientComponents/detail/ServerDetailChartClient.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,8 @@ function CpuChart({ history, data }: { history: ServerDataWithTimestamp[]; data:
setCpuChartData(historyData)
hasInitialized.current = true
setHistoryLoaded(true)
} else if (history.length === 0) {
setHistoryLoaded(true)
}
}, [])

Expand Down Expand Up @@ -224,6 +226,8 @@ function ProcessChart({
setProcessChartData(historyData)
hasInitialized.current = true
setHistoryLoaded(true)
} else if (history.length === 0) {
setHistoryLoaded(true)
}
}, [])

Expand Down Expand Up @@ -326,6 +330,8 @@ function MemChart({ data, history }: { data: NezhaAPISafe; history: ServerDataWi
setMemChartData(historyData)
hasInitialized.current = true
setHistoryLoaded(true)
} else if (history.length === 0) {
setHistoryLoaded(true)
}
}, [])

Expand Down Expand Up @@ -477,6 +483,8 @@ function DiskChart({ data, history }: { data: NezhaAPISafe; history: ServerDataW
setDiskChartData(historyData)
hasInitialized.current = true
setHistoryLoaded(true)
} else if (history.length === 0) {
setHistoryLoaded(true)
}
}, [])

Expand Down Expand Up @@ -604,6 +612,8 @@ function NetworkChart({
setNetworkChartData(historyData)
hasInitialized.current = true
setHistoryLoaded(true)
} else if (history.length === 0) {
setHistoryLoaded(true)
}
}, [])

Expand Down Expand Up @@ -750,6 +760,8 @@ function ConnectChart({
setConnectChartData(historyData)
hasInitialized.current = true
setHistoryLoaded(true)
} else if (history.length === 0) {
setHistoryLoaded(true)
}
}, [])

Expand Down
Binary file modified bun.lockb
Binary file not shown.
3 changes: 0 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -68,13 +68,10 @@
"@types/node": "^22.10.2",
"@types/react": "^19.0.2",
"@types/react-dom": "^19.0.2",
"eslint": "^9.17.0",
"eslint-config-next": "^15.1.2",
"eslint-plugin-turbo": "^2.3.3",
"eslint-plugin-unused-imports": "^4.1.4",
"postcss": "^8.4.49",
"prettier": "^3.4.2",
"prettier-plugin-tailwindcss": "^0.6.9",
"tailwindcss": "^4.0.0-beta.8",
"typescript": "^5.7.2",
"vercel": "^39.2.2"
Expand Down

0 comments on commit 83122ad

Please sign in to comment.