From bb37a516bf9455c1732ab6dd1a2103a44eea51cf Mon Sep 17 00:00:00 2001 From: Mauricio Siu <47042324+Siumauricio@users.noreply.github.com> Date: Fri, 3 Jan 2025 01:07:51 -0600 Subject: [PATCH] refactor: disable live when is all --- .../dashboard/monitoring/servers/show-monitoring.tsx | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/apps/dokploy/components/dashboard/monitoring/servers/show-monitoring.tsx b/apps/dokploy/components/dashboard/monitoring/servers/show-monitoring.tsx index f58b40d7d..3fd36af48 100644 --- a/apps/dokploy/components/dashboard/monitoring/servers/show-monitoring.tsx +++ b/apps/dokploy/components/dashboard/monitoring/servers/show-monitoring.tsx @@ -129,11 +129,14 @@ export const ShowMonitoring = ({ useEffect(() => { fetchMetrics(); - const interval = setInterval(() => { - fetchMetrics(); - }, REFRESH_INTERVAL); + // Solo crear el intervalo si no es "all" + if (dataPoints !== "all") { + const interval = setInterval(() => { + fetchMetrics(); + }, REFRESH_INTERVAL); - return () => clearInterval(interval); + return () => clearInterval(interval); + } }, [dataPoints]); if (isLoading) {