mirror of
https://github.com/labring/FastGPT.git
synced 2025-07-24 22:03:54 +00:00
Add image index and pdf parse (#3956)
* feat: think tag parse * feat: parse think tag test * feat: pdf parse ux * feat: doc2x parse * perf: rewrite training mode setting * feat: image parse queue * perf: image index * feat: image parse process * feat: add init sh * fix: ts
This commit is contained in:
@@ -17,7 +17,7 @@ const MyPhotoView = (props: ImageProps) => {
|
||||
loadingElement={<Loading fixed={false} />}
|
||||
>
|
||||
<PhotoView src={props.src}>
|
||||
<MyImage cursor={'pointer'} {...props} />
|
||||
<MyImage cursor={'pointer'} {...props} title={props.title || props.src} />
|
||||
</PhotoView>
|
||||
</PhotoProvider>
|
||||
);
|
||||
|
@@ -11,8 +11,8 @@ type Props = BoxProps & {
|
||||
const MyBox = ({ text, isLoading, children, size, ...props }: Props, ref: any) => {
|
||||
return (
|
||||
<Box ref={ref} position={isLoading ? 'relative' : 'unset'} {...props}>
|
||||
{isLoading && <Loading fixed={false} text={text} size={size} />}
|
||||
{children}
|
||||
{isLoading && <Loading fixed={false} text={text} size={size} />}
|
||||
</Box>
|
||||
);
|
||||
};
|
||||
|
@@ -1,26 +1,24 @@
|
||||
import React from 'react';
|
||||
import { Box, Flex, useTheme, Grid, type GridProps, HStack } from '@chakra-ui/react';
|
||||
import { useTranslation } from 'next-i18next';
|
||||
import MyTooltip from '../MyTooltip';
|
||||
import QuestionTip from '../MyTooltip/QuestionTip';
|
||||
|
||||
// @ts-ignore
|
||||
interface Props extends GridProps {
|
||||
type Props<T> = Omit<GridProps, 'onChange'> & {
|
||||
list: {
|
||||
title: string;
|
||||
desc?: string;
|
||||
value: any;
|
||||
value: T;
|
||||
children?: React.ReactNode;
|
||||
tooltip?: string;
|
||||
}[];
|
||||
align?: 'flex-top' | 'center';
|
||||
value: any;
|
||||
value: T;
|
||||
defaultBg?: string;
|
||||
activeBg?: string;
|
||||
onChange: (e: any) => void;
|
||||
}
|
||||
onChange: (e: T) => void;
|
||||
};
|
||||
|
||||
const LeftRadio = ({
|
||||
const LeftRadio = <T = any,>({
|
||||
list,
|
||||
value,
|
||||
align = 'flex-top',
|
||||
@@ -30,7 +28,7 @@ const LeftRadio = ({
|
||||
activeBg = 'primary.50',
|
||||
onChange,
|
||||
...props
|
||||
}: Props) => {
|
||||
}: Props<T>) => {
|
||||
const { t } = useTranslation();
|
||||
const theme = useTheme();
|
||||
|
||||
@@ -39,7 +37,7 @@ const LeftRadio = ({
|
||||
{list.map((item) => (
|
||||
<Flex
|
||||
alignItems={item.desc ? align : 'center'}
|
||||
key={item.value}
|
||||
key={item.value as any}
|
||||
cursor={'pointer'}
|
||||
userSelect={'none'}
|
||||
px={px}
|
||||
@@ -98,7 +96,7 @@ const LeftRadio = ({
|
||||
fontSize={'sm'}
|
||||
>
|
||||
<Box>{typeof item.title === 'string' ? t(item.title as any) : item.title}</Box>
|
||||
{!!item.tooltip && <QuestionTip label={item.tooltip} ml={1} color={'myGray.600'} />}
|
||||
{!!item.tooltip && <QuestionTip label={item.tooltip} color={'myGray.600'} />}
|
||||
</HStack>
|
||||
</Flex>
|
||||
{!!item.desc && (
|
||||
|
Reference in New Issue
Block a user