chore: deploy model from local path

This commit is contained in:
jialin
2024-11-07 17:35:07 +08:00
parent 8bc67b323c
commit 93a6a77c2b
15 changed files with 270 additions and 77 deletions
+25 -3
View File
@@ -1,7 +1,14 @@
import useOverlayScroller from '@/hooks/use-overlay-scroller';
import classNames from 'classnames';
import _, { throttle } from 'lodash';
import React, { useCallback, useEffect, useRef, useState } from 'react';
import React, {
forwardRef,
useCallback,
useEffect,
useImperativeHandle,
useRef,
useState
} from 'react';
import './styles/logs-list.less';
interface LogsListProps {
@@ -9,12 +16,14 @@ interface LogsListProps {
height?: number;
onScroll?: (isTop: boolean) => void;
diffHeight?: number;
ref?: any;
}
const LogsList: React.FC<LogsListProps> = (props) => {
const LogsList: React.FC<LogsListProps> = forwardRef((props, ref) => {
const { dataList, height, onScroll, diffHeight = 96 } = props;
const {
initialize,
updateScrollerPosition,
updateScrollerPositionToTop,
generateInstance,
scrollEventElement,
instance,
@@ -28,6 +37,19 @@ const LogsList: React.FC<LogsListProps> = (props) => {
const scroller = useRef<any>({});
const stopScroll = useRef(false);
const scrollToBottom = useCallback(() => {
updateScrollerPosition(0);
}, [updateScrollerPosition]);
const scrollToTop = useCallback(() => {
updateScrollerPositionToTop();
}, [updateScrollerPositionToTop]);
useImperativeHandle(ref, () => ({
scrollToBottom,
scrollToTop
}));
const debounceResetStopScroll = _.debounce(() => {
stopScroll.current = false;
}, 30000);
@@ -106,6 +128,6 @@ const LogsList: React.FC<LogsListProps> = (props) => {
</div>
</div>
);
};
});
export default React.memo(LogsList);