This commit is contained in:
Archer
2023-09-26 14:31:37 +08:00
committed by GitHub
parent 38d4db5d5f
commit f6552d0d4f
48 changed files with 536 additions and 399 deletions

View File

@@ -3,16 +3,14 @@ import { FlowModuleTypeEnum } from '@/constants/flow';
import { getChatModel } from '@/service/utils/data';
import { AppModuleItemType, VariableItemType } from '@/types/app';
export const getSpecialModule = (modules: AppModuleItemType[]) => {
export const getGuideModules = (modules: AppModuleItemType[]) => {
const guideModules = modules.find((item) => item.flowType === FlowModuleTypeEnum.userGuide);
const welcomeText: string =
modules
.find((item) => item.flowType === FlowModuleTypeEnum.userGuide)
?.inputs?.find((item) => item.key === SystemInputEnum.welcomeText)?.value || '';
guideModules?.inputs?.find((item) => item.key === SystemInputEnum.welcomeText)?.value || '';
const variableModules: VariableItemType[] =
modules
.find((item) => item.flowType === FlowModuleTypeEnum.variable)
?.inputs.find((item) => item.key === SystemInputEnum.variables)?.value || [];
guideModules?.inputs.find((item) => item.key === SystemInputEnum.variables)?.value || [];
return {
welcomeText,

View File

@@ -1,12 +1,20 @@
import React from 'react';
import { Spinner, Flex, Box } from '@chakra-ui/react';
const Loading = ({ fixed = true, text = '' }: { fixed?: boolean; text?: string }) => {
const Loading = ({
fixed = true,
text = '',
bg = 'rgba(255,255,255,0.5)'
}: {
fixed?: boolean;
text?: string;
bg?: string;
}) => {
return (
<Flex
position={fixed ? 'fixed' : 'absolute'}
zIndex={1000}
backgroundColor={'rgba(255,255,255,0.5)'}
bg={bg}
top={0}
left={0}
right={0}

View File

@@ -106,7 +106,7 @@ const ApiKeyTable = ({ tips, appId }: { tips: string; appId?: string }) => {
onClick={() => copyData(baseUrl, '已复制 API 地址')}
>
<Box border={theme.borders.md} px={2} borderRadius={'md'} fontSize={'sm'}>
API地址
API地址
</Box>
<Box ml={2} color={'myGray.900'} fontSize={['sm', 'md']}>
{baseUrl}
@@ -292,7 +292,7 @@ function EditKeyModal({
});
return (
<MyModal isOpen={true} title={isEdit ? t('outlink.Edit Link') : t('outlink.Create Link')}>
<MyModal isOpen={true} title={isEdit ? t('outlink.Edit API Key') : t('outlink.Create API Key')}>
<ModalBody>
<Flex alignItems={'center'}>
<Box flex={'0 0 90px'}>{t('Name')}:</Box>