diff --git a/client/src/components/Tabs/index.tsx b/client/src/components/Tabs/index.tsx
new file mode 100644
index 0000000000..7ff5af04f3
--- /dev/null
+++ b/client/src/components/Tabs/index.tsx
@@ -0,0 +1,74 @@
+import React, { useMemo } from 'react';
+import { Box, Grid, useTheme } from '@chakra-ui/react';
+import type { GridProps } from '@chakra-ui/react';
+
+// @ts-ignore
+interface Props extends GridProps {
+ list: { id: string; label: string }[];
+ activeId: string;
+ size?: 'sm' | 'md' | 'lg';
+ onChange: (id: string) => void;
+}
+
+const Tabs = ({ list, size = 'md', activeId, onChange, ...props }: Props) => {
+ const theme = useTheme();
+ const sizeMap = useMemo(() => {
+ switch (size) {
+ case 'sm':
+ return {
+ fontSize: 'sm',
+ outP: '3px',
+ inlineP: 1
+ };
+ case 'md':
+ return {
+ fontSize: 'md',
+ outP: '4px',
+ inlineP: 2
+ };
+ case 'lg':
+ return {
+ fontSize: 'lg',
+ outP: '5px',
+ inlineP: 3
+ };
+ }
+ }, [size]);
+
+ return (
+
+ {list.map((item) => (
+ {
+ if (activeId === item.id) return;
+ onChange(item.id);
+ }}
+ >
+ {item.label}
+
+ ))}
+
+ );
+};
+
+export default Tabs;
diff --git a/client/src/components/WxConcat/index.tsx b/client/src/components/WxConcat/index.tsx
index ff9a4341a2..bcc4b631c1 100644
--- a/client/src/components/WxConcat/index.tsx
+++ b/client/src/components/WxConcat/index.tsx
@@ -30,7 +30,7 @@ const WxConcat = ({ onClose }: { onClose: () => void }) => {
-
diff --git a/client/src/constants/theme.ts b/client/src/constants/theme.ts
index bf9d192db3..57738c0304 100644
--- a/client/src/constants/theme.ts
+++ b/client/src/constants/theme.ts
@@ -66,10 +66,11 @@ const Button = defineStyleConfig({
},
variants: {
primary: {
- background: 'myBlue.700 !important',
+ backgroundImage:
+ 'linear-gradient(to bottom right, #2152d9 0%,#3370ff 40%, #4e83fd 100%) !important',
color: 'white',
_hover: {
- filter: 'brightness(110%)'
+ filter: 'brightness(115%)'
}
},
base: {
@@ -77,12 +78,15 @@ const Button = defineStyleConfig({
border: '1px solid',
borderColor: 'myGray.200',
bg: 'transparent',
+ transition: 'background 0.3s',
_hover: {
- color: 'myBlue.600'
+ color: 'myBlue.600',
+ bg: 'myWhite.400'
},
_active: {
color: 'myBlue.700'
- }
+ },
+ _disabled: { bg: 'myGray.100 !important', color: 'myGray.700 !important' }
}
},
defaultProps: {
@@ -180,6 +184,18 @@ export const theme = extendTheme({
}
},
colors: {
+ myWhite: {
+ 100: '#FEFEFE',
+ 200: '#FDFDFE',
+ 300: '#FBFBFC',
+ 400: '#F8FAFB',
+ 500: '#F6F8F9',
+ 600: '#F4F6F8',
+ 700: '#C3C5C6',
+ 800: '#929495',
+ 900: '#626263',
+ 1000: '#313132'
+ },
myGray: {
100: '#EFF0F1',
200: '#DEE0E2',
@@ -204,6 +220,7 @@ export const theme = extendTheme({
900: '#1237b3',
1000: '#07228c'
},
+
myRead: {
600: '#ff4d4f'
}
@@ -232,9 +249,11 @@ export const theme = extendTheme({
xl: '1800px',
'2xl': '2100px'
},
- active: {
+ lgColor: {
activeBlueGradient: 'linear-gradient(120deg, #d6e8ff 0%, #f0f7ff 100%)',
- hoverBlueGradient: 'linear-gradient(60deg, #f0f7ff 0%, #d6e8ff 100%)'
+ hoverBlueGradient: 'linear-gradient(60deg, #f0f7ff 0%, #d6e8ff 100%)',
+ primary: 'linear-gradient(to bottom right, #2152d9 0%,#3370ff 40%, #4e83fd 100%)',
+ primary2: 'linear-gradient(to bottom right, #2152d9 0%,#3370ff 30%,#4e83fd 80%, #85b1ff 100%)'
},
components: {
Modal: ModalTheme,
diff --git a/client/src/hooks/useConfirm.tsx b/client/src/hooks/useConfirm.tsx
index 02616c28bc..43aac7f5c6 100644
--- a/client/src/hooks/useConfirm.tsx
+++ b/client/src/hooks/useConfirm.tsx
@@ -39,7 +39,7 @@ export const useConfirm = ({ title = '提示', content }: { title?: string; cont
{
onClose();
typeof cancelCb.current === 'function' && cancelCb.current();
diff --git a/client/src/hooks/useEditInfo.tsx b/client/src/hooks/useEditInfo.tsx
index 6e05da0a62..62f847ef56 100644
--- a/client/src/hooks/useEditInfo.tsx
+++ b/client/src/hooks/useEditInfo.tsx
@@ -73,7 +73,7 @@ export const useEditInfo = ({
/>
-
+
取消
确认
diff --git a/client/src/pages/chat/components/History.tsx b/client/src/pages/chat/components/History.tsx
index 9a000be7af..2cbb44ca3a 100644
--- a/client/src/pages/chat/components/History.tsx
+++ b/client/src/pages/chat/components/History.tsx
@@ -158,11 +158,11 @@ const PcSliderBar = ({
cursor={'pointer'}
transition={'background-color .2s ease-in'}
_hover={{
- backgroundImage: ['', theme.active.hoverBlueGradient]
+ backgroundImage: ['', theme.lgColor.hoverBlueGradient]
}}
{...(item._id === chatId
? {
- backgroundImage: `${theme.active.activeBlueGradient}`
+ backgroundImage: `${theme.lgColor.activeBlueGradient}`
}
: {
bg: item.top ? 'myGray.200' : ''
diff --git a/client/src/pages/chat/components/PhoneSliderBar.tsx b/client/src/pages/chat/components/PhoneSliderBar.tsx
index 7b364df8da..04aa12c009 100644
--- a/client/src/pages/chat/components/PhoneSliderBar.tsx
+++ b/client/src/pages/chat/components/PhoneSliderBar.tsx
@@ -78,7 +78,7 @@ const PhoneSliderBar = ({
{/* 新对话 */}
}
diff --git a/client/src/pages/chat/index.tsx b/client/src/pages/chat/index.tsx
index 2d69acf9cb..55410e88c5 100644
--- a/client/src/pages/chat/index.tsx
+++ b/client/src/pages/chat/index.tsx
@@ -749,7 +749,7 @@ const Chat = ({ modelId, chatId }: { modelId: string; chatId: string }) => {
size={'xs'}
fontWeight={'normal'}
colorScheme={'gray'}
- variant={'outline'}
+ variant={'base'}
px={[2, 4]}
onClick={() => setShowSystemPrompt(item.systemPrompt || '')}
>
@@ -762,7 +762,7 @@ const Chat = ({ modelId, chatId }: { modelId: string; chatId: string }) => {
size={'xs'}
fontWeight={'normal'}
colorScheme={'gray'}
- variant={'outline'}
+ variant={'base'}
px={[2, 4]}
onClick={() => setShowHistoryQuote(item._id)}
>
diff --git a/client/src/pages/chat/share.tsx b/client/src/pages/chat/share.tsx
index 4412575a67..6159eecbe0 100644
--- a/client/src/pages/chat/share.tsx
+++ b/client/src/pages/chat/share.tsx
@@ -828,7 +828,7 @@ const Chat = ({ shareId, historyId }: { shareId: string; historyId: string }) =>
-
+
取消
确定
diff --git a/client/src/pages/index.module.scss b/client/src/pages/index.module.scss
index 63b8ab0200..ef4de9b3d7 100644
--- a/client/src/pages/index.module.scss
+++ b/client/src/pages/index.module.scss
@@ -2,4 +2,16 @@
* {
position: relative;
}
+
+ .textlg {
+ background: linear-gradient(
+ to bottom right,
+ #1237b3 0%,
+ #3370ff 40%,
+ #4e83fd 80%,
+ #85b1ff 100%
+ );
+ -webkit-background-clip: text;
+ -webkit-text-fill-color: transparent;
+ }
}
diff --git a/client/src/pages/index.tsx b/client/src/pages/index.tsx
index db83505cb7..04b8f6c7f3 100644
--- a/client/src/pages/index.tsx
+++ b/client/src/pages/index.tsx
@@ -1,4 +1,4 @@
-import React, { useEffect } from 'react';
+import React, { useEffect, useState } from 'react';
import { Card, Box, Link, Flex, Image, Button } from '@chakra-ui/react';
import Markdown from '@/components/Markdown';
import { useMarkdown } from '@/hooks/useMarkdown';
@@ -6,6 +6,8 @@ import { useRouter } from 'next/router';
import { useGlobalStore } from '@/store/global';
import styles from './index.module.scss';
+import axios from 'axios';
+import MyIcon from '@/components/Icon';
const Home = () => {
const router = useRouter();
@@ -15,6 +17,7 @@ const Home = () => {
isPc,
initData: { beianText }
} = useGlobalStore();
+ const [star, setStar] = useState(1500);
useEffect(() => {
if (inviterId) {
@@ -135,6 +138,13 @@ const Home = () => {
}, 500);
}, [isPc]);
+ useEffect(() => {
+ (async () => {
+ const { data: git } = await axios.get('https://api.github.com/repos/c121914yu/FastGPT');
+ setStar(git.stargazers_count);
+ })();
+ }, []);
+
return (
{
>
FastGpt
-
+
三分钟
-
+
搭建 AI 知识库
- router.push(`/model`)}
- >
- 点击开始
-
+
+ }
+ onClick={() => window.open('https://github.com/c121914yu/FastGPT', '_blank')}
+ >
+ Stars {(star / 1000).toFixed(1)}k
+
+ router.push(`/model`)}
+ >
+ 点击开始
+
+
diff --git a/client/src/pages/kb/components/DataCard.tsx b/client/src/pages/kb/components/DataCard.tsx
index 24b29ee165..19eab177e1 100644
--- a/client/src/pages/kb/components/DataCard.tsx
+++ b/client/src/pages/kb/components/DataCard.tsx
@@ -157,7 +157,7 @@ const DataCard = ({ kbId }: { kbId: string }) => {
}
aria-label={'refresh'}
- variant={'outline'}
+ variant={'base'}
mr={[2, 4]}
size={'sm'}
onClick={() => {
@@ -166,7 +166,7 @@ const DataCard = ({ kbId }: { kbId: string }) => {
}}
/>
{
}
- variant={'outline'}
+ variant={'base'}
aria-label={'delete'}
size={'sm'}
onClick={() =>
@@ -272,7 +272,7 @@ const DataCard = ({ kbId }: { kbId: string }) => {
/>
}
- variant={'outline'}
+ variant={'base'}
colorScheme={'gray'}
aria-label={'delete'}
size={'sm'}
diff --git a/client/src/pages/kb/components/Info.tsx b/client/src/pages/kb/components/Info.tsx
index a2acf527a0..4ae0d186f9 100644
--- a/client/src/pages/kb/components/Info.tsx
+++ b/client/src/pages/kb/components/Info.tsx
@@ -211,7 +211,7 @@ const Info = (
.split(' ')
.filter((item) => item)
.map((item, i) => (
-
+
{item}
))}
diff --git a/client/src/pages/kb/components/InputDataModal.tsx b/client/src/pages/kb/components/InputDataModal.tsx
index 96c0bc95e2..d74020b70c 100644
--- a/client/src/pages/kb/components/InputDataModal.tsx
+++ b/client/src/pages/kb/components/InputDataModal.tsx
@@ -171,7 +171,7 @@ const InputDataModal = ({
-
+
取消
{
h={'32px'}
icon={}
aria-label={''}
- variant={'outline'}
+ variant={'base'}
onClick={handleCreateModel}
/>
@@ -98,11 +98,11 @@ const KbList = ({ kbId }: { kbId: string }) => {
cursor={'pointer'}
transition={'background-color .2s ease-in'}
_hover={{
- backgroundImage: ['', theme.active.hoverBlueGradient]
+ backgroundImage: ['', theme.lgColor.hoverBlueGradient]
}}
{...(kbId === item._id
? {
- backgroundImage: `${theme.active.activeBlueGradient} !important`
+ backgroundImage: `${theme.lgColor.activeBlueGradient} !important`
}
: {})}
onClick={() => {
@@ -121,7 +121,7 @@ const KbList = ({ kbId }: { kbId: string }) => {
<>{item.tags || '你还没设置标签~'}>
) : (
item.tags.split(' ').map((item, i) => (
-
+
{item}
))
diff --git a/client/src/pages/kb/components/SelectCsvModal.tsx b/client/src/pages/kb/components/SelectCsvModal.tsx
index 25c05abb1c..a970c2b61e 100644
--- a/client/src/pages/kb/components/SelectCsvModal.tsx
+++ b/client/src/pages/kb/components/SelectCsvModal.tsx
@@ -159,7 +159,7 @@ const SelectJsonModal = ({
-
+
取消
diff --git a/client/src/pages/kb/components/SelectFileModal.tsx b/client/src/pages/kb/components/SelectFileModal.tsx
index bb2de82520..ae861c1474 100644
--- a/client/src/pages/kb/components/SelectFileModal.tsx
+++ b/client/src/pages/kb/components/SelectFileModal.tsx
@@ -292,7 +292,7 @@ const SelectFileModal = ({
选择文件
-
+
取消
{
- const tabs = useRef([
- { label: '我的', value: MyModelsTypeEnum.my },
- { label: '收藏', value: MyModelsTypeEnum.collection }
- ]);
const [currentTab, setCurrentTab] = useState(MyModelsTypeEnum.my);
const theme = useTheme();
@@ -86,7 +74,7 @@ const ModelList = ({ modelId }: { modelId: string }) => {
bg={'white'}
borderRight={['', theme.borders.base]}
>
-
+
{
h={'32px'}
icon={}
aria-label={''}
- variant={'outline'}
+ variant={'base'}
onClick={onclickCreateModel}
/>
-
+
item.value === currentTab)}
- onChange={(i) => setCurrentTab(tabs.current[i].value)}
- >
-
- {tabs.current.map((item) => (
-
- {item.label}
-
- ))}
-
-
+ w={'130px'}
+ list={[
+ { label: '我的', id: MyModelsTypeEnum.my },
+ { label: '收藏', id: MyModelsTypeEnum.collection }
+ ]}
+ activeId={currentTab}
+ size={'sm'}
+ onChange={(id: any) => setCurrentTab(id)}
+ />
{currentModels.list.map((item) => (
@@ -153,11 +130,11 @@ const ModelList = ({ modelId }: { modelId: string }) => {
cursor={'pointer'}
transition={'background-color .2s ease-in'}
_hover={{
- backgroundImage: ['', theme.active.hoverBlueGradient]
+ backgroundImage: ['', theme.lgColor.hoverBlueGradient]
}}
{...(modelId === item._id
? {
- backgroundImage: `${theme.active.activeBlueGradient} !important`
+ backgroundImage: `${theme.lgColor.activeBlueGradient} !important`
}
: {})}
onClick={() => {
diff --git a/client/src/pages/model/components/detail/components/ModelEditForm.tsx b/client/src/pages/model/components/detail/components/ModelEditForm.tsx
index 99ca7dd7c1..9260db5460 100644
--- a/client/src/pages/model/components/detail/components/ModelEditForm.tsx
+++ b/client/src/pages/model/components/detail/components/ModelEditForm.tsx
@@ -278,7 +278,7 @@ ${e.password ? `密码为: ${e.password}` : ''}`;
删除应用
@@ -388,20 +388,6 @@ ${e.password ? `密码为: ${e.password}` : ''}`;
setRefresh(!refresh);
}}
/>
-
-
- 分享模型细节:
-
-
-
-
- {
- setValue('share.isShareDetail', !getValues('share.isShareDetail'));
- setRefresh(!refresh);
- }}
- />
模型介绍
@@ -418,12 +404,7 @@ ${e.password ? `密码为: ${e.password}` : ''}`;
关联的知识库
-
+
选择
@@ -443,7 +424,7 @@ ${e.password ? `密码为: ${e.password}` : ''}`;
= 10
? {
@@ -585,7 +566,7 @@ ${e.password ? `密码为: ${e.password}` : ''}`;
-
+
取消
确认
diff --git a/client/src/pages/model/components/detail/index.tsx b/client/src/pages/model/components/detail/index.tsx
index c24e3f4981..d082fcb56b 100644
--- a/client/src/pages/model/components/detail/index.tsx
+++ b/client/src/pages/model/components/detail/index.tsx
@@ -141,7 +141,7 @@ const ModelDetail = ({ modelId, isPc }: { modelId: string; isPc: boolean }) => {
{modelDetail.name}
-
+
开始对话
{isOwner && (
@@ -173,7 +173,7 @@ const ModelDetail = ({ modelId, isPc }: { modelId: string; isPc: boolean }) => {
-
+
开始对话
{isOwner && (
diff --git a/client/src/pages/model/share/components/list.tsx b/client/src/pages/model/share/components/list.tsx
index a0bfa71cb5..2794119345 100644
--- a/client/src/pages/model/share/components/list.tsx
+++ b/client/src/pages/model/share/components/list.tsx
@@ -68,7 +68,7 @@ const ShareModelList = ({
router.push(`/chat?modelId=${model._id}`)}
>
diff --git a/client/src/pages/number/components/InformTable.tsx b/client/src/pages/number/components/InformTable.tsx
index 8194b1cf6a..bf3acc6d80 100644
--- a/client/src/pages/number/components/InformTable.tsx
+++ b/client/src/pages/number/components/InformTable.tsx
@@ -31,7 +31,7 @@ const BillTable = () => {
});
return (
- <>
+
{informs.map((item) => (
{
)}
- >
+
);
};
diff --git a/client/src/pages/number/components/PayModal.tsx b/client/src/pages/number/components/PayModal.tsx
index 988b0930b3..67cae9f4e1 100644
--- a/client/src/pages/number/components/PayModal.tsx
+++ b/client/src/pages/number/components/PayModal.tsx
@@ -130,7 +130,7 @@ const PayModal = ({ onClose }: { onClose: () => void }) => {
{!payId && (
<>
-
+
取消
import('./components/PayRecordTable'), {
loading: () => ,
@@ -65,11 +53,13 @@ enum TableEnum {
const NumberSetting = ({ tableType }: { tableType: `${TableEnum}` }) => {
const tableList = useRef([
- { label: '账单', value: TableEnum.bill, Component: BilTable },
- { label: '充值', value: TableEnum.pay, Component: PayRecordTable },
- { label: '佣金', value: TableEnum.promotion, Component: PromotionTable },
- { label: '通知', value: TableEnum.inform, Component: InformTable }
+ { label: '账单', id: TableEnum.bill, Component: },
+ { label: '充值', id: TableEnum.pay, Component: },
+ { label: '佣金', id: TableEnum.promotion, Component: },
+ { label: '通知', id: TableEnum.inform, Component: }
]);
+ const [currentTab, setCurrentTab] = useState(tableType);
+
const router = useRouter();
const { copyData } = useCopyData();
const { userInfo, updateUserInfo, initUserInfo, setUserInfo } = useUserStore();
@@ -98,8 +88,14 @@ const NumberSetting = ({ tableType }: { tableType: `${TableEnum}` }) => {
async (data: UserUpdateParams) => {
setLoading(true);
try {
- await putUserInfo(data);
- updateUserInfo(data);
+ await putUserInfo({
+ openaiKey: data.openaiKey,
+ avatar: data.avatar
+ });
+ updateUserInfo({
+ openaiKey: data.openaiKey,
+ avatar: data.avatar
+ });
reset(data);
toast({
title: '更新成功',
@@ -159,7 +155,7 @@ const NumberSetting = ({ tableType }: { tableType: `${TableEnum}` }) => {
账号信息
-
+
退出登录
@@ -224,7 +220,7 @@ const NumberSetting = ({ tableType }: { tableType: `${TableEnum}` }) => {
))}
copyData(`${location.origin}/?inviterId=${userInfo?._id}`, '已复制邀请链接')
@@ -238,7 +234,7 @@ const NumberSetting = ({ tableType }: { tableType: `${TableEnum}` }) => {
px={4}
title={residueAmount < 50 ? '最低提现额度为50元' : ''}
isDisabled={residueAmount < 50}
- variant={'outline'}
+ variant={'base'}
colorScheme={'myBlue'}
onClick={onOpenWxConcat}
>
@@ -249,34 +245,19 @@ const NumberSetting = ({ tableType }: { tableType: `${TableEnum}` }) => {
item.value === tableType)}
- onChange={(i) => router.replace(`/number?type=${tableList.current[i].value}`)}
- >
-
- {tableList.current.map((item) => (
-
- {item.label}
-
- ))}
-
-
- {tableList.current.map((Item) => (
-
-
-
- ))}
-
-
+ w={'200px'}
+ list={tableList.current}
+ activeId={currentTab}
+ size={'sm'}
+ onChange={(id: any) => setCurrentTab(id)}
+ />
+
+ {(() => {
+ const item = tableList.current.find((item) => item.id === currentTab);
+
+ return item ? item.Component : null;
+ })()}
+
{isOpenPayModal && }
diff --git a/client/src/pages/openapi/index.tsx b/client/src/pages/openapi/index.tsx
index d1ce020ed3..4ce7f7bd2b 100644
--- a/client/src/pages/openapi/index.tsx
+++ b/client/src/pages/openapi/index.tsx
@@ -97,7 +97,7 @@ const OpenApi = () => {
icon={}
size={'xs'}
aria-label={'delete'}
- variant={'outline'}
+ variant={'base'}
colorScheme={'gray'}
onClick={() => onclickRemove(id)}
/>