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
3c2bf206
authored
Aug 26, 2025
by
伍闲犬
Committed by
GitHub
Aug 26, 2025
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: add switch to control if enable `home` (#5531)
parent
3b25bf57
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
47 additions
and
16 deletions
+47
-16
packages/global/core/chat/setting/type.d.ts
+1
-0
packages/service/core/chat/setting/schema.ts
+4
-0
packages/web/i18n/en/chat.json
+1
-0
packages/web/i18n/zh-CN/chat.json
+1
-0
packages/web/i18n/zh-Hant/chat.json
+1
-0
projects/app/src/pageComponents/chat/ChatSetting/HomepageSetting/index.tsx
+20
-2
projects/app/src/pageComponents/chat/ChatWindow/HomeChatWindow.tsx
+1
-1
projects/app/src/pageComponents/chat/slider/index.tsx
+18
-13
No files found.
packages/global/core/chat/setting/type.d.ts
View file @
3c2bf206
...
...
@@ -4,6 +4,7 @@ export type ChatSettingSchema = {
teamId
:
string
;
slogan
:
string
;
dialogTips
:
string
;
enableHome
:
boolean
;
homeTabTitle
:
string
;
wideLogoUrl
?:
string
;
squareLogoUrl
?:
string
;
...
...
packages/service/core/chat/setting/schema.ts
View file @
3c2bf206
...
...
@@ -18,6 +18,10 @@ const ChatSettingSchema = new Schema({
ref
:
AppCollectionName
,
required
:
true
},
enableHome
:
{
type
:
Boolean
,
default
:
true
},
slogan
:
String
,
dialogTips
:
String
,
selectedTools
:
{
...
...
packages/web/i18n/en/chat.json
View file @
3c2bf206
...
...
@@ -135,6 +135,7 @@
"setting.home.dialogue_tips"
:
"Dialog prompt text"
,
"setting.home.dialogue_tips.default"
:
"You can ask me any questions"
,
"setting.home.dialogue_tips_placeholder"
:
"Please enter the prompt text of the dialog box"
,
"setting.home.enable"
:
"Enable home page"
,
"setting.home.home_tab_title"
:
"Home Page Title"
,
"setting.home.home_tab_title_placeholder"
:
"Please enter the title of the homepage"
,
"setting.home.no_selected_app"
:
"No selected App"
,
...
...
packages/web/i18n/zh-CN/chat.json
View file @
3c2bf206
...
...
@@ -147,6 +147,7 @@
"setting.home.cancel_button"
:
"取消"
,
"setting.home.confirm_button"
:
"确定"
,
"setting.home.no_selected_app"
:
"未选择应用"
,
"setting.home.enable"
:
"启用首页"
,
"setting.incorrect_plan"
:
"当前套餐不支持该功能,请升级订阅套餐"
,
"setting.incorrect_version"
:
"当前版本不支持该功能"
,
"setting.log_details.title"
:
"首页日志"
,
...
...
packages/web/i18n/zh-Hant/chat.json
View file @
3c2bf206
...
...
@@ -134,6 +134,7 @@
"setting.home.dialogue_tips"
:
"對話框提示文字"
,
"setting.home.dialogue_tips.default"
:
"你可以問我任何問題"
,
"setting.home.dialogue_tips_placeholder"
:
"請輸入對話框提示文字"
,
"setting.home.enable"
:
"啟用首頁"
,
"setting.home.home_tab_title"
:
"首頁標題"
,
"setting.home.home_tab_title_placeholder"
:
"請輸入首頁標題"
,
"setting.home.no_selected_app"
:
"未選擇應用"
,
...
...
projects/app/src/pageComponents/chat/ChatSetting/HomepageSetting/index.tsx
View file @
3c2bf206
import
{
Box
,
Button
,
Flex
,
Grid
,
IconButton
,
Input
,
useDisclosure
}
from
'@chakra-ui/react'
;
import
{
Switch
,
Box
,
Button
,
Flex
,
Grid
,
IconButton
,
Input
,
useDisclosure
}
from
'@chakra-ui/react'
;
import
{
useTranslation
}
from
'react-i18next'
;
import
MyInput
from
'@/components/MyInput'
;
import
{
useCallback
,
useState
}
from
'react'
;
...
...
@@ -8,7 +17,6 @@ import { updateChatSetting } from '@/web/core/chat/api';
import
{
useRequest2
}
from
'@fastgpt/web/hooks/useRequest'
;
import
ImageUpload
from
'@/pageComponents/chat/ChatSetting/ImageUpload'
;
import
type
{
ChatSettingSchema
,
ChatSettingUpdateParams
,
QuickAppType
,
SelectedToolType
...
...
@@ -28,6 +36,7 @@ import {
import
{
useSystem
}
from
'@fastgpt/web/hooks/useSystem'
;
import
dynamic
from
'next/dynamic'
;
import
type
{
ChatSettingReturnType
}
from
'@fastgpt/global/core/chat/setting/type'
;
import
MyPopover
from
'@fastgpt/web/components/common/MyPopover'
;
const
AddQuickAppModal
=
dynamic
(
()
=>
import
(
'@/pageComponents/chat/ChatSetting/HomepageSetting/AddQuickAppModal'
)
...
...
@@ -54,6 +63,7 @@ const HomepageSetting = ({ Header, onDiagramShow }: Props) => {
const
chatSettings2Form
=
useCallback
(
(
data
?:
ChatSettingReturnType
)
=>
{
return
{
enableHome
:
data
?.
enableHome
,
slogan
:
data
?.
slogan
||
t
(
'chat:setting.home.slogan.default'
),
dialogTips
:
data
?.
dialogTips
||
t
(
'chat:setting.home.dialogue_tips.default'
),
homeTabTitle
:
data
?.
homeTabTitle
||
'FastGPT'
,
...
...
@@ -168,6 +178,14 @@ const HomepageSetting = ({ Header, onDiagramShow }: Props) => {
>
<
Flex
w=
{
[
'100%'
,
'630px'
]
}
>
<
Flex
flexDir=
"column"
gap=
{
6
}
w=
"100%"
>
{
/* ENABLE HOME */
}
<
Box
fontWeight=
{
'500'
}
>
<
Flex
fontWeight=
{
'500'
}
fontSize=
"14px"
alignItems=
{
'center'
}
gap=
{
2
}
>
<
Box
>
{
t
(
'chat:setting.home.enable'
)
}
</
Box
>
<
Switch
size=
"sm"
{
...
register
('
enableHome
')}
/>
</
Flex
>
</
Box
>
{
/* QUICK APPS */
}
<
Box
fontWeight=
{
'500'
}
>
<
Flex
fontWeight=
{
'500'
}
fontSize=
"14px"
mb=
{
2
}
alignItems=
{
'center'
}
gap=
{
2
}
>
...
...
projects/app/src/pageComponents/chat/ChatWindow/HomeChatWindow.tsx
View file @
3c2bf206
...
...
@@ -190,7 +190,7 @@ const HomeChatWindow = ({ myApps }: Props) => {
};
useMount
(()
=>
{
if
(
!
feConfigs
?.
isPlus
)
{
if
(
!
feConfigs
?.
isPlus
||
!
chatSettings
?.
enableHome
)
{
handlePaneChange
(
ChatSidebarPaneEnum
.
TEAM_APPS
);
}
});
...
...
projects/app/src/pageComponents/chat/slider/index.tsx
View file @
3c2bf206
...
...
@@ -255,6 +255,7 @@ const NavigationSection = () => {
const
{
t
}
=
useTranslation
();
const
{
feConfigs
}
=
useSystemStore
();
const
isEnableHome
=
useContextSelector
(
ChatSettingContext
,
(
v
)
=>
v
.
chatSettings
?.
enableHome
);
const
isCollapsed
=
useContextSelector
(
ChatSettingContext
,
(
v
)
=>
v
.
collapse
===
1
);
const
onTriggerCollapse
=
useContextSelector
(
ChatSettingContext
,
(
v
)
=>
v
.
onTriggerCollapse
);
const
isHomeActive
=
useContextSelector
(
...
...
@@ -283,12 +284,14 @@ const NavigationSection = () => {
<
Flex
flexDir=
"column"
gap=
{
2
}
>
{
feConfigs
.
isPlus
&&
(
<>
<
ActionButton
icon=
"core/chat/sidebar/home"
isCollapsed=
{
true
}
isActive=
{
isHomeActive
}
onClick=
{
()
=>
handlePaneChange
(
ChatSidebarPaneEnum
.
HOME
)
}
/>
{
isEnableHome
&&
(
<
ActionButton
icon=
"core/chat/sidebar/home"
isCollapsed=
{
true
}
isActive=
{
isHomeActive
}
onClick=
{
()
=>
handlePaneChange
(
ChatSidebarPaneEnum
.
HOME
)
}
/>
)
}
<
ActionButton
icon=
"core/chat/sidebar/star"
...
...
@@ -312,13 +315,15 @@ const NavigationSection = () => {
<
Flex
flexDir=
"column"
gap=
{
2
}
>
{
feConfigs
.
isPlus
&&
(
<>
<
ActionButton
icon=
"core/chat/sidebar/home"
text=
{
t
(
'chat:sidebar.home'
)
}
isCollapsed=
{
false
}
isActive=
{
isHomeActive
}
onClick=
{
()
=>
handlePaneChange
(
ChatSidebarPaneEnum
.
HOME
)
}
/>
{
isEnableHome
&&
(
<
ActionButton
icon=
"core/chat/sidebar/home"
text=
{
t
(
'chat:sidebar.home'
)
}
isCollapsed=
{
false
}
isActive=
{
isHomeActive
}
onClick=
{
()
=>
handlePaneChange
(
ChatSidebarPaneEnum
.
HOME
)
}
/>
)
}
<
ActionButton
icon=
"core/chat/sidebar/star"
...
...
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