mirror of
https://github.com/labring/FastGPT.git
synced 2025-07-23 13:03:50 +00:00
add ComplianceTip for dataset&chat
This commit is contained in:
@@ -38,6 +38,7 @@ import { clone } from 'lodash';
|
||||
import { formatFileSize } from '@fastgpt/global/common/file/tools';
|
||||
import MyBox from '@fastgpt/web/components/common/MyBox';
|
||||
import { getErrText } from '@fastgpt/global/common/error/utils';
|
||||
import ComplianceTip, { TipTypeEnum } from '@/components/support/compliance/ComplianceTip';
|
||||
|
||||
const InputGuideBox = dynamic(() => import('./InputGuideBox'));
|
||||
|
||||
@@ -709,6 +710,7 @@ const ChatInput = ({
|
||||
|
||||
{RenderTextarea}
|
||||
</Box>
|
||||
<ComplianceTip type={TipTypeEnum.chat} />
|
||||
</Box>
|
||||
);
|
||||
};
|
||||
|
@@ -6,6 +6,7 @@ import Markdown from '@/components/Markdown';
|
||||
import { FlowNodeTypeEnum } from '@fastgpt/global/core/workflow/node/constant';
|
||||
import AIResponseBox from '../../../components/AIResponseBox';
|
||||
import { useTranslation } from 'next-i18next';
|
||||
import ComplianceTip, { TipTypeEnum } from '@/components/support/compliance/ComplianceTip';
|
||||
const RenderOutput = () => {
|
||||
const { histories, isChatting } = useContextSelector(PluginRunContext, (v) => v);
|
||||
const { t } = useTranslation();
|
||||
@@ -49,6 +50,7 @@ const RenderOutput = () => {
|
||||
) : null}
|
||||
</Box>
|
||||
</Box>
|
||||
<ComplianceTip type={TipTypeEnum.chat} />
|
||||
</>
|
||||
);
|
||||
};
|
||||
|
@@ -0,0 +1,36 @@
|
||||
import { useSystemStore } from '@/web/common/system/useSystemStore';
|
||||
import { Box, BoxProps } from '@chakra-ui/react';
|
||||
import { useTranslation } from 'next-i18next';
|
||||
import { useMemo } from 'react';
|
||||
export enum TipTypeEnum {
|
||||
chat = 'chat',
|
||||
dataset = 'dataset'
|
||||
}
|
||||
const ChatTip = ({ type, ...props }: { type: `${TipTypeEnum}` } & BoxProps) => {
|
||||
const { t } = useTranslation();
|
||||
const { feConfigs } = useSystemStore();
|
||||
const textMap = useMemo(() => {
|
||||
return {
|
||||
[TipTypeEnum.chat]: t('common:compliance.chat'),
|
||||
[TipTypeEnum.dataset]: t('common:compliance.dataset')
|
||||
};
|
||||
}, [t]);
|
||||
return (
|
||||
feConfigs.show_compliance_documentation && (
|
||||
<Box
|
||||
w={'100%'}
|
||||
textAlign={'center'}
|
||||
fontSize={'0.6875rem'}
|
||||
fontWeight={'400'}
|
||||
pt={3}
|
||||
pb={[3, 0]}
|
||||
color={'myGray.400'}
|
||||
{...props}
|
||||
>
|
||||
{textMap[type]}
|
||||
</Box>
|
||||
)
|
||||
);
|
||||
};
|
||||
|
||||
export default ChatTip;
|
@@ -72,7 +72,7 @@ export const useChatTest = ({
|
||||
|
||||
const CustomChatContainer = useMemoizedFn(() =>
|
||||
appDetail.type === AppTypeEnum.plugin ? (
|
||||
<Box h={'100%'} p={3}>
|
||||
<Box p={3}>
|
||||
<PluginRunBox
|
||||
pluginInputs={pluginInputs}
|
||||
variablesForm={variablesForm}
|
||||
|
@@ -20,6 +20,7 @@ import AIModelSelector from '@/components/Select/AIModelSelector';
|
||||
import MyIcon from '@fastgpt/web/components/common/Icon';
|
||||
import { useSystem } from '@fastgpt/web/hooks/useSystem';
|
||||
import QuestionTip from '@fastgpt/web/components/common/MyTooltip/QuestionTip';
|
||||
import ComplianceTip, { TipTypeEnum } from '@/components/support/compliance/ComplianceTip';
|
||||
|
||||
export type CreateDatasetType =
|
||||
| DatasetTypeEnum.dataset
|
||||
@@ -224,15 +225,18 @@ const CreateModal = ({
|
||||
</Box>
|
||||
</Flex>
|
||||
)}
|
||||
<Flex w={'100%'} pt={6} justifyContent={'flex-end'}>
|
||||
<Button variant={'whiteBase'} mr={3} onClick={onClose}>
|
||||
{t('common:common.Close')}
|
||||
</Button>
|
||||
<Button isLoading={creating} onClick={handleSubmit((data) => onclickCreate(data))}>
|
||||
{t('common:common.Confirm Create')}
|
||||
</Button>
|
||||
</Flex>
|
||||
</ModalBody>
|
||||
|
||||
<ModalFooter px={9}>
|
||||
<Button variant={'whiteBase'} mr={3} onClick={onClose}>
|
||||
{t('common:common.Close')}
|
||||
</Button>
|
||||
<Button isLoading={creating} onClick={handleSubmit((data) => onclickCreate(data))}>
|
||||
{t('common:common.Confirm Create')}
|
||||
</Button>
|
||||
<ModalFooter px={9} pt={0}>
|
||||
<ComplianceTip pt={0} type={TipTypeEnum.dataset} />
|
||||
</ModalFooter>
|
||||
|
||||
<File onSelect={onSelectFile} />
|
||||
|
Reference in New Issue
Block a user