fix: disable chart when offline

This commit is contained in:
hamster1963
2024-12-06 10:34:06 +08:00
parent b80af34a45
commit d746411f79
3 changed files with 82 additions and 68 deletions

View File

@@ -76,6 +76,12 @@ export default function ServerDetailChart({
return <ServerDetailChartLoading />;
}
const { online } = formatNezhaInfo(nezhaWsData.now, server);
if (!online) {
return <ServerDetailChartLoading />;
}
return (
<section className="grid md:grid-cols-2 lg:grid-cols-3 grid-cols-1 gap-3">
<CpuChart now={nezhaWsData.now} data={server} />