@lobehub/chat 0.152.6 → 0.152.7
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/docs/self-hosting/advanced/settings-url-share.mdx +100 -0
- package/docs/self-hosting/advanced/settings-url-share.zh-CN.mdx +100 -0
- package/locales/ar/common.json +1 -0
- package/locales/ar/setting.json +4 -1
- package/locales/bg-BG/common.json +1 -0
- package/locales/bg-BG/setting.json +4 -1
- package/locales/de-DE/common.json +1 -0
- package/locales/de-DE/setting.json +4 -1
- package/locales/en-US/common.json +1 -0
- package/locales/en-US/setting.json +4 -1
- package/locales/es-ES/common.json +1 -0
- package/locales/es-ES/setting.json +4 -1
- package/locales/fr-FR/common.json +1 -0
- package/locales/fr-FR/setting.json +4 -1
- package/locales/it-IT/common.json +1 -0
- package/locales/it-IT/setting.json +4 -1
- package/locales/ja-JP/common.json +1 -0
- package/locales/ja-JP/setting.json +4 -1
- package/locales/ko-KR/common.json +1 -0
- package/locales/ko-KR/setting.json +4 -1
- package/locales/nl-NL/common.json +1 -0
- package/locales/nl-NL/setting.json +4 -1
- package/locales/pl-PL/common.json +1 -0
- package/locales/pl-PL/setting.json +4 -1
- package/locales/pt-BR/common.json +1 -0
- package/locales/pt-BR/setting.json +4 -1
- package/locales/ru-RU/common.json +1 -0
- package/locales/ru-RU/setting.json +4 -1
- package/locales/tr-TR/common.json +1 -0
- package/locales/tr-TR/setting.json +4 -1
- package/locales/vi-VN/common.json +1 -0
- package/locales/vi-VN/setting.json +4 -1
- package/locales/zh-CN/common.json +1 -0
- package/locales/zh-CN/setting.json +4 -1
- package/locales/zh-TW/common.json +1 -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 +35 -0
- package/src/app/(main)/(mobile)/me/features/ExtraCate.tsx +26 -0
- package/src/app/(main)/(mobile)/me/features/useExtraCate.tsx +62 -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/index.tsx +1 -1
- package/src/app/(main)/@nav/_layout/Mobile.tsx +3 -3
- 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 +3 -4
- 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 +28 -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/_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 +33 -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 +134 -0
- package/src/app/(main)/settings/about/features/Analytics.tsx +42 -0
- package/src/app/(main)/settings/about/index.tsx +46 -0
- package/src/app/(main)/settings/about/page.tsx +13 -33
- package/src/app/(main)/settings/agent/{Agent.tsx → index.tsx} +8 -4
- package/src/app/(main)/settings/agent/page.tsx +8 -16
- package/src/app/(main)/settings/common/{Common.tsx → features/Common.tsx} +6 -4
- package/src/app/(main)/settings/common/{Theme.tsx → features/Theme/index.tsx} +8 -6
- package/src/app/(main)/settings/common/index.tsx +11 -16
- package/src/app/(main)/settings/common/page.tsx +8 -7
- 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 -8
- 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 +29 -3
- package/src/app/(main)/settings/llm/index.tsx +11 -23
- package/src/app/(main)/settings/llm/page.tsx +15 -0
- 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/index.tsx +17 -0
- package/src/app/(main)/settings/sync/page.tsx +11 -15
- 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/index.tsx +15 -0
- package/src/app/(main)/settings/tts/page.tsx +8 -16
- package/src/app/layout.tsx +6 -2
- 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 +2 -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.test.ts +20 -0
- package/src/hooks/useQuery.ts +7 -0
- package/src/hooks/useQueryRoute.test.ts +86 -0
- package/src/hooks/useQueryRoute.ts +46 -0
- package/src/locales/default/common.ts +1 -0
- package/src/locales/default/setting.ts +3 -0
- package/src/store/global/initialState.ts +1 -0
- package/src/store/user/slices/common/action.test.ts +1 -1
- 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/loading.tsx +0 -3
- 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/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
|
@@ -1,37 +1,17 @@
|
|
|
1
|
-
|
|
1
|
+
import { translation } from '@/server/translation';
|
|
2
|
+
import { isMobileDevice } from '@/utils/responsive';
|
|
2
3
|
|
|
3
|
-
import
|
|
4
|
-
import { memo } from 'react';
|
|
5
|
-
import { useTranslation } from 'react-i18next';
|
|
6
|
-
import { Flexbox } from 'react-layout-kit';
|
|
4
|
+
import Page from './index';
|
|
7
5
|
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
6
|
+
export const generateMetadata = async () => {
|
|
7
|
+
const { t } = await translation('setting');
|
|
8
|
+
return {
|
|
9
|
+
title: t('tab.about'),
|
|
10
|
+
};
|
|
11
|
+
};
|
|
11
12
|
|
|
12
|
-
|
|
13
|
-
|
|
13
|
+
export default () => {
|
|
14
|
+
const isMobile = isMobileDevice();
|
|
14
15
|
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
width: 100%;
|
|
18
|
-
max-width: 1024px;
|
|
19
|
-
`,
|
|
20
|
-
}));
|
|
21
|
-
|
|
22
|
-
export default memo(() => {
|
|
23
|
-
const { t } = useTranslation('setting');
|
|
24
|
-
|
|
25
|
-
const { styles } = useStyles();
|
|
26
|
-
const enabledTelemetryChat = useServerConfigStore(serverConfigSelectors.enabledTelemetryChat);
|
|
27
|
-
|
|
28
|
-
return (
|
|
29
|
-
<>
|
|
30
|
-
<PageTitle title={t('tab.tts')} />
|
|
31
|
-
<Flexbox align={'center'} className={styles.container} gap={12}>
|
|
32
|
-
<AboutList />
|
|
33
|
-
{enabledTelemetryChat && <Analytics />}
|
|
34
|
-
</Flexbox>
|
|
35
|
-
</>
|
|
36
|
-
);
|
|
37
|
-
});
|
|
16
|
+
return <Page mobile={isMobile} />;
|
|
17
|
+
};
|
|
@@ -1,18 +1,20 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
1
3
|
import isEqual from 'fast-deep-equal';
|
|
2
4
|
import { memo } from 'react';
|
|
3
5
|
|
|
4
6
|
import { INBOX_SESSION_ID } from '@/const/session';
|
|
5
|
-
import
|
|
7
|
+
import AgentSettings from '@/features/AgentSetting';
|
|
6
8
|
import { useUserStore } from '@/store/user';
|
|
7
9
|
import { settingsSelectors } from '@/store/user/selectors';
|
|
8
10
|
|
|
9
|
-
const
|
|
11
|
+
const Page = memo(() => {
|
|
10
12
|
const config = useUserStore(settingsSelectors.defaultAgentConfig, isEqual);
|
|
11
13
|
const meta = useUserStore(settingsSelectors.defaultAgentMeta, isEqual);
|
|
12
14
|
const [updateAgent] = useUserStore((s) => [s.updateDefaultAgent]);
|
|
13
15
|
|
|
14
16
|
return (
|
|
15
|
-
<
|
|
17
|
+
<AgentSettings
|
|
16
18
|
config={config}
|
|
17
19
|
id={INBOX_SESSION_ID}
|
|
18
20
|
meta={meta}
|
|
@@ -26,4 +28,6 @@ const Agent = memo(() => {
|
|
|
26
28
|
);
|
|
27
29
|
});
|
|
28
30
|
|
|
29
|
-
|
|
31
|
+
Page.displayName = 'AgentSetting';
|
|
32
|
+
|
|
33
|
+
export default Page;
|
|
@@ -1,18 +1,10 @@
|
|
|
1
|
-
|
|
1
|
+
import { translation } from '@/server/translation';
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
3
|
+
export const generateMetadata = async () => {
|
|
4
|
+
const { t } = await translation('setting');
|
|
5
|
+
return {
|
|
6
|
+
title: t('tab.agent'),
|
|
7
|
+
};
|
|
8
|
+
};
|
|
5
9
|
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
import Agent from './Agent';
|
|
9
|
-
|
|
10
|
-
export default memo(() => {
|
|
11
|
-
const { t } = useTranslation('setting');
|
|
12
|
-
return (
|
|
13
|
-
<>
|
|
14
|
-
<PageTitle title={t('tab.agent')} />
|
|
15
|
-
<Agent />
|
|
16
|
-
</>
|
|
17
|
-
);
|
|
18
|
-
});
|
|
10
|
+
export { default } from './index';
|
|
@@ -1,7 +1,8 @@
|
|
|
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';
|
|
@@ -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,24 +1,19 @@
|
|
|
1
|
-
|
|
1
|
+
import { getServerConfig } from '@/config/server';
|
|
2
2
|
|
|
3
|
-
import
|
|
4
|
-
import
|
|
3
|
+
import Common from './features/Common';
|
|
4
|
+
import Theme from './features/Theme';
|
|
5
5
|
|
|
6
|
-
|
|
7
|
-
import { CURRENT_VERSION } from '@/const/version';
|
|
8
|
-
|
|
9
|
-
import Footer from '../features/Footer';
|
|
10
|
-
import Common, { SettingsCommonProps } from './Common';
|
|
11
|
-
import Theme from './Theme';
|
|
12
|
-
|
|
13
|
-
export default memo<SettingsCommonProps>((props) => {
|
|
14
|
-
const { t } = useTranslation('setting');
|
|
6
|
+
const { SHOW_ACCESS_CODE_CONFIG, ENABLE_OAUTH_SSO } = getServerConfig();
|
|
15
7
|
|
|
8
|
+
const Page = () => {
|
|
16
9
|
return (
|
|
17
10
|
<>
|
|
18
|
-
<PageTitle title={t('tab.common')} />
|
|
19
11
|
<Theme />
|
|
20
|
-
<Common {
|
|
21
|
-
<Footer>LobeChat v{CURRENT_VERSION}</Footer>
|
|
12
|
+
<Common showAccessCodeConfig={SHOW_ACCESS_CODE_CONFIG} showOAuthLogin={ENABLE_OAUTH_SSO} />
|
|
22
13
|
</>
|
|
23
14
|
);
|
|
24
|
-
}
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
Page.displayName = 'CommonSetting';
|
|
18
|
+
|
|
19
|
+
export default Page;
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { translation } from '@/server/translation';
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
return <Index showAccessCodeConfig={SHOW_ACCESS_CODE_CONFIG} showOAuthLogin={ENABLE_OAUTH_SSO} />;
|
|
3
|
+
export const generateMetadata = async () => {
|
|
4
|
+
const { t } = await translation('setting');
|
|
5
|
+
return {
|
|
6
|
+
title: t('tab.common'),
|
|
7
|
+
};
|
|
9
8
|
};
|
|
9
|
+
|
|
10
|
+
export { default } from './index';
|
|
@@ -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,3 +1,5 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
1
3
|
import { Anthropic, Claude } from '@lobehub/icons';
|
|
2
4
|
import { useTheme } from 'antd-style';
|
|
3
5
|
import { memo } from 'react';
|
|
@@ -7,19 +9,13 @@ import { ModelProvider } from '@/libs/agent-runtime';
|
|
|
7
9
|
import ProviderConfig from '../components/ProviderConfig';
|
|
8
10
|
|
|
9
11
|
const AnthropicProvider = memo(() => {
|
|
10
|
-
const
|
|
11
|
-
|
|
12
|
+
const { isDarkMode } = useTheme();
|
|
12
13
|
return (
|
|
13
14
|
<ProviderConfig
|
|
14
15
|
checkModel={'claude-3-haiku-20240307'}
|
|
15
16
|
provider={ModelProvider.Anthropic}
|
|
16
17
|
showEndpoint
|
|
17
|
-
title={
|
|
18
|
-
<Anthropic.Text
|
|
19
|
-
color={theme.isDarkMode ? theme.colorText : Claude.colorPrimary}
|
|
20
|
-
size={18}
|
|
21
|
-
/>
|
|
22
|
-
}
|
|
18
|
+
title={<Anthropic.Text color={isDarkMode ? undefined : Claude.colorPrimary} size={15} />}
|
|
23
19
|
/>
|
|
24
20
|
);
|
|
25
21
|
});
|
|
@@ -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>
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
1
3
|
import { Aws, Bedrock } from '@lobehub/icons';
|
|
2
4
|
import { Divider, Input, Select } from 'antd';
|
|
3
5
|
import { memo } from 'react';
|
|
@@ -62,7 +64,7 @@ const BedrockProvider = memo(() => {
|
|
|
62
64
|
<Flexbox align={'center'} gap={8} horizontal>
|
|
63
65
|
<Aws.Color size={32} />
|
|
64
66
|
<Divider style={{ margin: '0 4px' }} type={'vertical'} />
|
|
65
|
-
<Bedrock.Combine size={
|
|
67
|
+
<Bedrock.Combine size={26} type={'color'} />
|
|
66
68
|
</Flexbox>
|
|
67
69
|
}
|
|
68
70
|
/>
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
1
3
|
import { Gemini, Google } from '@lobehub/icons';
|
|
2
4
|
import { Divider } from 'antd';
|
|
3
5
|
import { memo } from 'react';
|
|
@@ -15,9 +17,9 @@ const GoogleProvider = memo(() => {
|
|
|
15
17
|
showEndpoint
|
|
16
18
|
title={
|
|
17
19
|
<Flexbox align={'center'} gap={8} horizontal>
|
|
18
|
-
<Google.BrandColor size={
|
|
20
|
+
<Google.BrandColor size={22} />
|
|
19
21
|
<Divider style={{ margin: '0 4px' }} type={'vertical'} />
|
|
20
|
-
<Gemini.Combine size={
|
|
22
|
+
<Gemini.Combine size={22} type={'color'} />
|
|
21
23
|
</Flexbox>
|
|
22
24
|
}
|
|
23
25
|
/>
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
1
3
|
import { Groq } from '@lobehub/icons';
|
|
2
4
|
import { useTheme } from 'antd-style';
|
|
3
5
|
import { memo } from 'react';
|
|
@@ -13,7 +15,7 @@ const GroqProvider = memo(() => {
|
|
|
13
15
|
<ProviderConfig
|
|
14
16
|
checkModel={'gemma-7b-it'}
|
|
15
17
|
provider={ModelProvider.Groq}
|
|
16
|
-
title={<Groq.Text color={theme.isDarkMode ? theme.colorText : Groq.colorPrimary} size={
|
|
18
|
+
title={<Groq.Text color={theme.isDarkMode ? theme.colorText : Groq.colorPrimary} size={20} />}
|
|
17
19
|
/>
|
|
18
20
|
);
|
|
19
21
|
});
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
1
3
|
import { Minimax } from '@lobehub/icons';
|
|
2
|
-
import { useTheme } from 'antd-style';
|
|
3
4
|
import { memo } from 'react';
|
|
4
5
|
|
|
5
6
|
import { ModelProvider } from '@/libs/agent-runtime';
|
|
@@ -7,18 +8,11 @@ import { ModelProvider } from '@/libs/agent-runtime';
|
|
|
7
8
|
import ProviderConfig from '../components/ProviderConfig';
|
|
8
9
|
|
|
9
10
|
const MinimaxProvider = memo(() => {
|
|
10
|
-
const theme = useTheme();
|
|
11
|
-
|
|
12
11
|
return (
|
|
13
12
|
<ProviderConfig
|
|
14
13
|
checkModel={'abab5.5s-chat'}
|
|
15
14
|
provider={ModelProvider.Minimax}
|
|
16
|
-
title={
|
|
17
|
-
<Minimax.Combine
|
|
18
|
-
color={theme.isDarkMode ? theme.colorText : Minimax.colorPrimary}
|
|
19
|
-
size={32}
|
|
20
|
-
/>
|
|
21
|
-
}
|
|
15
|
+
title={<Minimax.Combine size={32} type={'color'} />}
|
|
22
16
|
/>
|
|
23
17
|
);
|
|
24
18
|
});
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
1
3
|
import { Mistral } from '@lobehub/icons';
|
|
2
|
-
import { useTheme } from 'antd-style';
|
|
3
4
|
import { memo } from 'react';
|
|
4
5
|
|
|
5
6
|
import { ModelProvider } from '@/libs/agent-runtime';
|
|
@@ -7,18 +8,11 @@ import { ModelProvider } from '@/libs/agent-runtime';
|
|
|
7
8
|
import ProviderConfig from '../components/ProviderConfig';
|
|
8
9
|
|
|
9
10
|
const MistralProvider = memo(() => {
|
|
10
|
-
const theme = useTheme();
|
|
11
|
-
|
|
12
11
|
return (
|
|
13
12
|
<ProviderConfig
|
|
14
13
|
checkModel={'open-mistral-7b'}
|
|
15
14
|
provider={ModelProvider.Mistral}
|
|
16
|
-
title={
|
|
17
|
-
<Mistral.Combine
|
|
18
|
-
color={theme.isDarkMode ? theme.colorText : Mistral.colorPrimary}
|
|
19
|
-
size={24}
|
|
20
|
-
/>
|
|
21
|
-
}
|
|
15
|
+
title={<Mistral.Combine size={26} type={'color'} />}
|
|
22
16
|
/>
|
|
23
17
|
);
|
|
24
18
|
});
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
1
3
|
import { Moonshot } from '@lobehub/icons';
|
|
2
4
|
import { useTheme } from 'antd-style';
|
|
3
5
|
import { memo } from 'react';
|
|
@@ -16,7 +18,7 @@ const MoonshotProvider = memo(() => {
|
|
|
16
18
|
title={
|
|
17
19
|
<Moonshot.Combine
|
|
18
20
|
color={theme.isDarkMode ? theme.colorText : Moonshot.colorPrimary}
|
|
19
|
-
size={
|
|
21
|
+
size={22}
|
|
20
22
|
/>
|
|
21
23
|
}
|
|
22
24
|
/>
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
1
3
|
import { Ollama } from '@lobehub/icons';
|
|
2
4
|
import { memo } from 'react';
|
|
3
5
|
import { useTranslation } from 'react-i18next';
|
|
@@ -23,7 +25,7 @@ const OllamaProvider = memo(() => {
|
|
|
23
25
|
showApiKey={false}
|
|
24
26
|
showBrowserRequest
|
|
25
27
|
showEndpoint
|
|
26
|
-
title={<Ollama.Combine size={
|
|
28
|
+
title={<Ollama.Combine size={28} />}
|
|
27
29
|
/>
|
|
28
30
|
);
|
|
29
31
|
});
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
1
3
|
import { OpenRouter } from '@lobehub/icons';
|
|
2
|
-
import { useTheme } from 'antd-style';
|
|
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 OpenRouterProvider = memo(() => {
|
|
10
|
-
const theme = useTheme();
|
|
11
|
-
|
|
12
11
|
return (
|
|
13
12
|
<ProviderConfig
|
|
14
13
|
checkModel={'mistralai/mistral-7b-instruct:free'}
|
|
15
14
|
modelList={{ showModelFetcher: true }}
|
|
16
15
|
provider={ModelProvider.OpenRouter}
|
|
17
|
-
title={
|
|
18
|
-
<OpenRouter.Combine
|
|
19
|
-
color={theme.isDarkMode ? theme.colorText : OpenRouter.colorPrimary}
|
|
20
|
-
size={24}
|
|
21
|
-
/>
|
|
22
|
-
}
|
|
16
|
+
title={<OpenRouter.Combine iconProps={{ color: OpenRouter.colorPrimary }} size={20} />}
|
|
23
17
|
/>
|
|
24
18
|
);
|
|
25
19
|
});
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
1
3
|
import { Perplexity } from '@lobehub/icons';
|
|
2
|
-
import { useTheme } from 'antd-style';
|
|
3
4
|
import { memo } from 'react';
|
|
4
5
|
|
|
5
6
|
import { ModelProvider } from '@/libs/agent-runtime';
|
|
@@ -7,18 +8,11 @@ import { ModelProvider } from '@/libs/agent-runtime';
|
|
|
7
8
|
import ProviderConfig from '../components/ProviderConfig';
|
|
8
9
|
|
|
9
10
|
const PerplexityProvider = memo(() => {
|
|
10
|
-
const theme = useTheme();
|
|
11
|
-
|
|
12
11
|
return (
|
|
13
12
|
<ProviderConfig
|
|
14
13
|
checkModel={'pplx-7b-chat'}
|
|
15
14
|
provider={ModelProvider.Perplexity}
|
|
16
|
-
title={
|
|
17
|
-
<Perplexity.Combine
|
|
18
|
-
color={theme.isDarkMode ? theme.colorText : Perplexity.colorPrimary}
|
|
19
|
-
size={24}
|
|
20
|
-
/>
|
|
21
|
-
}
|
|
15
|
+
title={<Perplexity.Combine size={24} type={'color'} />}
|
|
22
16
|
/>
|
|
23
17
|
);
|
|
24
18
|
});
|