Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
赵月辉
/
fastgpt-migrated
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Unverified
Commit
c46a3754
authored
Jul 19, 2023
by
archer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
perf: config fe
parent
47af8d1c
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
52 additions
and
50 deletions
+52
-50
client/data/FeConfig.json
+7
-7
client/src/components/ChatBox/index.tsx
+1
-1
client/src/components/Layout/navbar.tsx
+2
-2
client/src/pages/_app.tsx
+2
-3
client/src/pages/api/user/sendAuthCode.ts
+1
-1
client/src/pages/index.tsx
+22
-22
client/src/pages/login/components/LoginForm.tsx
+11
-8
client/src/pages/number/index.tsx
+3
-3
client/src/pages/tools/index.tsx
+2
-2
client/src/types/index.d.ts
+1
-1
No files found.
client/data/FeConfig.json
View file @
c46a3754
{
"show_emptyChat"
:
fals
e
,
"show_register"
:
fals
e
,
"show_appStore"
:
fals
e
,
"show_
promotion"
:
fals
e
,
"show_
userDetail"
:
fals
e
,
"s
how_git"
:
false
,
"authorText"
:
"Made by Fast
Gpt
Team."
"show_emptyChat"
:
tru
e
,
"show_register"
:
tru
e
,
"show_appStore"
:
tru
e
,
"show_
userDetail"
:
tru
e
,
"show_
git"
:
tru
e
,
"s
ystemTitle"
:
"FastAI"
,
"authorText"
:
"Made by Fast
AI
Team."
}
client/src/components/ChatBox/index.tsx
View file @
c46a3754
...
...
@@ -394,7 +394,7 @@ const ChatBox = (
const
showEmpty
=
useMemo
(
()
=>
feConfigs
.
show_emptyChat
&&
feConfigs
?
.
show_emptyChat
&&
showEmptyIntro
&&
chatHistory
.
length
===
0
&&
!
variableModules
?.
length
&&
...
...
client/src/components/Layout/navbar.tsx
View file @
c46a3754
...
...
@@ -42,7 +42,7 @@ const Navbar = ({ unread }: { unread: number }) => {
link
:
`/kb/list`
,
activeLink
:
[
'/kb/list'
,
'/kb/detail'
]
},
...(
feConfigs
.
show_appStore
...(
feConfigs
?
.
show_appStore
?
[
{
label
:
'市场'
,
...
...
@@ -143,7 +143,7 @@ const Navbar = ({ unread }: { unread: number }) => {
</
Link
>
</
Box
>
)
}
{
feConfigs
.
show_git
&&
(
{
feConfigs
?
.
show_git
&&
(
<
Box
>
<
Link
as=
{
NextLink
}
...
...
client/src/pages/_app.tsx
View file @
c46a3754
...
...
@@ -10,10 +10,9 @@ import NProgress from 'nprogress'; //nprogress module
import
Router
from
'next/router'
;
import
'nprogress/nprogress.css'
;
import
'@/styles/reset.scss'
;
import
{
clientInitData
}
from
'@/store/static'
;
import
{
clientInitData
,
feConfigs
}
from
'@/store/static'
;
import
{
NextPageContext
}
from
'next'
;
import
{
useGlobalStore
}
from
'@/store/global'
;
import
{
GET
}
from
'@/service/api/axios'
;
//Binding events.
Router
.
events
.
on
(
'routeChangeStart'
,
()
=>
NProgress
.
start
());
...
...
@@ -51,7 +50,7 @@ function App({ Component, pageProps, isPc }: AppProps & { isPc?: boolean; respon
return
(
<>
<
Head
>
<
title
>
Fast GPT
</
title
>
<
title
>
{
feConfigs
?.
systemTitle
||
'FastAI'
}
</
title
>
<
meta
name=
"description"
content=
"Embedding + LLM, Build AI knowledge base"
/>
<
meta
name=
"viewport"
...
...
client/src/pages/api/user/sendAuthCode.ts
View file @
c46a3754
...
...
@@ -33,7 +33,7 @@ export default async function handler(req: NextApiRequest, res: NextApiResponse)
await
connectToDatabase
();
// register switch
if
(
type
===
UserAuthTypeEnum
.
register
&&
!
global
.
feConfigs
.
show_register
)
{
if
(
type
===
UserAuthTypeEnum
.
register
&&
!
global
.
feConfigs
?
.
show_register
)
{
throw
new
Error
(
'Register is closed'
);
}
...
...
client/src/pages/index.tsx
View file @
c46a3754
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'
;
import
{
useRouter
}
from
'next/router'
;
import
{
useGlobalStore
}
from
'@/store/global'
;
import
{
beianText
}
from
'@/store/static'
;
...
...
@@ -170,7 +168,7 @@ const Home = () => {
fontSize=
{
[
'40px'
,
'70px'
]
}
letterSpacing=
{
'5px'
}
>
FastAI
{
feConfigs
?.
systemTitle
||
'FastAI'
}
</
Box
>
<
Box
className=
{
styles
.
textlg
}
fontWeight=
{
'bold'
}
fontSize=
{
[
'30px'
,
'50px'
]
}
>
可视化 AI 编排
...
...
@@ -180,25 +178,27 @@ const Home = () => {
</
Box
>
<
Flex
flexDirection=
{
[
'column'
,
'row'
]
}
my=
{
5
}
>
<
Button
mr=
{
[
0
,
5
]
}
mb=
{
[
5
,
0
]
}
fontSize=
{
[
'xl'
,
'3xl'
]
}
h=
{
'auto'
}
py=
{
[
2
,
3
]
}
variant=
{
'base'
}
border=
{
'2px solid'
}
borderColor=
{
'myGray.800'
}
transition=
{
'0.3s'
}
_hover=
{
{
bg
:
'myGray.800'
,
color
:
'white'
}
}
leftIcon=
{
<
MyIcon
name=
{
'git'
}
w=
{
'20px'
}
/>
}
onClick=
{
()
=>
window
.
open
(
'https://github.com/labring/FastGPT'
,
'_blank'
)
}
>
Stars
{
(
star
/
1000
).
toFixed
(
1
)
}
k
</
Button
>
{
feConfigs
?.
show_git
&&
(
<
Button
mr=
{
[
0
,
5
]
}
mb=
{
[
5
,
0
]
}
fontSize=
{
[
'xl'
,
'3xl'
]
}
h=
{
'auto'
}
py=
{
[
2
,
3
]
}
variant=
{
'base'
}
border=
{
'2px solid'
}
borderColor=
{
'myGray.800'
}
transition=
{
'0.3s'
}
_hover=
{
{
bg
:
'myGray.800'
,
color
:
'white'
}
}
leftIcon=
{
<
MyIcon
name=
{
'git'
}
w=
{
'20px'
}
/>
}
onClick=
{
()
=>
window
.
open
(
'https://github.com/labring/FastGPT'
,
'_blank'
)
}
>
Stars
{
(
star
/
1000
).
toFixed
(
1
)
}
k
</
Button
>
)
}
<
Button
fontSize=
{
[
'xl'
,
'3xl'
]
}
h=
{
'auto'
}
...
...
client/src/pages/login/components/LoginForm.tsx
View file @
c46a3754
...
...
@@ -5,6 +5,7 @@ import { PageTypeEnum } from '@/constants/user';
import
{
postLogin
}
from
'@/api/user'
;
import
type
{
ResLogin
}
from
'@/api/response/user'
;
import
{
useToast
}
from
'@/hooks/useToast'
;
import
{
feConfigs
}
from
'@/store/static'
;
interface
Props
{
setPageType
:
Dispatch
<
`
${
PageTypeEnum
}
`
>
;
...
...
@@ -104,14 +105,16 @@ const LoginForm = ({ setPageType, loginSuccess }: Props) => {
>
忘记密码?
</
Box
>
<
Box
cursor=
{
'pointer'
}
_hover=
{
{
textDecoration
:
'underline'
}
}
onClick=
{
()
=>
setPageType
(
'register'
)
}
fontSize=
"sm"
>
注册账号
</
Box
>
{
feConfigs
?.
show_register
&&
(
<
Box
cursor=
{
'pointer'
}
_hover=
{
{
textDecoration
:
'underline'
}
}
onClick=
{
()
=>
setPageType
(
'register'
)
}
fontSize=
"sm"
>
注册账号
</
Box
>
)
}
</
Flex
>
<
Button
type=
"submit"
...
...
client/src/pages/number/index.tsx
View file @
c46a3754
...
...
@@ -174,7 +174,7 @@ const NumberSetting = ({ tableType }: { tableType: `${TableEnum}` }) => {
<
Box
flex=
{
'0 0 50px'
}
>
账号:
</
Box
>
<
Box
>
{
userInfo
?.
username
}
</
Box
>
</
Flex
>
{
feConfigs
.
show_userDetail
&&
(
{
feConfigs
?
.
show_userDetail
&&
(
<
Box
mt=
{
6
}
>
<
Flex
alignItems=
{
'center'
}
>
<
Box
flex=
{
'0 0 50px'
}
>
余额:
</
Box
>
...
...
@@ -188,7 +188,7 @@ const NumberSetting = ({ tableType }: { tableType: `${TableEnum}` }) => {
</
Box
>
)
}
</
Card
>
{
feConfigs
.
show_userDetail
&&
(
{
feConfigs
?
.
show_userDetail
&&
(
<
Card
px=
{
6
}
py=
{
4
}
>
<
Box
fontSize=
{
'xl'
}
fontWeight=
{
'bold'
}
>
我的邀请
...
...
@@ -234,7 +234,7 @@ const NumberSetting = ({ tableType }: { tableType: `${TableEnum}` }) => {
)
}
</
Grid
>
{
feConfigs
.
show_userDetail
&&
(
{
feConfigs
?
.
show_userDetail
&&
(
<
Card
mt=
{
4
}
px=
{
[
3
,
6
]
}
py=
{
4
}
>
<
Tabs
m=
{
'auto'
}
...
...
client/src/pages/tools/index.tsx
View file @
c46a3754
...
...
@@ -11,7 +11,7 @@ const list = [
label
:
'我的知识库'
,
link
:
'/kb/list'
},
...(
feConfigs
.
show_appStore
...(
feConfigs
?
.
show_appStore
?
[
{
icon
:
'appStoreLight'
,
...
...
@@ -20,7 +20,7 @@ const list = [
}
]
:
[]),
...(
feConfigs
.
show_git
...(
feConfigs
?
.
show_git
?
[
{
icon
:
'git'
,
...
...
client/src/types/index.d.ts
View file @
c46a3754
...
...
@@ -17,9 +17,9 @@ export type FeConfigsType = {
show_emptyChat
?:
boolean
;
show_register
?:
boolean
;
show_appStore
?:
boolean
;
show_promotion
?:
boolean
;
show_userDetail
?:
boolean
;
show_git
?:
false
;
systemTitle
?:
string
;
authorText
?:
string
;
};
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment