fix: backend updateable when local path

This commit is contained in:
jialin
2024-11-08 15:09:25 +08:00
parent 93a6a77c2b
commit 343ada135d
7 changed files with 38 additions and 17 deletions
@@ -181,6 +181,18 @@ const LogsViewer: React.FC<LogsViewerProps> = forwardRef((props, ref) => {
[loading, isLoadend, logs.length, pageSize]
);
const debouncedScroll = useCallback(
_.debounce(() => {
if (scrollPos[0] === 'top') {
logListRef.current?.scrollToTop();
}
if (scrollPos[0] === 'bottom') {
logListRef.current?.scrollToBottom();
}
}, 150),
[scrollPos]
);
useEffect(() => {
createChunkConnection();
return () => {
@@ -189,12 +201,7 @@ const LogsViewer: React.FC<LogsViewerProps> = forwardRef((props, ref) => {
}, [url, props.params]);
useEffect(() => {
if (scrollPos[0] === 'top') {
logListRef.current?.scrollToTop();
}
if (scrollPos[0] === 'bottom') {
logListRef.current?.scrollToBottom();
}
debouncedScroll();
}, [scrollPos]);
return (