fix(style): hide table cell content if too long

This commit is contained in:
jialin
2024-09-28 19:23:56 +08:00
parent 197488bff6
commit bc921ff835
13 changed files with 46 additions and 21 deletions
+2 -2
View File
@@ -26,11 +26,11 @@
}
.xterm {
height: 100% !important;
// height: 100% !important;
.xterm-viewport {
overflow-y: auto !important;
// custom scrollbar
&::-webkit-scrollbar {
width: var(--scrollbar-size);
height: var(--scrollbar-size);
+11 -6
View File
@@ -26,7 +26,7 @@ const LogsViewer: React.FC<LogsViewerProps> = (props) => {
const [logs, setLogs] = useState('');
const size = useSize(scroller);
const throttleScroll = _.debounce(() => {
const throttleScroll = _.throttle(() => {
termRef.current?.scrollToBottom?.();
}, 100);
@@ -36,6 +36,7 @@ const LogsViewer: React.FC<LogsViewerProps> = (props) => {
termRef.current?.clear?.();
cacheDataRef.current = data;
termRef.current?.write?.(data);
setLogs(data);
}, 100),
[]
);
@@ -78,11 +79,11 @@ const LogsViewer: React.FC<LogsViewerProps> = (props) => {
termRef.current.open(termwrapRef.current);
// add event
termRef.current.onLineFeed((e: any) => {
if (cacheDataRef.current) {
throttleScroll();
}
});
// termRef.current.onLineFeed((e: any) => {
// if (cacheDataRef.current) {
// throttleScroll();
// }
// });
};
const handleResize = _.throttle(() => {
@@ -111,6 +112,10 @@ const LogsViewer: React.FC<LogsViewerProps> = (props) => {
}
}, [size]);
useEffect(() => {
throttleScroll();
}, [logs]);
return (
<div className="logs-viewer-wrap-w2">
<div className="wrap" style={{ height: height }} ref={scroller}>