@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
|
@@ -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
|
});
|
|
@@ -1,23 +1,17 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
1
3
|
import { Together } from '@lobehub/icons';
|
|
2
|
-
import { useTheme } from 'antd-style';
|
|
3
4
|
import { memo } from 'react';
|
|
4
5
|
|
|
5
6
|
import ProviderConfig from '../components/ProviderConfig';
|
|
6
7
|
|
|
7
8
|
const TogetherAIProvider = memo(() => {
|
|
8
|
-
const theme = useTheme();
|
|
9
|
-
|
|
10
9
|
return (
|
|
11
10
|
<ProviderConfig
|
|
12
11
|
checkModel={'togethercomputer/alpaca-7b'}
|
|
13
12
|
modelList={{ showModelFetcher: true }}
|
|
14
13
|
provider={'togetherai'}
|
|
15
|
-
title={
|
|
16
|
-
<Together.Combine
|
|
17
|
-
color={theme.isDarkMode ? theme.colorText : Together.colorPrimary}
|
|
18
|
-
size={24}
|
|
19
|
-
/>
|
|
20
|
-
}
|
|
14
|
+
title={<Together.Combine size={26} type={'color'} />}
|
|
21
15
|
/>
|
|
22
16
|
);
|
|
23
17
|
});
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
1
3
|
import { ZeroOne } 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 ZeroOneProvider = memo(() => {
|
|
10
|
-
const theme = useTheme();
|
|
11
|
-
|
|
12
11
|
return (
|
|
13
12
|
<ProviderConfig
|
|
14
13
|
checkModel={'yi-34b-chat-0205'}
|
|
15
14
|
provider={ModelProvider.ZeroOne}
|
|
16
|
-
title={
|
|
17
|
-
<ZeroOne.Combine
|
|
18
|
-
color={theme.isDarkMode ? theme.colorText : ZeroOne.colorPrimary}
|
|
19
|
-
size={32}
|
|
20
|
-
/>
|
|
21
|
-
}
|
|
15
|
+
title={<ZeroOne.Text size={20} />}
|
|
22
16
|
/>
|
|
23
17
|
);
|
|
24
18
|
});
|
|
@@ -1,23 +1,16 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
1
3
|
import { Zhipu } from '@lobehub/icons';
|
|
2
|
-
import { useTheme } from 'antd-style';
|
|
3
|
-
import { lighten } from 'polished';
|
|
4
4
|
import { memo } from 'react';
|
|
5
5
|
|
|
6
6
|
import ProviderConfig from '../components/ProviderConfig';
|
|
7
7
|
|
|
8
8
|
const ZhipuProvider = memo(() => {
|
|
9
|
-
const theme = useTheme();
|
|
10
|
-
|
|
11
9
|
return (
|
|
12
10
|
<ProviderConfig
|
|
13
11
|
checkModel={'glm-3-turbo'}
|
|
14
12
|
provider={'zhipu'}
|
|
15
|
-
title={
|
|
16
|
-
<Zhipu.Combine
|
|
17
|
-
color={theme.isDarkMode ? lighten(0.1, Zhipu.colorPrimary) : Zhipu.colorPrimary}
|
|
18
|
-
size={32}
|
|
19
|
-
/>
|
|
20
|
-
}
|
|
13
|
+
title={<Zhipu.Combine size={32} type={'color'} />}
|
|
21
14
|
/>
|
|
22
15
|
);
|
|
23
16
|
});
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
3
|
+
import { Divider } from 'antd';
|
|
4
|
+
import Link from 'next/link';
|
|
5
|
+
import { memo } from 'react';
|
|
6
|
+
import { Trans } from 'react-i18next';
|
|
7
|
+
|
|
8
|
+
import { MORE_MODEL_PROVIDER_REQUEST_URL } from '@/const/url';
|
|
9
|
+
|
|
10
|
+
const Footer = memo(() => {
|
|
11
|
+
return (
|
|
12
|
+
<Divider>
|
|
13
|
+
<p style={{ fontSize: 14 }}>
|
|
14
|
+
<Trans i18nKey="llm.waitingForMore" ns={'setting'}>
|
|
15
|
+
更多模型正在
|
|
16
|
+
<Link aria-label={'todo'} href={MORE_MODEL_PROVIDER_REQUEST_URL} target="_blank">
|
|
17
|
+
计划接入
|
|
18
|
+
</Link>
|
|
19
|
+
中 ,敬请期待 ✨
|
|
20
|
+
</Trans>
|
|
21
|
+
</p>
|
|
22
|
+
</Divider>
|
|
23
|
+
);
|
|
24
|
+
});
|
|
25
|
+
|
|
26
|
+
export default Footer;
|
|
@@ -1,8 +1,11 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
1
3
|
import { Form, type FormItemProps, type ItemGroup } from '@lobehub/ui';
|
|
2
4
|
import { Form as AntForm, Input, Switch } from 'antd';
|
|
3
5
|
import { debounce } from 'lodash-es';
|
|
4
6
|
import { ReactNode, memo } from 'react';
|
|
5
7
|
import { useTranslation } from 'react-i18next';
|
|
8
|
+
import { Flexbox } from 'react-layout-kit';
|
|
6
9
|
|
|
7
10
|
import { useSyncSettings } from '@/app/(main)/settings/hooks/useSyncSettings';
|
|
8
11
|
import {
|
|
@@ -142,7 +145,19 @@ const ProviderConfig = memo<ProviderConfigProps>(
|
|
|
142
145
|
value={enabled}
|
|
143
146
|
/>
|
|
144
147
|
) : undefined,
|
|
145
|
-
title
|
|
148
|
+
title: (
|
|
149
|
+
<Flexbox
|
|
150
|
+
align={'center'}
|
|
151
|
+
horizontal
|
|
152
|
+
style={{
|
|
153
|
+
height: 24,
|
|
154
|
+
maxHeight: 24,
|
|
155
|
+
...(enabled ? {} : { filter: 'grayscale(100%)', maxHeight: 24, opacity: 0.66 }),
|
|
156
|
+
}}
|
|
157
|
+
>
|
|
158
|
+
{title}
|
|
159
|
+
</Flexbox>
|
|
160
|
+
),
|
|
146
161
|
};
|
|
147
162
|
|
|
148
163
|
return (
|
|
@@ -1,5 +1,59 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { notFound } from 'next/navigation';
|
|
2
|
+
import { Flexbox } from 'react-layout-kit';
|
|
2
3
|
|
|
3
|
-
|
|
4
|
-
|
|
4
|
+
import { serverFeatureFlags } from '@/config/server/featureFlags';
|
|
5
|
+
import { translation } from '@/server/translation';
|
|
6
|
+
|
|
7
|
+
import Anthropic from './Anthropic';
|
|
8
|
+
import Azure from './Azure';
|
|
9
|
+
import Bedrock from './Bedrock';
|
|
10
|
+
import Google from './Google';
|
|
11
|
+
import Groq from './Groq';
|
|
12
|
+
import Minimax from './Minimax';
|
|
13
|
+
import Mistral from './Mistral';
|
|
14
|
+
import Moonshot from './Moonshot';
|
|
15
|
+
import Ollama from './Ollama';
|
|
16
|
+
import OpenAI from './OpenAI';
|
|
17
|
+
import OpenRouter from './OpenRouter';
|
|
18
|
+
import Perplexity from './Perplexity';
|
|
19
|
+
import TogetherAI from './TogetherAI';
|
|
20
|
+
import ZeroOne from './ZeroOne';
|
|
21
|
+
import Zhipu from './Zhipu';
|
|
22
|
+
import Footer from './components/Footer';
|
|
23
|
+
|
|
24
|
+
export const generateMetadata = async () => {
|
|
25
|
+
const { t } = await translation('setting');
|
|
26
|
+
return {
|
|
27
|
+
title: t('tab.llm'),
|
|
28
|
+
};
|
|
5
29
|
};
|
|
30
|
+
|
|
31
|
+
const Page = () => {
|
|
32
|
+
const showLLM = serverFeatureFlags().showLLM;
|
|
33
|
+
if (!showLLM) return notFound();
|
|
34
|
+
|
|
35
|
+
return (
|
|
36
|
+
<Flexbox gap={24}>
|
|
37
|
+
<OpenAI />
|
|
38
|
+
<Azure />
|
|
39
|
+
<Ollama />
|
|
40
|
+
<Google />
|
|
41
|
+
<Anthropic />
|
|
42
|
+
<Bedrock />
|
|
43
|
+
<OpenRouter />
|
|
44
|
+
<TogetherAI />
|
|
45
|
+
<Groq />
|
|
46
|
+
<Perplexity />
|
|
47
|
+
<Minimax />
|
|
48
|
+
<Mistral />
|
|
49
|
+
<Moonshot />
|
|
50
|
+
<Zhipu />
|
|
51
|
+
<ZeroOne />
|
|
52
|
+
<Footer />
|
|
53
|
+
</Flexbox>
|
|
54
|
+
);
|
|
55
|
+
};
|
|
56
|
+
|
|
57
|
+
Page.displayName = 'LlmSetting';
|
|
58
|
+
|
|
59
|
+
export default Page;
|
|
@@ -1,19 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { isMobileDevice } from '@/utils/responsive';
|
|
3
|
-
|
|
4
|
-
import DesktopPage from './(desktop)';
|
|
5
|
-
import MobilePage from './(mobile)';
|
|
1
|
+
import { redirect } from 'next/navigation';
|
|
6
2
|
|
|
7
3
|
const Page = () => {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
if (mobile) return <MobilePage />;
|
|
11
|
-
|
|
12
|
-
const { SHOW_ACCESS_CODE_CONFIG, ENABLE_OAUTH_SSO } = getServerConfig();
|
|
13
|
-
|
|
14
|
-
return (
|
|
15
|
-
<DesktopPage showAccessCodeConfig={SHOW_ACCESS_CODE_CONFIG} showOAuthLogin={ENABLE_OAUTH_SSO} />
|
|
16
|
-
);
|
|
4
|
+
return redirect('/settings/common');
|
|
17
5
|
};
|
|
18
6
|
|
|
19
7
|
export default Page;
|
|
@@ -5,18 +5,18 @@ import { Center, Flexbox } from 'react-layout-kit';
|
|
|
5
5
|
const useStyles = createStyles(({ css, token, responsive }) => ({
|
|
6
6
|
container: css`
|
|
7
7
|
background: ${token.colorFillTertiary};
|
|
8
|
-
border-radius:
|
|
8
|
+
border-radius: ${token.borderRadius}px;
|
|
9
9
|
|
|
10
10
|
.${responsive.mobile} {
|
|
11
11
|
width: 100%;
|
|
12
12
|
}
|
|
13
13
|
`,
|
|
14
14
|
icon: css`
|
|
15
|
-
width:
|
|
16
|
-
height:
|
|
15
|
+
width: 24px;
|
|
16
|
+
height: 24px;
|
|
17
17
|
`,
|
|
18
18
|
title: css`
|
|
19
|
-
font-size:
|
|
19
|
+
font-size: 16px;
|
|
20
20
|
`,
|
|
21
21
|
}));
|
|
22
22
|
|
|
@@ -27,13 +27,14 @@ const Card = memo<{ icon: ReactNode; title: string }>(({ title, icon }) => {
|
|
|
27
27
|
<Flexbox
|
|
28
28
|
align={'center'}
|
|
29
29
|
className={styles.container}
|
|
30
|
+
flex={1}
|
|
30
31
|
gap={12}
|
|
31
32
|
horizontal
|
|
32
33
|
paddingBlock={12}
|
|
33
34
|
paddingInline={20}
|
|
34
35
|
>
|
|
35
36
|
<Center className={styles.icon}>{icon}</Center>
|
|
36
|
-
<
|
|
37
|
+
<div className={styles.title}>{title}</div>
|
|
37
38
|
</Flexbox>
|
|
38
39
|
);
|
|
39
40
|
});
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
3
|
+
import { EditableText } from '@lobehub/ui';
|
|
4
|
+
import { Typography } from 'antd';
|
|
5
|
+
import { memo, useState } from 'react';
|
|
6
|
+
import { useTranslation } from 'react-i18next';
|
|
7
|
+
import { Flexbox } from 'react-layout-kit';
|
|
8
|
+
|
|
9
|
+
import { useUserStore } from '@/store/user';
|
|
10
|
+
import { syncSettingsSelectors } from '@/store/user/selectors';
|
|
11
|
+
|
|
12
|
+
const DeviceName = memo(() => {
|
|
13
|
+
const { t } = useTranslation('setting');
|
|
14
|
+
|
|
15
|
+
const [deviceName, setSettings] = useUserStore((s) => [
|
|
16
|
+
syncSettingsSelectors.deviceName(s),
|
|
17
|
+
s.setSettings,
|
|
18
|
+
]);
|
|
19
|
+
|
|
20
|
+
const [editing, setEditing] = useState(false);
|
|
21
|
+
|
|
22
|
+
const updateDeviceName = (deviceName: string) => {
|
|
23
|
+
setSettings({ sync: { deviceName } });
|
|
24
|
+
setEditing(false);
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
return (
|
|
28
|
+
<Flexbox
|
|
29
|
+
align={'center'}
|
|
30
|
+
flex={1}
|
|
31
|
+
height={40}
|
|
32
|
+
horizontal
|
|
33
|
+
style={{ fontSize: 20, fontWeight: 'bold', lineHeight: 1, minWidth: 240, paddingLeft: 8 }}
|
|
34
|
+
>
|
|
35
|
+
{!deviceName && !editing && (
|
|
36
|
+
<Flexbox
|
|
37
|
+
onClick={() => {
|
|
38
|
+
setEditing(true);
|
|
39
|
+
}}
|
|
40
|
+
style={{ cursor: 'pointer' }}
|
|
41
|
+
>
|
|
42
|
+
<Typography.Text type={'secondary'}>{t('sync.device.deviceName.hint')}</Typography.Text>
|
|
43
|
+
</Flexbox>
|
|
44
|
+
)}
|
|
45
|
+
<EditableText
|
|
46
|
+
editing={editing}
|
|
47
|
+
onBlur={(e) => {
|
|
48
|
+
updateDeviceName(e.target.value);
|
|
49
|
+
}}
|
|
50
|
+
onChange={(e) => {
|
|
51
|
+
updateDeviceName(e);
|
|
52
|
+
}}
|
|
53
|
+
onEditingChange={setEditing}
|
|
54
|
+
placeholder={t('sync.device.deviceName.placeholder')}
|
|
55
|
+
size={'large'}
|
|
56
|
+
type={'block'}
|
|
57
|
+
value={deviceName}
|
|
58
|
+
/>
|
|
59
|
+
</Flexbox>
|
|
60
|
+
);
|
|
61
|
+
});
|
|
62
|
+
|
|
63
|
+
export default DeviceName;
|
|
@@ -8,28 +8,20 @@ import {
|
|
|
8
8
|
} from '@icons-pack/react-simple-icons';
|
|
9
9
|
import { memo } from 'react';
|
|
10
10
|
|
|
11
|
-
// TODO: 等 simple icons 修复类型,移除 ignore
|
|
12
|
-
|
|
13
11
|
const SystemIcon = memo<{ title?: string }>(({ title }) => {
|
|
14
12
|
if (!title) return;
|
|
15
13
|
|
|
16
|
-
|
|
17
|
-
if (['Mac OS', 'iOS', 'iPadOS'].includes(title)) return <SiApple size={32} />;
|
|
14
|
+
if (['Mac OS', 'iOS', 'iPadOS'].includes(title)) return <SiApple size={24} />;
|
|
18
15
|
|
|
19
|
-
|
|
20
|
-
if (['Windows'].includes(title)) return <SiWindows11 size={32} />;
|
|
16
|
+
if (['Windows'].includes(title)) return <SiWindows11 size={24} />;
|
|
21
17
|
|
|
22
|
-
|
|
23
|
-
if (title === 'Android') return <SiAndroid size={32} />;
|
|
18
|
+
if (title === 'Android') return <SiAndroid size={24} />;
|
|
24
19
|
|
|
25
|
-
|
|
26
|
-
if (['BlackBerry'].includes(title)) return <SiBlackberry size={32} />;
|
|
20
|
+
if (['BlackBerry'].includes(title)) return <SiBlackberry size={24} />;
|
|
27
21
|
|
|
28
|
-
|
|
29
|
-
if (title === 'Linux') return <SiLinux size={32} />;
|
|
22
|
+
if (title === 'Linux') return <SiLinux size={24} />;
|
|
30
23
|
|
|
31
|
-
|
|
32
|
-
if (title === 'Chrome OS') return <SiGooglechrome size={32} />;
|
|
24
|
+
if (title === 'Chrome OS') return <SiGooglechrome size={24} />;
|
|
33
25
|
|
|
34
26
|
return null;
|
|
35
27
|
});
|