@lobehub/chat 0.152.1 → 0.152.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +25 -0
- package/README.md +8 -8
- package/README.zh-CN.md +8 -8
- package/locales/ar/common.json +14 -0
- package/locales/ar/setting.json +4 -1
- package/locales/bg-BG/common.json +14 -0
- package/locales/bg-BG/setting.json +4 -1
- package/locales/de-DE/common.json +14 -0
- package/locales/de-DE/setting.json +4 -1
- package/locales/en-US/common.json +14 -0
- package/locales/en-US/setting.json +4 -1
- package/locales/es-ES/common.json +14 -0
- package/locales/es-ES/setting.json +4 -1
- package/locales/fr-FR/common.json +14 -0
- package/locales/fr-FR/setting.json +4 -1
- package/locales/it-IT/common.json +14 -0
- package/locales/it-IT/setting.json +4 -1
- package/locales/ja-JP/common.json +14 -0
- package/locales/ja-JP/setting.json +4 -1
- package/locales/ko-KR/common.json +14 -0
- package/locales/ko-KR/setting.json +4 -1
- package/locales/nl-NL/common.json +14 -0
- package/locales/nl-NL/setting.json +4 -1
- package/locales/pl-PL/common.json +14 -0
- package/locales/pl-PL/setting.json +4 -1
- package/locales/pt-BR/common.json +14 -0
- package/locales/pt-BR/setting.json +4 -1
- package/locales/ru-RU/common.json +14 -0
- package/locales/ru-RU/setting.json +4 -1
- package/locales/tr-TR/common.json +14 -0
- package/locales/tr-TR/setting.json +4 -1
- package/locales/vi-VN/common.json +14 -0
- package/locales/vi-VN/setting.json +4 -1
- package/locales/zh-CN/common.json +14 -0
- package/locales/zh-CN/setting.json +4 -1
- package/locales/zh-TW/common.json +14 -0
- package/locales/zh-TW/setting.json +4 -1
- package/package.json +1 -1
- package/src/app/(main)/(mobile)/me/features/AvatarBanner.tsx +52 -0
- package/src/app/(main)/(mobile)/me/features/Cate.tsx +34 -0
- package/src/app/(main)/(mobile)/me/features/ExtraCate.tsx +26 -0
- package/src/app/(main)/(mobile)/me/features/useExtraCate.tsx +68 -0
- package/src/app/(main)/(mobile)/me/layout.tsx +11 -0
- package/src/app/(main)/(mobile)/me/loading.tsx +17 -0
- package/src/app/(main)/(mobile)/me/page.tsx +31 -0
- package/src/app/(main)/@nav/_layout/Desktop/BottomActions.tsx +7 -120
- package/src/app/(main)/@nav/_layout/Desktop/index.tsx +7 -2
- package/src/app/(main)/@nav/_layout/Mobile.tsx +3 -3
- package/src/app/(main)/@nav/features/UserAvatar.tsx +24 -0
- package/src/app/(main)/@nav/features/UserPanel/LangButton.tsx +55 -0
- package/src/app/(main)/@nav/features/UserPanel/Popover.tsx +34 -0
- package/src/app/(main)/@nav/features/UserPanel/ThemeButton.tsx +70 -0
- package/src/app/(main)/@nav/features/UserPanel/UserInfo.tsx +35 -0
- package/src/app/(main)/@nav/features/UserPanel/index.tsx +69 -0
- package/src/app/(main)/@nav/features/UserPanel/useMenu.tsx +144 -0
- package/src/app/(main)/@nav/features/UserPanel/useNewVersion.tsx +12 -0
- package/src/app/(main)/chat/(mobile)/features/SessionHeader.tsx +1 -1
- package/src/app/(main)/chat/_layout/Desktop/index.tsx +6 -8
- package/src/app/(main)/chat/_layout/Mobile/index.tsx +5 -3
- package/src/app/(main)/chat/_layout/type.ts +5 -0
- package/src/app/(main)/chat/features/SettingButton.tsx +5 -2
- package/src/app/(main)/chat/layout.ts +5 -2
- package/src/app/(main)/chat/settings/{(desktop) → _layout/Desktop}/Header.tsx +2 -0
- package/src/app/(main)/chat/settings/_layout/Desktop/index.tsx +32 -0
- package/src/app/(main)/chat/settings/{(mobile) → _layout/Mobile}/Header.tsx +3 -2
- package/src/app/(main)/chat/settings/_layout/Mobile/index.tsx +15 -0
- package/src/app/(main)/chat/settings/error.tsx +5 -0
- package/src/app/(main)/chat/settings/features/HeaderContent.tsx +15 -9
- package/src/app/(main)/chat/settings/features/SubmitAgentButton/SubmitAgentModal.tsx +2 -0
- package/src/app/(main)/chat/settings/features/SubmitAgentButton/index.tsx +16 -8
- package/src/app/(main)/chat/settings/layout.tsx +9 -2
- package/src/app/(main)/chat/settings/loading.tsx +3 -0
- package/src/app/(main)/chat/settings/not-found.tsx +3 -0
- package/src/app/(main)/chat/settings/page.tsx +2 -9
- package/src/app/(main)/market/@detail/default.tsx +1 -10
- package/src/app/(main)/market/@detail/loading.tsx +1 -0
- package/src/app/(main)/market/{@detail/_layout/Desktop.tsx → _layout/Desktop/DetailSidebar.tsx} +2 -2
- package/src/app/(main)/market/_layout/Desktop/index.tsx +2 -1
- package/src/app/(main)/market/{@detail/_layout/Mobile.tsx → _layout/Mobile/DetailModal.tsx} +2 -2
- package/src/app/(main)/market/_layout/Mobile/index.tsx +3 -1
- package/src/app/(main)/settings/@category/default.tsx +16 -0
- package/src/app/(main)/settings/@category/features/CategoryContent.tsx +35 -0
- package/src/app/(main)/settings/@category/features/UpgradeAlert.tsx +38 -0
- package/src/app/(main)/settings/_layout/Desktop/Header.tsx +78 -23
- package/src/app/(main)/settings/_layout/Desktop/SideBar.tsx +39 -27
- package/src/app/(main)/settings/_layout/Desktop/index.tsx +41 -17
- package/src/app/(main)/settings/_layout/Mobile/{SubSettingHeader.tsx → Header.tsx} +3 -1
- package/src/app/(main)/settings/_layout/Mobile/index.tsx +7 -18
- package/src/app/(main)/settings/_layout/type.ts +6 -0
- package/src/app/(main)/settings/about/features/AboutList.tsx +122 -0
- package/src/app/(main)/settings/about/features/Analytics.tsx +42 -0
- package/src/app/(main)/settings/about/layout.tsx +26 -0
- package/src/app/(main)/settings/about/loading.tsx +5 -0
- package/src/app/(main)/settings/about/page.tsx +20 -25
- package/src/app/(main)/settings/agent/layout.tsx +35 -0
- package/src/app/(main)/settings/agent/loading.tsx +4 -2
- package/src/app/(main)/settings/agent/page.tsx +25 -12
- package/src/app/(main)/settings/common/{Common.tsx → features/Common.tsx} +7 -5
- package/src/app/(main)/settings/common/{Theme.tsx → features/Theme/index.tsx} +8 -6
- package/src/app/(main)/settings/common/page.tsx +21 -4
- package/src/app/(main)/settings/error.tsx +5 -0
- package/src/app/(main)/settings/features/Footer.tsx +2 -0
- package/src/app/(main)/settings/features/UpgradeAlert.tsx +21 -13
- package/src/app/(main)/settings/hooks/useCategory.tsx +54 -0
- package/src/app/(main)/settings/hooks/useSyncSettings.ts +2 -2
- package/src/app/(main)/settings/layout.ts +4 -1
- package/src/app/(main)/settings/llm/Anthropic/index.tsx +4 -10
- package/src/app/(main)/settings/llm/Azure/index.tsx +3 -1
- package/src/app/(main)/settings/llm/Bedrock/index.tsx +3 -1
- package/src/app/(main)/settings/llm/Google/index.tsx +4 -2
- package/src/app/(main)/settings/llm/Groq/index.tsx +3 -1
- package/src/app/(main)/settings/llm/Minimax/index.tsx +3 -9
- package/src/app/(main)/settings/llm/Mistral/index.tsx +3 -9
- package/src/app/(main)/settings/llm/Moonshot/index.tsx +3 -1
- package/src/app/(main)/settings/llm/Ollama/index.tsx +3 -1
- package/src/app/(main)/settings/llm/OpenAI/index.tsx +2 -0
- package/src/app/(main)/settings/llm/OpenRouter/index.tsx +3 -9
- package/src/app/(main)/settings/llm/Perplexity/index.tsx +3 -9
- package/src/app/(main)/settings/llm/TogetherAI/index.tsx +3 -9
- package/src/app/(main)/settings/llm/ZeroOne/index.tsx +3 -9
- package/src/app/(main)/settings/llm/Zhipu/index.tsx +3 -10
- package/src/app/(main)/settings/llm/components/Checker.tsx +2 -0
- package/src/app/(main)/settings/llm/components/Footer.tsx +26 -0
- package/src/app/(main)/settings/llm/components/ProviderConfig/index.tsx +16 -1
- package/src/app/(main)/settings/llm/page.tsx +57 -3
- package/src/app/(main)/settings/loading.tsx +9 -0
- package/src/app/(main)/settings/not-found.tsx +3 -0
- package/src/app/(main)/settings/page.tsx +2 -14
- package/src/app/(main)/settings/sync/{DeviceInfo → features/DeviceInfo}/Card.tsx +6 -5
- package/src/app/(main)/settings/sync/features/DeviceInfo/DeviceName.tsx +63 -0
- package/src/app/(main)/settings/sync/{components → features/DeviceInfo}/SystemIcon.tsx +6 -14
- package/src/app/(main)/settings/sync/{DeviceInfo → features/DeviceInfo}/index.tsx +22 -36
- package/src/app/(main)/settings/sync/{WebRTC → features/WebRTC}/ChannelNameInput.tsx +3 -3
- package/src/app/(main)/settings/sync/{WebRTC → features/WebRTC}/index.tsx +10 -9
- package/src/app/(main)/settings/sync/page.tsx +19 -11
- package/src/app/(main)/settings/tts/features/OpenAI.tsx +54 -0
- package/src/app/(main)/settings/tts/{TTS/index.tsx → features/STT.tsx} +11 -27
- package/src/app/(main)/settings/tts/page.tsx +17 -11
- package/src/app/@modal/(.)settings/about/layout.tsx +1 -0
- package/src/app/@modal/(.)settings/about/page.tsx +1 -0
- package/src/app/@modal/(.)settings/agent/layout.tsx +1 -0
- package/src/app/@modal/(.)settings/agent/page.tsx +1 -0
- package/src/app/@modal/(.)settings/common/page.tsx +1 -0
- package/src/app/@modal/(.)settings/layout.tsx +28 -0
- package/src/app/@modal/(.)settings/llm/page.tsx +1 -0
- package/src/app/@modal/(.)settings/loading.tsx +5 -0
- package/src/app/@modal/(.)settings/sync/page.tsx +1 -0
- package/src/app/@modal/(.)settings/tts/page.tsx +1 -0
- package/src/app/@modal/_layout/SettingModalLayout.tsx +59 -0
- package/src/app/@modal/chat/(.)settings/features/CategoryContent.tsx +36 -0
- package/src/app/@modal/chat/(.)settings/features/useCategory.tsx +62 -0
- package/src/app/@modal/chat/(.)settings/layout.tsx +55 -0
- package/src/app/@modal/chat/(.)settings/loading.tsx +5 -0
- package/src/app/@modal/chat/(.)settings/page.tsx +40 -0
- package/src/app/@modal/default.tsx +1 -0
- package/src/app/@modal/layout.tsx +30 -0
- package/src/app/@modal/loading.tsx +5 -0
- package/src/app/layout.tsx +11 -3
- package/src/components/BrandWatermark/index.tsx +39 -0
- package/src/components/Cell/Divider.tsx +19 -0
- package/src/components/Cell/index.tsx +38 -0
- package/src/components/Menu/index.tsx +97 -0
- package/src/components/SkeletonLoading/index.tsx +21 -0
- package/src/const/url.ts +1 -0
- package/src/features/AgentSetting/AgentChat/index.tsx +135 -0
- package/src/features/AgentSetting/AgentMeta/index.tsx +4 -3
- package/src/features/AgentSetting/AgentModal/index.tsx +95 -0
- package/src/features/AgentSetting/AgentPlugin/index.tsx +65 -66
- package/src/features/AgentSetting/AgentPrompt/index.tsx +101 -47
- package/src/features/AgentSetting/AgentTTS/index.tsx +4 -0
- package/src/features/AgentSetting/StoreUpdater.tsx +2 -0
- package/src/features/AgentSetting/index.tsx +6 -6
- package/src/features/AgentSetting/store/index.ts +2 -0
- package/src/features/AvatarWithUpload/index.tsx +2 -0
- package/src/hooks/useQuery.ts +7 -0
- package/src/hooks/useQueryRoute.ts +16 -0
- package/src/locales/default/common.ts +14 -0
- package/src/locales/default/setting.ts +3 -0
- package/src/server/redirectHard.ts +9 -0
- package/src/store/global/initialState.ts +1 -0
- package/src/app/(main)/@nav/_layout/Desktop/Avatar.tsx +0 -11
- package/src/app/(main)/chat/settings/(desktop)/index.tsx +0 -23
- package/src/app/(main)/chat/settings/(mobile)/index.tsx +0 -16
- package/src/app/(main)/settings/(desktop)/index.tsx +0 -23
- package/src/app/(main)/settings/(mobile)/features/AvatarBanner.tsx +0 -68
- package/src/app/(main)/settings/(mobile)/features/ExtraList.tsx +0 -65
- package/src/app/(main)/settings/(mobile)/index.tsx +0 -53
- package/src/app/(main)/settings/about/AboutList.tsx +0 -53
- package/src/app/(main)/settings/about/Analytics.tsx +0 -40
- package/src/app/(main)/settings/about/style.ts +0 -22
- package/src/app/(main)/settings/agent/Agent.tsx +0 -29
- package/src/app/(main)/settings/common/index.tsx +0 -24
- package/src/app/(main)/settings/common/loading.tsx +0 -3
- package/src/app/(main)/settings/features/SettingList/index.tsx +0 -47
- package/src/app/(main)/settings/llm/index.tsx +0 -59
- package/src/app/(main)/settings/llm/layout.tsx +0 -11
- package/src/app/(main)/settings/llm/loading.tsx +0 -3
- package/src/app/(main)/settings/sync/DeviceInfo/DeviceName.tsx +0 -66
- package/src/app/(main)/settings/sync/PageTitle.tsx +0 -11
- package/src/app/(main)/settings/sync/layout.tsx +0 -12
- package/src/app/(main)/settings/sync/loading.tsx +0 -3
- package/src/app/(main)/settings/tts/loading.tsx +0 -3
- package/src/features/AgentSetting/AgentConfig/index.tsx +0 -202
- package/src/features/AgentSetting/AgentConfig/useSyncConfig.ts +0 -23
- /package/src/app/(main)/settings/{features/SettingList → about/features}/Item.tsx +0 -0
- /package/src/app/(main)/settings/{features → common/features/Theme}/ThemeSwatches/ThemeSwatchesNeutral.tsx +0 -0
- /package/src/app/(main)/settings/{features → common/features/Theme}/ThemeSwatches/ThemeSwatchesPrimary.tsx +0 -0
- /package/src/app/(main)/settings/{features → common/features/Theme}/ThemeSwatches/index.ts +0 -0
- /package/src/app/(main)/settings/sync/{Alert.tsx → features/Alert.tsx} +0 -0
- /package/src/app/(main)/settings/sync/{components → features/WebRTC}/SyncSwitch/index.css +0 -0
- /package/src/app/(main)/settings/sync/{components → features/WebRTC}/SyncSwitch/index.tsx +0 -0
- /package/src/app/(main)/settings/sync/{util.ts → features/WebRTC/generateRandomRoomName.ts} +0 -0
- /package/src/app/(main)/settings/tts/{TTS/options.ts → features/const.ts} +0 -0
- /package/src/features/AgentSetting/{AgentConfig → AgentModal}/ModelSelect.tsx +0 -0
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
3
|
+
import { Grid, Icon } from '@lobehub/ui';
|
|
4
|
+
import { createStyles } from 'antd-style';
|
|
5
|
+
import {
|
|
6
|
+
Book,
|
|
7
|
+
Feather,
|
|
8
|
+
FileClock,
|
|
9
|
+
Github,
|
|
10
|
+
Heart,
|
|
11
|
+
HeartHandshake,
|
|
12
|
+
Home,
|
|
13
|
+
Lock,
|
|
14
|
+
Rss,
|
|
15
|
+
} from 'lucide-react';
|
|
16
|
+
import { memo } from 'react';
|
|
17
|
+
import { useTranslation } from 'react-i18next';
|
|
18
|
+
import { Flexbox } from 'react-layout-kit';
|
|
19
|
+
|
|
20
|
+
import { ABOUT, CHANGELOG, FEEDBACK, GITHUB, PRIVACY_URL, TERMS_URL } from '@/const/url';
|
|
21
|
+
|
|
22
|
+
const useStyles = createStyles(({ css, token, responsive }) => ({
|
|
23
|
+
card: css`
|
|
24
|
+
cursor: pointer;
|
|
25
|
+
|
|
26
|
+
padding: 24px;
|
|
27
|
+
|
|
28
|
+
background: ${token.colorFillTertiary};
|
|
29
|
+
border: 1px solid ${token.colorFillSecondary};
|
|
30
|
+
border-radius: ${token.borderRadiusLG}px;
|
|
31
|
+
|
|
32
|
+
&:hover {
|
|
33
|
+
background: ${token.colorFillSecondary};
|
|
34
|
+
border: 1px solid ${token.colorFill};
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
${responsive.mobile} {
|
|
38
|
+
padding: 16px;
|
|
39
|
+
}
|
|
40
|
+
`,
|
|
41
|
+
container: css`
|
|
42
|
+
${responsive.mobile} {
|
|
43
|
+
padding-inline: 16px;
|
|
44
|
+
}
|
|
45
|
+
`,
|
|
46
|
+
}));
|
|
47
|
+
|
|
48
|
+
const AboutList = memo(() => {
|
|
49
|
+
const { styles } = useStyles();
|
|
50
|
+
const { t } = useTranslation('common');
|
|
51
|
+
|
|
52
|
+
const items = [
|
|
53
|
+
{
|
|
54
|
+
icon: Home,
|
|
55
|
+
label: t('officialSite'),
|
|
56
|
+
onClick: () => window.open('https://lobehub.com', '__blank'),
|
|
57
|
+
value: 'officialSite',
|
|
58
|
+
},
|
|
59
|
+
|
|
60
|
+
{
|
|
61
|
+
icon: Book,
|
|
62
|
+
label: t('document'),
|
|
63
|
+
onClick: () => window.open(FEEDBACK, '__blank'),
|
|
64
|
+
value: 'feedback',
|
|
65
|
+
},
|
|
66
|
+
{
|
|
67
|
+
icon: Rss,
|
|
68
|
+
label: t('blog'),
|
|
69
|
+
onClick: () => window.open('https://lobehub.com/blog', '__blank'),
|
|
70
|
+
value: 'blog',
|
|
71
|
+
},
|
|
72
|
+
{
|
|
73
|
+
icon: Github,
|
|
74
|
+
label: 'GitHub',
|
|
75
|
+
onClick: () => window.open(GITHUB, '__blank'),
|
|
76
|
+
value: 'feedback',
|
|
77
|
+
},
|
|
78
|
+
{
|
|
79
|
+
icon: Feather,
|
|
80
|
+
label: t('feedback'),
|
|
81
|
+
onClick: () => window.open(FEEDBACK, '__blank'),
|
|
82
|
+
value: 'feedback',
|
|
83
|
+
},
|
|
84
|
+
{
|
|
85
|
+
icon: FileClock,
|
|
86
|
+
label: t('changelog'),
|
|
87
|
+
onClick: () => window.open(CHANGELOG, '__blank'),
|
|
88
|
+
value: 'changelog',
|
|
89
|
+
},
|
|
90
|
+
{
|
|
91
|
+
icon: HeartHandshake,
|
|
92
|
+
label: t('terms'),
|
|
93
|
+
onClick: () => window.open(TERMS_URL, '__blank'),
|
|
94
|
+
value: 'terms',
|
|
95
|
+
},
|
|
96
|
+
{
|
|
97
|
+
icon: Lock,
|
|
98
|
+
label: t('privacy'),
|
|
99
|
+
onClick: () => window.open(PRIVACY_URL, '__blank'),
|
|
100
|
+
value: 'privacy',
|
|
101
|
+
},
|
|
102
|
+
{
|
|
103
|
+
icon: Heart,
|
|
104
|
+
label: t('about'),
|
|
105
|
+
onClick: () => window.open(ABOUT, '__blank'),
|
|
106
|
+
value: 'about',
|
|
107
|
+
},
|
|
108
|
+
];
|
|
109
|
+
|
|
110
|
+
return (
|
|
111
|
+
<Grid className={styles.container} maxItemWidth={144} width={'100%'}>
|
|
112
|
+
{items.map(({ value, icon, label, onClick }) => (
|
|
113
|
+
<Flexbox className={styles.card} gap={8} horizontal key={value} onClick={onClick}>
|
|
114
|
+
<Icon icon={icon} size={{ fontSize: 20 }} />
|
|
115
|
+
{label}
|
|
116
|
+
</Flexbox>
|
|
117
|
+
))}
|
|
118
|
+
</Grid>
|
|
119
|
+
);
|
|
120
|
+
});
|
|
121
|
+
|
|
122
|
+
export default AboutList;
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
3
|
+
import { Form, type ItemGroup } from '@lobehub/ui';
|
|
4
|
+
import { Switch } from 'antd';
|
|
5
|
+
import { memo } from 'react';
|
|
6
|
+
import { useTranslation } from 'react-i18next';
|
|
7
|
+
|
|
8
|
+
import { FORM_STYLE } from '@/const/layoutTokens';
|
|
9
|
+
import { useUserStore } from '@/store/user';
|
|
10
|
+
import { preferenceSelectors } from '@/store/user/slices/preference/selectors';
|
|
11
|
+
|
|
12
|
+
type SettingItemGroup = ItemGroup;
|
|
13
|
+
|
|
14
|
+
const Analytics = memo(() => {
|
|
15
|
+
const { t } = useTranslation('setting');
|
|
16
|
+
const checked = useUserStore(preferenceSelectors.userAllowTrace);
|
|
17
|
+
const [updatePreference] = useUserStore((s) => [s.updatePreference]);
|
|
18
|
+
|
|
19
|
+
const items: SettingItemGroup = {
|
|
20
|
+
children: [
|
|
21
|
+
{
|
|
22
|
+
children: (
|
|
23
|
+
<Switch
|
|
24
|
+
checked={!!checked}
|
|
25
|
+
onChange={(e) => {
|
|
26
|
+
updatePreference({ telemetry: e });
|
|
27
|
+
}}
|
|
28
|
+
/>
|
|
29
|
+
),
|
|
30
|
+
desc: t('analytics.telemetry.desc'),
|
|
31
|
+
label: t('analytics.telemetry.title'),
|
|
32
|
+
minWidth: undefined,
|
|
33
|
+
valuePropName: 'checked',
|
|
34
|
+
},
|
|
35
|
+
],
|
|
36
|
+
title: t('analytics.title'),
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
return <Form items={[items]} itemsType={'group'} {...FORM_STYLE} />;
|
|
40
|
+
});
|
|
41
|
+
|
|
42
|
+
export default Analytics;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { Logo, Tag } from '@lobehub/ui';
|
|
2
|
+
import { PropsWithChildren } from 'react';
|
|
3
|
+
import { Flexbox } from 'react-layout-kit';
|
|
4
|
+
|
|
5
|
+
import { CURRENT_VERSION } from '@/const/version';
|
|
6
|
+
import { isMobileDevice } from '@/utils/responsive';
|
|
7
|
+
|
|
8
|
+
const COPYRIGHT = `© 2023-${new Date().getFullYear()} LobeHub, LLC`;
|
|
9
|
+
|
|
10
|
+
const Layout = ({ children }: PropsWithChildren) => {
|
|
11
|
+
const isMobile = isMobileDevice();
|
|
12
|
+
return (
|
|
13
|
+
<Flexbox align={'center'} gap={12} paddingBlock={36} width={'100%'}>
|
|
14
|
+
<Logo size={isMobile ? 100 : 120} />
|
|
15
|
+
<h1 style={{ fontSize: isMobile ? 32 : 36, fontWeight: 900, lineHeight: 1, marginBottom: 0 }}>
|
|
16
|
+
LobeChat
|
|
17
|
+
</h1>
|
|
18
|
+
<Tag>v{CURRENT_VERSION}</Tag>
|
|
19
|
+
{children}
|
|
20
|
+
<div>Empowering your AI dreams by LobeHub</div>
|
|
21
|
+
<div style={{ fontWeight: 400, opacity: 0.33 }}>{COPYRIGHT}</div>
|
|
22
|
+
</Flexbox>
|
|
23
|
+
);
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
export default Layout;
|
|
@@ -1,37 +1,32 @@
|
|
|
1
|
-
'use client';
|
|
2
|
-
|
|
3
|
-
import { createStyles } from 'antd-style';
|
|
4
|
-
import { memo } from 'react';
|
|
5
|
-
import { useTranslation } from 'react-i18next';
|
|
6
1
|
import { Flexbox } from 'react-layout-kit';
|
|
7
2
|
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
import
|
|
11
|
-
|
|
12
|
-
import
|
|
13
|
-
import Analytics from './Analytics';
|
|
14
|
-
|
|
15
|
-
const useStyles = createStyles(({ css }) => ({
|
|
16
|
-
container: css`
|
|
17
|
-
width: 100%;
|
|
18
|
-
max-width: 1024px;
|
|
19
|
-
`,
|
|
20
|
-
}));
|
|
3
|
+
import Follow from '@//features/Follow';
|
|
4
|
+
import AboutList from '@/app/(main)/settings//about/features/AboutList';
|
|
5
|
+
import Analytics from '@/app/(main)/settings/about/features/Analytics';
|
|
6
|
+
import { getServerConfig } from '@/config/server';
|
|
7
|
+
import { translation } from '@/server/translation';
|
|
21
8
|
|
|
22
|
-
|
|
23
|
-
const { t } = useTranslation('setting');
|
|
9
|
+
const enabledTelemetryChat = getServerConfig().ENABLE_LANGFUSE;
|
|
24
10
|
|
|
25
|
-
|
|
26
|
-
const
|
|
11
|
+
export const generateMetadata = async () => {
|
|
12
|
+
const { t } = await translation('setting');
|
|
13
|
+
return {
|
|
14
|
+
title: t('tab.about'),
|
|
15
|
+
};
|
|
16
|
+
};
|
|
27
17
|
|
|
18
|
+
const Page = () => {
|
|
28
19
|
return (
|
|
29
20
|
<>
|
|
30
|
-
<
|
|
31
|
-
<Flexbox align={'center'} className={styles.container} gap={12}>
|
|
21
|
+
<Flexbox gap={24} style={{ marginBlock: 48 }} width={'100%'}>
|
|
32
22
|
<AboutList />
|
|
33
23
|
{enabledTelemetryChat && <Analytics />}
|
|
34
24
|
</Flexbox>
|
|
25
|
+
<Follow />
|
|
35
26
|
</>
|
|
36
27
|
);
|
|
37
|
-
}
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
Page.displayName = 'AboutSetting';
|
|
31
|
+
|
|
32
|
+
export default Page;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
3
|
+
import isEqual from 'fast-deep-equal';
|
|
4
|
+
import { PropsWithChildren, memo } from 'react';
|
|
5
|
+
|
|
6
|
+
import { INBOX_SESSION_ID } from '@/const/session';
|
|
7
|
+
import StoreUpdater from '@/features/AgentSetting/StoreUpdater';
|
|
8
|
+
import { Provider, createStore } from '@/features/AgentSetting/store';
|
|
9
|
+
import { useUserStore } from '@/store/user';
|
|
10
|
+
import { settingsSelectors } from '@/store/user/selectors';
|
|
11
|
+
|
|
12
|
+
const Layout = memo(({ children }: PropsWithChildren) => {
|
|
13
|
+
const config = useUserStore(settingsSelectors.defaultAgentConfig, isEqual);
|
|
14
|
+
const meta = useUserStore(settingsSelectors.defaultAgentMeta, isEqual);
|
|
15
|
+
const [updateAgent] = useUserStore((s) => [s.updateDefaultAgent]);
|
|
16
|
+
|
|
17
|
+
return (
|
|
18
|
+
<Provider createStore={createStore}>
|
|
19
|
+
<StoreUpdater
|
|
20
|
+
config={config}
|
|
21
|
+
id={INBOX_SESSION_ID}
|
|
22
|
+
meta={meta}
|
|
23
|
+
onConfigChange={(config) => {
|
|
24
|
+
updateAgent({ config });
|
|
25
|
+
}}
|
|
26
|
+
onMetaChange={(meta) => {
|
|
27
|
+
updateAgent({ meta });
|
|
28
|
+
}}
|
|
29
|
+
/>
|
|
30
|
+
{children}
|
|
31
|
+
</Provider>
|
|
32
|
+
);
|
|
33
|
+
});
|
|
34
|
+
|
|
35
|
+
export default Layout;
|
|
@@ -1,18 +1,31 @@
|
|
|
1
|
-
|
|
1
|
+
import AgentChat from '@/features/AgentSetting/AgentChat';
|
|
2
|
+
import AgentMeta from '@/features/AgentSetting/AgentMeta';
|
|
3
|
+
import AgentModal from '@/features/AgentSetting/AgentModal';
|
|
4
|
+
import AgentPlugin from '@/features/AgentSetting/AgentPlugin';
|
|
5
|
+
import AgentPrompt from '@/features/AgentSetting/AgentPrompt';
|
|
6
|
+
import AgentTTS from '@/features/AgentSetting/AgentTTS';
|
|
7
|
+
import { translation } from '@/server/translation';
|
|
2
8
|
|
|
3
|
-
|
|
4
|
-
|
|
9
|
+
export const generateMetadata = async () => {
|
|
10
|
+
const { t } = await translation('setting');
|
|
11
|
+
return {
|
|
12
|
+
title: t('tab.agent'),
|
|
13
|
+
};
|
|
14
|
+
};
|
|
5
15
|
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
import Agent from './Agent';
|
|
9
|
-
|
|
10
|
-
export default memo(() => {
|
|
11
|
-
const { t } = useTranslation('setting');
|
|
16
|
+
const Page = () => {
|
|
12
17
|
return (
|
|
13
18
|
<>
|
|
14
|
-
<
|
|
15
|
-
<
|
|
19
|
+
<AgentPrompt />
|
|
20
|
+
<AgentMeta />
|
|
21
|
+
<AgentChat />
|
|
22
|
+
<AgentModal />
|
|
23
|
+
<AgentTTS />
|
|
24
|
+
<AgentPlugin />
|
|
16
25
|
</>
|
|
17
26
|
);
|
|
18
|
-
}
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
Page.displayName = 'AgentSetting';
|
|
30
|
+
|
|
31
|
+
export default Page;
|
|
@@ -1,12 +1,13 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
1
3
|
import { Form, type ItemGroup } from '@lobehub/ui';
|
|
2
|
-
import {
|
|
4
|
+
import { App, Button, Input } from 'antd';
|
|
3
5
|
import isEqual from 'fast-deep-equal';
|
|
4
|
-
import { AppWindow } from 'lucide-react';
|
|
5
6
|
import { signIn, signOut } from 'next-auth/react';
|
|
6
7
|
import { memo, useCallback } from 'react';
|
|
7
8
|
import { useTranslation } from 'react-i18next';
|
|
8
9
|
|
|
9
|
-
import { useSyncSettings } from '@/app/(main)/settings
|
|
10
|
+
import { useSyncSettings } from '@/app/(main)/settings//hooks/useSyncSettings';
|
|
10
11
|
import { FORM_STYLE } from '@/const/layoutTokens';
|
|
11
12
|
import { DEFAULT_SETTINGS } from '@/const/settings';
|
|
12
13
|
import { useOAuthSession } from '@/hooks/useOAuthSession';
|
|
@@ -26,7 +27,7 @@ export interface SettingsCommonProps {
|
|
|
26
27
|
|
|
27
28
|
const Common = memo<SettingsCommonProps>(({ showAccessCodeConfig, showOAuthLogin }) => {
|
|
28
29
|
const { t } = useTranslation('setting');
|
|
29
|
-
const [form] =
|
|
30
|
+
const [form] = Form.useForm();
|
|
30
31
|
|
|
31
32
|
const { user, isOAuthLoggedIn } = useOAuthSession();
|
|
32
33
|
|
|
@@ -146,7 +147,6 @@ const Common = memo<SettingsCommonProps>(({ showAccessCodeConfig, showOAuthLogin
|
|
|
146
147
|
minWidth: undefined,
|
|
147
148
|
},
|
|
148
149
|
],
|
|
149
|
-
icon: AppWindow,
|
|
150
150
|
title: t('settingSystem.title'),
|
|
151
151
|
};
|
|
152
152
|
|
|
@@ -157,7 +157,9 @@ const Common = memo<SettingsCommonProps>(({ showAccessCodeConfig, showOAuthLogin
|
|
|
157
157
|
form={form}
|
|
158
158
|
initialValues={settings}
|
|
159
159
|
items={[system]}
|
|
160
|
+
itemsType={'group'}
|
|
160
161
|
onValuesChange={setSettings}
|
|
162
|
+
variant={'pure'}
|
|
161
163
|
{...FORM_STYLE}
|
|
162
164
|
/>
|
|
163
165
|
);
|
|
@@ -1,7 +1,9 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
1
3
|
import { Form, type ItemGroup, SelectWithImg, SliderWithInput } from '@lobehub/ui';
|
|
2
|
-
import {
|
|
4
|
+
import { Select } from 'antd';
|
|
3
5
|
import isEqual from 'fast-deep-equal';
|
|
4
|
-
import { Monitor, Moon,
|
|
6
|
+
import { Monitor, Moon, Sun } from 'lucide-react';
|
|
5
7
|
import { memo } from 'react';
|
|
6
8
|
import { useTranslation } from 'react-i18next';
|
|
7
9
|
|
|
@@ -14,14 +16,13 @@ import { useUserStore } from '@/store/user';
|
|
|
14
16
|
import { settingsSelectors } from '@/store/user/selectors';
|
|
15
17
|
import { switchLang } from '@/utils/client/switchLang';
|
|
16
18
|
|
|
17
|
-
import { ThemeSwatchesNeutral, ThemeSwatchesPrimary } from '
|
|
19
|
+
import { ThemeSwatchesNeutral, ThemeSwatchesPrimary } from './ThemeSwatches';
|
|
18
20
|
|
|
19
21
|
type SettingItemGroup = ItemGroup;
|
|
20
22
|
|
|
21
23
|
const Theme = memo(() => {
|
|
22
24
|
const { t } = useTranslation('setting');
|
|
23
|
-
const [form] =
|
|
24
|
-
|
|
25
|
+
const [form] = Form.useForm();
|
|
25
26
|
const settings = useUserStore(settingsSelectors.currentSettings, isEqual);
|
|
26
27
|
const [setThemeMode, setSettings] = useUserStore((s) => [s.switchThemeMode, s.setSettings]);
|
|
27
28
|
|
|
@@ -125,7 +126,6 @@ const Theme = memo(() => {
|
|
|
125
126
|
minWidth: undefined,
|
|
126
127
|
},
|
|
127
128
|
],
|
|
128
|
-
icon: Palette,
|
|
129
129
|
title: t('settingTheme.title'),
|
|
130
130
|
};
|
|
131
131
|
|
|
@@ -134,7 +134,9 @@ const Theme = memo(() => {
|
|
|
134
134
|
form={form}
|
|
135
135
|
initialValues={settings}
|
|
136
136
|
items={[theme]}
|
|
137
|
+
itemsType={'group'}
|
|
137
138
|
onValuesChange={setSettings}
|
|
139
|
+
variant={'pure'}
|
|
138
140
|
{...FORM_STYLE}
|
|
139
141
|
/>
|
|
140
142
|
);
|
|
@@ -1,9 +1,26 @@
|
|
|
1
1
|
import { getServerConfig } from '@/config/server';
|
|
2
|
+
import { translation } from '@/server/translation';
|
|
2
3
|
|
|
3
|
-
import
|
|
4
|
+
import Common from './features/Common';
|
|
5
|
+
import Theme from './features/Theme';
|
|
4
6
|
|
|
5
|
-
export
|
|
6
|
-
const {
|
|
7
|
+
export const generateMetadata = async () => {
|
|
8
|
+
const { t } = await translation('setting');
|
|
9
|
+
return {
|
|
10
|
+
title: t('tab.common'),
|
|
11
|
+
};
|
|
12
|
+
};
|
|
7
13
|
|
|
8
|
-
|
|
14
|
+
const Page = () => {
|
|
15
|
+
const { SHOW_ACCESS_CODE_CONFIG, ENABLE_OAUTH_SSO } = getServerConfig();
|
|
16
|
+
return (
|
|
17
|
+
<>
|
|
18
|
+
<Theme />
|
|
19
|
+
<Common showAccessCodeConfig={SHOW_ACCESS_CODE_CONFIG} showOAuthLogin={ENABLE_OAUTH_SSO} />
|
|
20
|
+
</>
|
|
21
|
+
);
|
|
9
22
|
};
|
|
23
|
+
|
|
24
|
+
Page.displayName = 'CommonSetting';
|
|
25
|
+
|
|
26
|
+
export default Page;
|
|
@@ -1,8 +1,11 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
1
3
|
import { Alert } from '@lobehub/ui';
|
|
2
4
|
import { Button } from 'antd';
|
|
3
5
|
import Link from 'next/link';
|
|
4
6
|
import { memo } from 'react';
|
|
5
7
|
import { useTranslation } from 'react-i18next';
|
|
8
|
+
import { Flexbox } from 'react-layout-kit';
|
|
6
9
|
|
|
7
10
|
import { MANUAL_UPGRADE_URL } from '@/const/url';
|
|
8
11
|
import { useGlobalStore } from '@/store/global';
|
|
@@ -11,23 +14,28 @@ const UpgradeAlert = memo(() => {
|
|
|
11
14
|
const [hasNewVersion, latestVersion] = useGlobalStore((s) => [s.hasNewVersion, s.latestVersion]);
|
|
12
15
|
const { t } = useTranslation('common');
|
|
13
16
|
|
|
17
|
+
if (!hasNewVersion) return;
|
|
18
|
+
|
|
14
19
|
return (
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
+
<Alert
|
|
21
|
+
closable
|
|
22
|
+
message={
|
|
23
|
+
<Flexbox gap={8}>
|
|
24
|
+
<p>{t('upgradeVersion.newVersion', { version: `v${latestVersion}` })}</p>
|
|
25
|
+
<Link
|
|
26
|
+
aria-label={t('upgradeVersion.action')}
|
|
27
|
+
href={MANUAL_UPGRADE_URL}
|
|
28
|
+
style={{ marginBottom: 6 }}
|
|
29
|
+
target={'_blank'}
|
|
30
|
+
>
|
|
31
|
+
<Button block size={'small'} type={'primary'}>
|
|
20
32
|
{t('upgradeVersion.action')}
|
|
21
33
|
</Button>
|
|
22
34
|
</Link>
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
style={{ marginBottom: 6 }}
|
|
28
|
-
type={'info'}
|
|
29
|
-
/>
|
|
30
|
-
)
|
|
35
|
+
</Flexbox>
|
|
36
|
+
}
|
|
37
|
+
type={'info'}
|
|
38
|
+
/>
|
|
31
39
|
);
|
|
32
40
|
});
|
|
33
41
|
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { Icon } from '@lobehub/ui';
|
|
2
|
+
import { Bot, Cloudy, Info, Mic2, Settings2, Webhook } from 'lucide-react';
|
|
3
|
+
import { useMemo } from 'react';
|
|
4
|
+
import { useTranslation } from 'react-i18next';
|
|
5
|
+
|
|
6
|
+
import type { MenuProps } from '@/components/Menu';
|
|
7
|
+
import { SettingsTabs } from '@/store/global/initialState';
|
|
8
|
+
import { featureFlagsSelectors, useServerConfigStore } from '@/store/serverConfig';
|
|
9
|
+
|
|
10
|
+
interface UseCategoryOptions {
|
|
11
|
+
mobile?: boolean;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export const useCategory = ({ mobile }: UseCategoryOptions = {}) => {
|
|
15
|
+
const { t } = useTranslation('setting');
|
|
16
|
+
const { enableWebrtc, showLLM } = useServerConfigStore(featureFlagsSelectors);
|
|
17
|
+
|
|
18
|
+
const iconSize = mobile ? { fontSize: 20 } : undefined;
|
|
19
|
+
|
|
20
|
+
const cateItems: MenuProps['items'] = useMemo(
|
|
21
|
+
() =>
|
|
22
|
+
[
|
|
23
|
+
{
|
|
24
|
+
icon: <Icon icon={Settings2} size={iconSize} />,
|
|
25
|
+
key: SettingsTabs.Common,
|
|
26
|
+
label: t('tab.common'),
|
|
27
|
+
},
|
|
28
|
+
enableWebrtc && {
|
|
29
|
+
icon: <Icon icon={Cloudy} size={iconSize} />,
|
|
30
|
+
key: SettingsTabs.Sync,
|
|
31
|
+
label: t('tab.sync'),
|
|
32
|
+
},
|
|
33
|
+
showLLM && {
|
|
34
|
+
icon: <Icon icon={Webhook} size={iconSize} />,
|
|
35
|
+
key: SettingsTabs.LLM,
|
|
36
|
+
label: t('tab.llm'),
|
|
37
|
+
},
|
|
38
|
+
{ icon: <Icon icon={Mic2} size={iconSize} />, key: SettingsTabs.TTS, label: t('tab.tts') },
|
|
39
|
+
{
|
|
40
|
+
icon: <Icon icon={Bot} size={iconSize} />,
|
|
41
|
+
key: SettingsTabs.Agent,
|
|
42
|
+
label: t('tab.agent'),
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
icon: <Icon icon={Info} size={iconSize} />,
|
|
46
|
+
key: SettingsTabs.About,
|
|
47
|
+
label: t('tab.about'),
|
|
48
|
+
},
|
|
49
|
+
].filter(Boolean) as MenuProps['items'],
|
|
50
|
+
[t, enableWebrtc, showLLM],
|
|
51
|
+
);
|
|
52
|
+
|
|
53
|
+
return cateItems;
|
|
54
|
+
};
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { FormInstance } from 'antd/es/form/hooks/useForm';
|
|
2
|
-
import {
|
|
2
|
+
import { useLayoutEffect } from 'react';
|
|
3
3
|
|
|
4
4
|
import { useUserStore } from '@/store/user';
|
|
5
5
|
|
|
6
6
|
export const useSyncSettings = (form: FormInstance) => {
|
|
7
|
-
|
|
7
|
+
useLayoutEffect(() => {
|
|
8
8
|
// set the first time
|
|
9
9
|
form.setFieldsValue(useUserStore.getState().settings);
|
|
10
10
|
|
|
@@ -2,7 +2,10 @@ import ServerLayout from '@/components/server/ServerLayout';
|
|
|
2
2
|
|
|
3
3
|
import Desktop from './_layout/Desktop';
|
|
4
4
|
import Mobile from './_layout/Mobile';
|
|
5
|
+
import { LayoutProps } from './_layout/type';
|
|
5
6
|
|
|
6
|
-
const SettingsLayout = ServerLayout({ Desktop, Mobile });
|
|
7
|
+
const SettingsLayout = ServerLayout<LayoutProps>({ Desktop, Mobile });
|
|
8
|
+
|
|
9
|
+
SettingsLayout.displayName = 'SettingsLayout';
|
|
7
10
|
|
|
8
11
|
export default SettingsLayout;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
3
|
+
import { Anthropic } from '@lobehub/icons';
|
|
3
4
|
import { memo } from 'react';
|
|
4
5
|
|
|
5
6
|
import { ModelProvider } from '@/libs/agent-runtime';
|
|
@@ -7,19 +8,12 @@ import { ModelProvider } from '@/libs/agent-runtime';
|
|
|
7
8
|
import ProviderConfig from '../components/ProviderConfig';
|
|
8
9
|
|
|
9
10
|
const AnthropicProvider = memo(() => {
|
|
10
|
-
const theme = useTheme();
|
|
11
|
-
|
|
12
11
|
return (
|
|
13
12
|
<ProviderConfig
|
|
14
13
|
checkModel={'claude-3-haiku-20240307'}
|
|
15
14
|
provider={ModelProvider.Anthropic}
|
|
16
15
|
showEndpoint
|
|
17
|
-
title={
|
|
18
|
-
<Anthropic.Text
|
|
19
|
-
color={theme.isDarkMode ? theme.colorText : Claude.colorPrimary}
|
|
20
|
-
size={18}
|
|
21
|
-
/>
|
|
22
|
-
}
|
|
16
|
+
title={<Anthropic.Text size={15} />}
|
|
23
17
|
/>
|
|
24
18
|
);
|
|
25
19
|
});
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
1
3
|
import { Azure, OpenAI } from '@lobehub/icons';
|
|
2
4
|
import { Markdown } from '@lobehub/ui';
|
|
3
5
|
import { AutoComplete, Divider, Input } from 'antd';
|
|
@@ -95,7 +97,7 @@ const AzureOpenAIProvider = memo(() => {
|
|
|
95
97
|
provider={providerKey}
|
|
96
98
|
title={
|
|
97
99
|
<Flexbox align={'center'} gap={8} horizontal>
|
|
98
|
-
<Azure.Combine size={
|
|
100
|
+
<Azure.Combine size={22} type={'color'}></Azure.Combine>
|
|
99
101
|
<Divider style={{ margin: '0 4px' }} type={'vertical'} />
|
|
100
102
|
<OpenAI.Combine size={24}></OpenAI.Combine>
|
|
101
103
|
</Flexbox>
|