fix: model be cleared when apply config to all in compare

This commit is contained in:
jialin
2024-11-22 18:25:07 +08:00
parent c8c22b3f22
commit a6f0f554f0
14 changed files with 124 additions and 102 deletions
+2 -2
View File
@@ -11,8 +11,8 @@ const options: any = {
...grid,
right: -1,
top: -1,
bottom: -1,
left: -1,
bottom: 2,
left: 2,
containLabel: true,
borderRadius: 4
},
@@ -13,7 +13,7 @@ interface LogsPaginationProps {
}
const LogsPagination: React.FC<LogsPaginationProps> = (props) => {
const { page, total, pageSize, onWheel, onNext, onPrev } = props;
const { page, total, pageSize, onNext, onPrev } = props;
const intl = useIntl();
const handleOnPrev = () => {
@@ -24,10 +24,11 @@ interface LogsViewerProps {
params?: object;
ref?: any;
tail?: number;
enableScorllLoad?: boolean;
diffHeight?: number;
}
const LogsViewer: React.FC<LogsViewerProps> = forwardRef((props, ref) => {
const { diffHeight, url, tail: defaultTail } = props;
const { diffHeight, url, tail: defaultTail, enableScorllLoad = true } = props;
const { pageSize, page, setPage, setTotalPage, totalPage } =
useLogsPagination();
const { setChunkFetch } = useSetChunkFetch();
@@ -169,7 +170,7 @@ const LogsViewer: React.FC<LogsViewerProps> = forwardRef((props, ref) => {
const handleOnScroll = useCallback(
async (isTop: boolean) => {
setIsAtTop(isTop);
if (loading || isLoadend || logs.length < pageSize) {
if (loading || isLoadend || logs.length < pageSize || !enableScorllLoad) {
return;
}
if (isTop && !isLoadend) {
-2
View File
@@ -199,14 +199,12 @@ const MarkdownViewer: React.FC<MarkdownViewerProps> = ({
return (
<>
(
<div
style={{ height }}
className="markdown-viewer custom-scrollbar-horizontal"
>
{renderTokens(tokens)}
</div>
)
</>
);
};