From 4c9f43fff322ac98260e6f6655bd31f387b0b788 Mon Sep 17 00:00:00 2001 From: xyfer17 Date: Wed, 9 Oct 2024 23:27:00 +0530 Subject: [PATCH] feat: add auto scroll effect in logs --- web-server/src/content/Service/SystemLogs.tsx | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/web-server/src/content/Service/SystemLogs.tsx b/web-server/src/content/Service/SystemLogs.tsx index ccbe4d385..c098b7ebb 100644 --- a/web-server/src/content/Service/SystemLogs.tsx +++ b/web-server/src/content/Service/SystemLogs.tsx @@ -17,12 +17,12 @@ export const SystemLogs = ({ serviceName }: { serviceName: ServiceNames }) => { useEffect(() => { if (containerRef.current) { - containerRef.current.scrollTop = containerRef.current.scrollHeight; + containerRef.current.scrollIntoView({ behavior: 'smooth' }); } }, [logs]); return ( - + {loading ? ( @@ -41,6 +41,7 @@ export const SystemLogs = ({ serviceName }: { serviceName: ServiceNames }) => { )) )} + ); };