mirror of
https://github.com/labring/FastGPT.git
synced 2025-10-14 23:22:22 +00:00
perf: auto refresh split data
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
|
||||
const nextConfig = {
|
||||
output: 'standalone',
|
||||
reactStrictMode: true,
|
||||
reactStrictMode: false,
|
||||
compress: true,
|
||||
|
||||
webpack(config) {
|
||||
|
@@ -41,10 +41,6 @@ export const usePagination = <T = any,>({
|
||||
}
|
||||
});
|
||||
|
||||
useEffect(() => {
|
||||
mutate(1);
|
||||
}, []);
|
||||
|
||||
const Pagination = useCallback(() => {
|
||||
return (
|
||||
<Flex alignItems={'center'} justifyContent={'end'}>
|
||||
@@ -93,6 +89,10 @@ export const usePagination = <T = any,>({
|
||||
);
|
||||
}, [maxPage, mutate, pageNum]);
|
||||
|
||||
useEffect(() => {
|
||||
mutate(1);
|
||||
}, [mutate]);
|
||||
|
||||
return {
|
||||
pageNum,
|
||||
pageSize,
|
||||
|
@@ -144,7 +144,8 @@ ${
|
||||
messages: filterPrompts,
|
||||
frequency_penalty: 0.5, // 越大,重复内容越少
|
||||
presence_penalty: -0.5, // 越大,越容易出现新内容
|
||||
stream: true
|
||||
stream: true,
|
||||
stop: ['.!?。']
|
||||
},
|
||||
{
|
||||
timeout: 40000,
|
||||
|
@@ -166,7 +166,8 @@ ${
|
||||
messages: filterPrompts,
|
||||
frequency_penalty: 0.5, // 越大,重复内容越少
|
||||
presence_penalty: -0.5, // 越大,越容易出现新内容
|
||||
stream: isStream
|
||||
stream: isStream,
|
||||
stop: ['.!?。']
|
||||
},
|
||||
{
|
||||
timeout: 180000,
|
||||
|
@@ -93,10 +93,16 @@ const ModelDataCard = ({ modelId }: { modelId: string }) => {
|
||||
(num = 1) => {
|
||||
getData(num);
|
||||
refetch();
|
||||
return null;
|
||||
},
|
||||
[getData, refetch]
|
||||
);
|
||||
|
||||
useQuery(['refetchData'], () => refetchData(pageNum), {
|
||||
refetchInterval: 5000,
|
||||
enabled: splitDataLen > 0
|
||||
});
|
||||
|
||||
// 获取所有的数据,并导出 json
|
||||
const { mutate: onclickExport, isLoading: isLoadingExport = false } = useMutation({
|
||||
mutationFn: () => getExportDataList(modelId),
|
||||
@@ -170,7 +176,7 @@ const ModelDataCard = ({ modelId }: { modelId: string }) => {
|
||||
</Menu>
|
||||
</Flex>
|
||||
<Flex mt={4}>
|
||||
{splitDataLen > 0 && <Box fontSize={'xs'}>{splitDataLen}条数据正在拆分...</Box>}
|
||||
{splitDataLen > 0 && <Box fontSize={'xs'}>{splitDataLen}条数据正在拆分,请耐心等待...</Box>}
|
||||
<Box flex={1} />
|
||||
<Input
|
||||
maxW={'240px'}
|
||||
|
Reference in New Issue
Block a user