Skip to content

Commit

Permalink
4.6.1 production (#498)
Browse files Browse the repository at this point in the history
  • Loading branch information
c121914yu authored Nov 21, 2023
1 parent 0558379 commit 60f7526
Show file tree
Hide file tree
Showing 46 changed files with 93 additions and 63 deletions.
6 changes: 4 additions & 2 deletions packages/global/core/module/node/constant.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ export enum FlowNodeOutputTypeEnum {

export enum FlowNodeTypeEnum {
empty = 'empty',
variable = 'variable',
userGuide = 'userGuide',
questionInput = 'questionInput',
historyNode = 'historyNode',
Expand All @@ -40,7 +39,10 @@ export enum FlowNodeTypeEnum {
runApp = 'app',
pluginModule = 'pluginModule',
pluginInput = 'pluginInput',
pluginOutput = 'pluginOutput'
pluginOutput = 'pluginOutput',

// abandon
variable = 'variable'
}

export enum FlowNodeSpecialInputKeyEnum {
Expand Down
2 changes: 1 addition & 1 deletion projects/app/src/components/ChatBox/MessageInput.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -338,7 +338,7 @@ ${images.map((img) => JSON.stringify({ src: img.src })).join('\n')}
}}
onPaste={(e) => {
const clipboardData = e.clipboardData;
if (clipboardData) {
if (clipboardData && showFileSelector) {
const items = clipboardData.items;
const files = Array.from(items)
.map((item) => (item.kind === 'file' ? item.getAsFile() : undefined))
Expand Down
2 changes: 1 addition & 1 deletion projects/app/src/components/ChatBox/QuoteModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ const QuoteModal = ({
href={`/dataset/detail?datasetId=${item.datasetId}&currentTab=dataCard&collectionId=${item.collectionId}`}
>
{t('core.dataset.Go Dataset')}
<MyIcon name={'rightArrowLight'} w={'10px'} />
<MyIcon name={'common/rightArrowLight'} w={'10px'} />
</Link>
)}
</Flex>
Expand Down
12 changes: 6 additions & 6 deletions projects/app/src/components/ChatBox/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -774,7 +774,7 @@ const ChatBox = (
{showMarkIcon && item.adminFeedback && (
<Box>
<Flex alignItems={'center'} py={2}>
<MyIcon name={'markLight'} w={'14px'} color={'myGray.900'} />
<MyIcon name={'core/app/markLight'} w={'14px'} color={'myGray.900'} />
<Box ml={2} color={'myGray.500'}>
{t('chat.Admin Mark Content')}
</Box>
Expand Down Expand Up @@ -1093,7 +1093,7 @@ function ChatController({
<MyTooltip label={t('chat.retry')}>
<MyIcon
{...controlIconStyle}
name={'retryLight'}
name={'common/retryLight'}
_hover={{ color: 'green.500' }}
onClick={onRetry}
/>
Expand All @@ -1113,7 +1113,7 @@ function ChatController({
hasAudio &&
(audioLoading ? (
<MyTooltip label={'加载中...'}>
<MyIcon {...controlIconStyle} name={'loading'} />
<MyIcon {...controlIconStyle} name={'common/loading'} />
</MyTooltip>
) : audioPlaying ? (
<Flex alignItems={'center'} mr={2}>
Expand Down Expand Up @@ -1160,7 +1160,7 @@ function ChatController({
<MyTooltip label={t('chat.Mark')}>
<MyIcon
{...controlIconStyle}
name={'markLight'}
name={'core/app/markLight'}
_hover={{ color: '#67c13b' }}
onClick={onMark}
/>
Expand All @@ -1174,7 +1174,7 @@ function ChatController({
color={'white'}
bg={'#FC9663'}
fontWeight={'bold'}
name={'badLight'}
name={'core/chat/feedback/badLight'}
onClick={onReadFeedback}
/>
</MyTooltip>
Expand All @@ -1196,7 +1196,7 @@ function ChatController({
_hover: { color: '#FB7C3C' },
onClick: onFeedback
})}
name={'badLight'}
name={'core/chat/feedback/badLight'}
/>
</MyTooltip>
)}
Expand Down
8 changes: 8 additions & 0 deletions projects/app/src/components/Icon/icons/common/playFill.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
41 changes: 20 additions & 21 deletions projects/app/src/components/Icon/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -65,27 +65,26 @@ const iconPaths = {
customTitle: () => import('./icons/light/customTitle.svg'),
billRecordLight: () => import('./icons/light/billRecord.svg'),
informLight: () => import('./icons/light/inform.svg'),
payRecordLight: () => import('./icons/light/payRecord.svg'),
loginoutLight: () => import('./icons/light/loginout.svg'),
chatModelTag: () => import('./icons/light/chatModelTag.svg'),
language_en: () => import('./icons/language/en.svg'),
language_zh: () => import('./icons/language/zh.svg'),
outlink_share: () => import('./icons/outlink/share.svg'),
outlink_iframe: () => import('./icons/outlink/iframe.svg'),
addCircle: () => import('./icons/circle/add.svg'),
playFill: () => import('./icons/fill/play.svg'),
courseLight: () => import('./icons/light/course.svg'),
promotionLight: () => import('./icons/light/promotion.svg'),
logsLight: () => import('./icons/light/logs.svg'),
badLight: () => import('./icons/light/bad.svg'),
markLight: () => import('./icons/light/mark.svg'),
retryLight: () => import('./icons/light/retry.svg'),
rightArrowLight: () => import('./icons/light/rightArrow.svg'),
searchLight: () => import('./icons/light/search.svg'),
plusFill: () => import('./icons/fill/plus.svg'),
moveLight: () => import('./icons/light/move.svg'),
questionGuide: () => import('./icons/app/questionGuide.svg'),
loading: () => import('./icons/light/loading.svg'),
'support/pay/payRecordLight': () => import('./icons/support/pay/payRecordLight.svg'),
'support/account/loginoutLight': () => import('./icons/support/account/loginoutLight.svg'),
'core/chat/chatModelTag': () => import('./icons/core/chat/chatModelTag.svg'),
'common/language/en': () => import('./icons/common/language/en.svg'),
'common/language/zh': () => import('./icons/common/language/zh.svg'),
'support/outlink/shareLight': () => import('./icons/support/outlink/shareLight.svg'),
'support/outlink/iframeLight': () => import('./icons/support/outlink/iframeLight.svg'),
'common/addCircleLight': () => import('./icons/common/addCircleLight.svg'),
'common/playFill': () => import('./icons/common/playFill.svg'),
'common/courseLight': () => import('./icons/common/courseLight.svg'),
'support/account/promotionLight': () => import('./icons/support/account/promotionLight.svg'),
'core/app/logsLight': () => import('./icons/core/app/logsLight.svg'),
'core/chat/feedback/badLight': () => import('./icons/core/chat/feedback/badLight.svg'),
'core/app/markLight': () => import('./icons/core/app/markLight.svg'),
'common/retryLight': () => import('./icons/common/retryLight.svg'),
'common/rightArrowLight': () => import('./icons/common/rightArrowLight.svg'),
'common/searchLight': () => import('./icons/common/searchLight.svg'),
'common/file/move': () => import('./icons/common/file/move.svg'),
'core/app/questionGuide': () => import('./icons/core/app/questionGuide.svg'),
'common/loading': () => import('./icons/common/loading.svg'),
'core/app/aiLight': () => import('./icons/core/app/aiLight.svg'),
'core/app/aiFill': () => import('./icons/core/app/aiFill.svg'),
'common/text/t': () => import('./icons/common/text/t.svg'),
Expand Down
2 changes: 1 addition & 1 deletion projects/app/src/components/Layout/navbar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ const Navbar = ({ unread }: { unread: number }) => {
window.open(`${feConfigs.docUrl}/docs/intro`);
}}
>
<MyIcon name={'courseLight'} width={'26px'} height={'26px'} />
<MyIcon name={'common/courseLight'} width={'26px'} height={'26px'} />
</Box>
</MyTooltip>
)}
Expand Down
2 changes: 1 addition & 1 deletion projects/app/src/components/common/ParentPaths/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ const ParentPaths = (props: {
{item.parentName}
</Box>
{i !== concatPaths.length - 1 && (
<MyIcon name={'rightArrowLight'} color={'myGray.500'} w={'14px'} />
<MyIcon name={'common/rightArrowLight'} color={'myGray.500'} w={'14px'} />
)}
</Flex>
))}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ const ModuleTemplateList = ({
<Box fontSize={'sm'} transform={'translateY(-1px)'}>
{t('plugin.To Edit Plugin')}
</Box>
<MyIcon name={'rightArrowLight'} w={'12px'} />
<MyIcon name={'common/rightArrowLight'} w={'12px'} />
</Flex>
)}
</Flex>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,16 @@ import React, { useCallback, useMemo, useState } from 'react';
import { NodeProps } from 'reactflow';
import { Box, Button, Table, Thead, Tbody, Tr, Th, Td, TableContainer } from '@chakra-ui/react';
import { AddIcon } from '@chakra-ui/icons';
import NodeCard from '../modules/NodeCard';
import NodeCard from '../../modules/NodeCard';
import { FlowModuleItemType } from '@fastgpt/global/core/module/type.d';
import Container from '../modules/Container';
import Container from '../../modules/Container';
import { SystemInputEnum, VariableInputEnum } from '@/constants/app';
import type { VariableItemType } from '@/types/app';
import MyIcon from '@/components/Icon';
import { customAlphabet } from 'nanoid';
const nanoid = customAlphabet('abcdefghijklmnopqrstuvwxyz1234567890', 6);
import VariableEditModal, { addVariable } from '../../../VariableEditModal';
import { onChangeNode } from '../../FlowProvider';
import VariableEditModal, { addVariable } from '../../../../VariableEditModal';
import { onChangeNode } from '../../../FlowProvider';

export const defaultVariable: VariableItemType = {
id: nanoid(),
Expand Down
2 changes: 1 addition & 1 deletion projects/app/src/components/core/module/Flow/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import type { ModuleItemType } from '@fastgpt/global/core/module/type.d';
const NodeSimple = dynamic(() => import('./components/nodes/NodeSimple'));
const nodeTypes = {
[FlowNodeTypeEnum.userGuide]: dynamic(() => import('./components/nodes/NodeUserGuide')),
[FlowNodeTypeEnum.variable]: dynamic(() => import('./components/nodes/NodeVariable')),
[FlowNodeTypeEnum.variable]: dynamic(() => import('./components/nodes/abandon/NodeVariable')),
[FlowNodeTypeEnum.questionInput]: dynamic(() => import('./components/nodes/NodeQuestionInput')),
[FlowNodeTypeEnum.historyNode]: NodeSimple,
[FlowNodeTypeEnum.chatNode]: NodeSimple,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ const TeamManageModal = ({ onClose }: { onClose: () => void }) => {
border={'none'}
icon={
<MyIcon
name={'addCircle'}
name={'common/addCircleLight'}
w={['16px', '18px']}
color={'myBlue.600'}
cursor={'pointer'}
Expand Down Expand Up @@ -282,7 +282,13 @@ const TeamManageModal = ({ onClose }: { onClose: () => void }) => {
size="sm"
borderRadius={'md'}
ml={3}
leftIcon={<MyIcon name={'loginoutLight'} w={'14px'} color={'myBlue.600'} />}
leftIcon={
<MyIcon
name={'support/account/loginoutLight'}
w={'14px'}
color={'myBlue.600'}
/>
}
onClick={() => {
openLeaveConfirm(() => onLeaveTeam(userInfo?.team?.teamId))();
}}
Expand Down
2 changes: 1 addition & 1 deletion projects/app/src/pages/account/components/Info.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,7 @@ const UserInfo = () => {
window.open(`${feConfigs.docUrl}/docs/intro`);
}}
>
<MyIcon name={'courseLight'} w={'18px'} />
<MyIcon name={'common/courseLight'} w={'18px'} />
<Box ml={2} flex={1}>
{t('system.Help Document')}
</Box>
Expand Down
6 changes: 3 additions & 3 deletions projects/app/src/pages/account/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ const Account = ({ currentTab }: { currentTab: `${TabEnum}` }) => {
...(feConfigs?.show_promotion
? [
{
icon: 'promotionLight',
icon: 'support/account/promotionLight',
label: t('user.Promotion Record'),
id: TabEnum.promotion
}
Expand All @@ -62,7 +62,7 @@ const Account = ({ currentTab }: { currentTab: `${TabEnum}` }) => {
...(feConfigs?.show_pay && userInfo?.team.canWrite
? [
{
icon: 'payRecordLight',
icon: 'support/pay/payRecordLight',
label: t('user.Recharge Record'),
id: TabEnum.pay
}
Expand All @@ -88,7 +88,7 @@ const Account = ({ currentTab }: { currentTab: `${TabEnum}` }) => {
: []),

{
icon: 'loginoutLight',
icon: 'support/account/loginoutLight',
label: t('user.Sign Out'),
id: TabEnum.loginout
}
Expand Down
9 changes: 7 additions & 2 deletions projects/app/src/pages/app/detail/components/Logs.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,12 @@ const Logs = ({ appId }: { appId: string }) => {
borderRadius={'lg'}
fontWeight={'bold'}
>
<MyIcon mr={1} name={'badLight'} color={'#C96330'} w={'14px'} />
<MyIcon
mr={1}
name={'core/chat/feedback/badLight'}
color={'#C96330'}
w={'14px'}
/>
{item.feedbackCount}
</Flex>
</Box>
Expand Down Expand Up @@ -254,7 +259,7 @@ function DetailLogsModal({
</Tag>
{!!chat?.app?.chatModels && (
<Tag ml={2} colorSchema={'green'}>
<MyIcon name={'chatModelTag'} w={'14px'} />
<MyIcon name={'core/chat/chatModelTag'} w={'14px'} />
<Box ml={1}>{chat.app.chatModels.join(',')}</Box>
</Tag>
)}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ const OutLink = ({ appId }: { appId: string }) => {
iconSize={'20px'}
list={[
{
icon: 'outlink_share',
icon: 'support/outlink/shareLight',
title: '免登录窗口',
desc: '分享链接给其他用户,无需登录即可直接进行使用',
value: OutLinkTypeEnum.share
Expand All @@ -36,7 +36,7 @@ const OutLink = ({ appId }: { appId: string }) => {
value: OutLinkTypeEnum.apikey
}
// {
// icon: 'outlink_iframe',
// icon: 'support/outlink/iframeLight',
// title: '网页嵌入',
// desc: '嵌入到已有网页中,右下角会生成对话按键',
// value: OutLinkTypeEnum.iframe
Expand Down
2 changes: 1 addition & 1 deletion projects/app/src/pages/app/detail/components/QGSwitch.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ const QGSwitch = (props: SwitchProps) => {
const { t } = useTranslation();
return (
<Flex alignItems={'center'}>
<MyIcon name={'questionGuide'} mr={2} w={'16px'} />
<MyIcon name={'core/app/questionGuide'} mr={2} w={'16px'} />
<Box>{t('core.app.Next Step Guide')}</Box>
<MyTooltip label={t('core.app.Question Guide Tip')} forceShow>
<QuestionOutlineIcon display={['none', 'inline']} ml={1} />
Expand Down
2 changes: 1 addition & 1 deletion projects/app/src/pages/app/detail/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ const AppDetail = ({ currentTab }: { currentTab: `${TabEnum}` }) => {
? []
: [{ label: '高级编排', id: TabEnum.adEdit, icon: 'settingLight' }]),
{ label: '外部使用', id: TabEnum.outLink, icon: 'shareLight' },
{ label: '对话日志', id: TabEnum.logs, icon: 'logsLight' },
{ label: '对话日志', id: TabEnum.logs, icon: 'core/app/logsLight' },
{ label: '立即对话', id: TabEnum.startChat, icon: 'chat' }
],
[]
Expand Down
2 changes: 1 addition & 1 deletion projects/app/src/pages/chat/components/ChatHeader.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ const ChatHeader = ({
</Tag>
{!!chatModels && chatModels.length > 0 && (
<Tag ml={2} colorSchema={'green'}>
<MyIcon name={'chatModelTag'} w={'14px'} />
<MyIcon name={'core/chat/chatModelTag'} w={'14px'} />
<Box ml={1}>{chatModels.join(',')}</Box>
</Tag>
)}
Expand Down
2 changes: 1 addition & 1 deletion projects/app/src/pages/components/Hero.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ const Hero = () => {
loading={'lazy'}
/>
<MyIcon
name={'playFill'}
name={'common/playFill'}
position={'absolute'}
w={['30px', '40px']}
cursor={'pointer'}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,12 @@ const CollectionCard = () => {
<Flex alignItems={'center'} mr={2}>
<MyInput
leftIcon={
<MyIcon name="searchLight" position={'absolute'} w={'14px'} color={'myGray.500'} />
<MyIcon
name="common/searchLight"
position={'absolute'}
w={'14px'}
color={'myGray.500'}
/>
}
w={['100%', '250px']}
size={['sm', 'md']}
Expand Down Expand Up @@ -472,7 +477,7 @@ const CollectionCard = () => {
{
child: (
<Flex alignItems={'center'}>
<MyIcon name={'moveLight'} w={'14px'} mr={2} />
<MyIcon name={'common/file/move'} w={'14px'} mr={2} />
{t('Move')}
</Flex>
),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,12 @@ const DataCard = () => {
<Box flex={1} mr={1} />
<MyInput
leftIcon={
<MyIcon name="searchLight" position={'absolute'} w={'14px'} color={'myGray.500'} />
<MyIcon
name="common/searchLight"
position={'absolute'}
w={'14px'}
color={'myGray.500'}
/>
}
w={['200px', '300px']}
placeholder="根据匹配知识,预期答案和来源进行搜索"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ const InputDataModal = ({
...(defaultValue.id
? [{ label: t('dataset.data.edit.Delete'), id: TabEnum.delete, icon: 'delete' }]
: []),
{ label: t('dataset.data.edit.Course'), id: TabEnum.doc, icon: 'courseLight' }
{ label: t('dataset.data.edit.Course'), id: TabEnum.doc, icon: 'common/courseLight' }
];

const { ConfirmModal, openConfirm } = useConfirm({
Expand Down Expand Up @@ -352,7 +352,7 @@ const InputDataModal = ({
})
}
>
<MyIcon name={'addCircle'} w={'16px'} />
<MyIcon name={'common/addCircleLight'} w={'16px'} />
<Box>{t('dataset.data.Add Index')}</Box>
</Flex>
</Grid>
Expand Down
Loading

0 comments on commit 60f7526

Please sign in to comment.