@lobehub/chat 0.152.4 → 0.152.6
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 +10 -35
- package/README.md +8 -8
- package/README.zh-CN.md +8 -8
- package/locales/ar/common.json +0 -14
- package/locales/ar/setting.json +1 -4
- package/locales/bg-BG/common.json +0 -14
- package/locales/bg-BG/setting.json +1 -4
- package/locales/de-DE/common.json +0 -14
- package/locales/de-DE/setting.json +1 -4
- package/locales/en-US/common.json +0 -14
- package/locales/en-US/setting.json +1 -4
- package/locales/es-ES/common.json +0 -14
- package/locales/es-ES/setting.json +1 -4
- package/locales/fr-FR/common.json +0 -14
- package/locales/fr-FR/setting.json +1 -4
- package/locales/it-IT/common.json +0 -14
- package/locales/it-IT/setting.json +1 -4
- package/locales/ja-JP/common.json +0 -14
- package/locales/ja-JP/setting.json +1 -4
- package/locales/ko-KR/common.json +0 -14
- package/locales/ko-KR/setting.json +1 -4
- package/locales/nl-NL/common.json +0 -14
- package/locales/nl-NL/setting.json +1 -4
- package/locales/pl-PL/common.json +0 -14
- package/locales/pl-PL/setting.json +1 -4
- package/locales/pt-BR/common.json +0 -14
- package/locales/pt-BR/setting.json +1 -4
- package/locales/ru-RU/common.json +0 -14
- package/locales/ru-RU/setting.json +1 -4
- package/locales/tr-TR/common.json +0 -14
- package/locales/tr-TR/setting.json +1 -4
- package/locales/vi-VN/common.json +0 -14
- package/locales/vi-VN/setting.json +1 -4
- package/locales/zh-CN/common.json +0 -14
- package/locales/zh-CN/setting.json +1 -4
- package/locales/zh-TW/common.json +0 -14
- package/locales/zh-TW/setting.json +1 -4
- package/package.json +1 -1
- package/src/app/(main)/@nav/_layout/Desktop/Avatar.tsx +11 -0
- package/src/app/(main)/@nav/_layout/Desktop/BottomActions.tsx +120 -7
- package/src/app/(main)/@nav/_layout/Desktop/index.tsx +2 -7
- 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 +8 -6
- package/src/app/(main)/chat/_layout/Mobile/index.tsx +3 -5
- package/src/app/(main)/chat/features/SettingButton.tsx +5 -4
- package/src/app/(main)/chat/layout.ts +2 -5
- package/src/app/(main)/chat/settings/{_layout/Desktop → (desktop)}/Header.tsx +0 -2
- package/src/app/(main)/chat/settings/(desktop)/index.tsx +23 -0
- package/src/app/(main)/chat/settings/{_layout/Mobile → (mobile)}/Header.tsx +2 -3
- package/src/app/(main)/chat/settings/(mobile)/index.tsx +16 -0
- package/src/app/(main)/chat/settings/features/HeaderContent.tsx +9 -15
- package/src/app/(main)/chat/settings/features/SubmitAgentButton/SubmitAgentModal.tsx +0 -2
- package/src/app/(main)/chat/settings/features/SubmitAgentButton/index.tsx +8 -16
- package/src/app/(main)/chat/settings/layout.tsx +2 -9
- package/src/app/(main)/chat/settings/page.tsx +9 -2
- package/src/app/(main)/market/{_layout/Desktop/DetailSidebar.tsx → @detail/_layout/Desktop.tsx} +2 -2
- package/src/app/(main)/market/{_layout/Mobile/DetailModal.tsx → @detail/_layout/Mobile.tsx} +2 -2
- package/src/app/(main)/market/@detail/default.tsx +10 -1
- package/src/app/(main)/market/_layout/Desktop/index.tsx +1 -2
- package/src/app/(main)/market/_layout/Mobile/index.tsx +1 -3
- package/src/app/(main)/settings/(desktop)/index.tsx +23 -0
- package/src/app/(main)/settings/(mobile)/features/AvatarBanner.tsx +68 -0
- package/src/app/(main)/settings/(mobile)/features/ExtraList.tsx +65 -0
- package/src/app/(main)/settings/(mobile)/index.tsx +53 -0
- package/src/app/(main)/settings/_layout/Desktop/Header.tsx +23 -78
- package/src/app/(main)/settings/_layout/Desktop/SideBar.tsx +27 -39
- package/src/app/(main)/settings/_layout/Desktop/index.tsx +17 -41
- package/src/app/(main)/settings/_layout/Mobile/{Header.tsx → SubSettingHeader.tsx} +1 -3
- package/src/app/(main)/settings/_layout/Mobile/index.tsx +18 -7
- package/src/app/(main)/settings/about/AboutList.tsx +53 -0
- package/src/app/(main)/settings/about/Analytics.tsx +40 -0
- package/src/app/(main)/settings/about/page.tsx +33 -13
- package/src/app/(main)/settings/about/style.ts +22 -0
- package/src/app/(main)/settings/agent/Agent.tsx +29 -0
- package/src/app/(main)/settings/agent/loading.tsx +3 -0
- package/src/app/(main)/settings/agent/page.tsx +16 -8
- package/src/app/(main)/settings/common/{features/Common.tsx → Common.tsx} +5 -7
- package/src/app/(main)/settings/common/{features/Theme/index.tsx → Theme.tsx} +6 -8
- package/src/app/(main)/settings/common/index.tsx +16 -11
- package/src/app/(main)/settings/common/loading.tsx +3 -0
- package/src/app/(main)/settings/common/page.tsx +7 -8
- package/src/app/(main)/settings/features/Footer.tsx +0 -2
- package/src/app/(main)/settings/features/SettingList/index.tsx +47 -0
- package/src/app/(main)/settings/features/UpgradeAlert.tsx +13 -21
- package/src/app/(main)/settings/hooks/useSyncSettings.ts +2 -2
- package/src/app/(main)/settings/layout.ts +1 -4
- package/src/app/(main)/settings/llm/Anthropic/index.tsx +10 -4
- package/src/app/(main)/settings/llm/Azure/index.tsx +1 -3
- package/src/app/(main)/settings/llm/Bedrock/index.tsx +1 -3
- package/src/app/(main)/settings/llm/Google/index.tsx +2 -4
- package/src/app/(main)/settings/llm/Groq/index.tsx +1 -3
- package/src/app/(main)/settings/llm/Minimax/index.tsx +9 -3
- package/src/app/(main)/settings/llm/Mistral/index.tsx +9 -3
- package/src/app/(main)/settings/llm/Moonshot/index.tsx +1 -3
- package/src/app/(main)/settings/llm/Ollama/index.tsx +1 -3
- package/src/app/(main)/settings/llm/OpenAI/index.tsx +0 -2
- package/src/app/(main)/settings/llm/OpenRouter/index.tsx +9 -3
- package/src/app/(main)/settings/llm/Perplexity/index.tsx +9 -3
- package/src/app/(main)/settings/llm/TogetherAI/index.tsx +9 -3
- package/src/app/(main)/settings/llm/ZeroOne/index.tsx +9 -3
- package/src/app/(main)/settings/llm/Zhipu/index.tsx +10 -3
- package/src/app/(main)/settings/llm/components/Checker.tsx +0 -2
- package/src/app/(main)/settings/llm/components/ProviderConfig/index.tsx +1 -16
- package/src/app/(main)/settings/llm/index.tsx +24 -12
- package/src/app/(main)/settings/llm/layout.tsx +11 -0
- package/src/app/(main)/settings/llm/loading.tsx +3 -0
- package/src/app/(main)/settings/llm/page.tsx +0 -15
- package/src/app/(main)/settings/page.tsx +14 -2
- package/src/app/(main)/settings/sync/{features/DeviceInfo → DeviceInfo}/Card.tsx +5 -6
- package/src/app/(main)/settings/sync/DeviceInfo/DeviceName.tsx +66 -0
- package/src/app/(main)/settings/sync/{features/DeviceInfo → DeviceInfo}/index.tsx +36 -22
- package/src/app/(main)/settings/sync/PageTitle.tsx +11 -0
- package/src/app/(main)/settings/sync/{features/WebRTC → WebRTC}/ChannelNameInput.tsx +3 -3
- package/src/app/(main)/settings/sync/{features/WebRTC → WebRTC}/index.tsx +9 -10
- package/src/app/(main)/settings/sync/{features/DeviceInfo → components}/SystemIcon.tsx +14 -6
- package/src/app/(main)/settings/sync/layout.tsx +12 -0
- package/src/app/(main)/settings/sync/loading.tsx +3 -0
- package/src/app/(main)/settings/sync/page.tsx +15 -11
- package/src/app/(main)/settings/tts/{features/STT.tsx → TTS/index.tsx} +27 -11
- package/src/app/(main)/settings/tts/loading.tsx +3 -0
- package/src/app/(main)/settings/tts/page.tsx +16 -8
- package/src/app/layout.tsx +3 -11
- package/src/const/url.ts +0 -1
- package/src/features/AgentSetting/AgentConfig/index.tsx +202 -0
- package/src/features/AgentSetting/AgentConfig/useSyncConfig.ts +23 -0
- package/src/features/AgentSetting/AgentMeta/index.tsx +3 -4
- package/src/features/AgentSetting/AgentPlugin/index.tsx +66 -65
- package/src/features/AgentSetting/AgentPrompt/index.tsx +47 -101
- package/src/features/AgentSetting/AgentTTS/index.tsx +0 -4
- package/src/features/AgentSetting/StoreUpdater.tsx +0 -2
- package/src/features/AgentSetting/index.tsx +6 -6
- package/src/features/AgentSetting/store/index.ts +0 -2
- package/src/features/AvatarWithUpload/index.tsx +0 -2
- package/src/features/Conversation/components/ChatItem/HistoryDivider.tsx +1 -1
- package/src/locales/default/common.ts +0 -14
- package/src/locales/default/setting.ts +0 -3
- package/src/store/global/initialState.ts +0 -1
- package/src/app/(main)/(mobile)/me/features/AvatarBanner.tsx +0 -52
- package/src/app/(main)/(mobile)/me/features/Cate.tsx +0 -35
- package/src/app/(main)/(mobile)/me/features/ExtraCate.tsx +0 -26
- package/src/app/(main)/(mobile)/me/features/useExtraCate.tsx +0 -68
- package/src/app/(main)/(mobile)/me/layout.tsx +0 -11
- package/src/app/(main)/(mobile)/me/loading.tsx +0 -17
- package/src/app/(main)/(mobile)/me/page.tsx +0 -31
- package/src/app/(main)/@nav/features/UserAvatar.tsx +0 -24
- package/src/app/(main)/@nav/features/UserPanel/LangButton.tsx +0 -55
- package/src/app/(main)/@nav/features/UserPanel/Popover.tsx +0 -34
- package/src/app/(main)/@nav/features/UserPanel/ThemeButton.tsx +0 -70
- package/src/app/(main)/@nav/features/UserPanel/UserInfo.tsx +0 -35
- package/src/app/(main)/@nav/features/UserPanel/index.tsx +0 -69
- package/src/app/(main)/@nav/features/UserPanel/useMenu.tsx +0 -142
- package/src/app/(main)/@nav/features/UserPanel/useNewVersion.tsx +0 -12
- package/src/app/(main)/chat/_layout/type.ts +0 -5
- package/src/app/(main)/chat/settings/_layout/Desktop/index.tsx +0 -32
- package/src/app/(main)/chat/settings/_layout/Mobile/index.tsx +0 -15
- package/src/app/(main)/chat/settings/error.tsx +0 -5
- package/src/app/(main)/chat/settings/loading.tsx +0 -3
- package/src/app/(main)/chat/settings/m/page.tsx +0 -15
- package/src/app/(main)/chat/settings/not-found.tsx +0 -3
- package/src/app/(main)/market/@detail/loading.tsx +0 -1
- package/src/app/(main)/settings/@category/default.tsx +0 -16
- package/src/app/(main)/settings/@category/features/CategoryContent.tsx +0 -37
- package/src/app/(main)/settings/@category/features/UpgradeAlert.tsx +0 -38
- package/src/app/(main)/settings/_layout/type.ts +0 -6
- package/src/app/(main)/settings/about/features/AboutList.tsx +0 -122
- package/src/app/(main)/settings/about/features/Analytics.tsx +0 -42
- package/src/app/(main)/settings/about/index.tsx +0 -35
- package/src/app/(main)/settings/agent/index.tsx +0 -48
- package/src/app/(main)/settings/error.tsx +0 -5
- package/src/app/(main)/settings/hooks/useCategory.tsx +0 -54
- package/src/app/(main)/settings/llm/components/Footer.tsx +0 -26
- package/src/app/(main)/settings/loading.tsx +0 -9
- package/src/app/(main)/settings/m/page.tsx +0 -19
- package/src/app/(main)/settings/not-found.tsx +0 -3
- package/src/app/(main)/settings/sync/features/DeviceInfo/DeviceName.tsx +0 -63
- package/src/app/(main)/settings/sync/index.tsx +0 -17
- package/src/app/(main)/settings/tts/features/OpenAI.tsx +0 -54
- package/src/app/(main)/settings/tts/index.tsx +0 -15
- package/src/app/@modal/(.)settings/m/index.tsx +0 -34
- package/src/app/@modal/(.)settings/m/layout.tsx +0 -28
- package/src/app/@modal/(.)settings/m/loading.tsx +0 -5
- package/src/app/@modal/(.)settings/m/page.tsx +0 -10
- package/src/app/@modal/_layout/Desktop.tsx +0 -32
- package/src/app/@modal/_layout/Mobile.tsx +0 -1
- package/src/app/@modal/_layout/SettingModalLayout.tsx +0 -59
- package/src/app/@modal/chat/(.)settings/m/features/CategoryContent.tsx +0 -36
- package/src/app/@modal/chat/(.)settings/m/features/useCategory.tsx +0 -62
- package/src/app/@modal/chat/(.)settings/m/layout.tsx +0 -55
- package/src/app/@modal/chat/(.)settings/m/loading.tsx +0 -5
- package/src/app/@modal/chat/(.)settings/m/page.tsx +0 -34
- package/src/app/@modal/default.tsx +0 -1
- package/src/app/@modal/layout.tsx +0 -30
- package/src/app/@modal/loading.tsx +0 -5
- package/src/components/BrandWatermark/index.tsx +0 -39
- package/src/components/Cell/Divider.tsx +0 -19
- package/src/components/Cell/index.tsx +0 -38
- package/src/components/Menu/index.tsx +0 -97
- package/src/components/SkeletonLoading/index.tsx +0 -21
- package/src/features/AgentSetting/AgentChat/index.tsx +0 -135
- package/src/features/AgentSetting/AgentModal/index.tsx +0 -95
- package/src/hooks/useQuery.ts +0 -7
- package/src/hooks/useQueryRoute.ts +0 -16
- package/src/server/redirectHard.ts +0 -9
- /package/src/app/(main)/settings/{about/features → features/SettingList}/Item.tsx +0 -0
- /package/src/app/(main)/settings/{common/features/Theme → features}/ThemeSwatches/ThemeSwatchesNeutral.tsx +0 -0
- /package/src/app/(main)/settings/{common/features/Theme → features}/ThemeSwatches/ThemeSwatchesPrimary.tsx +0 -0
- /package/src/app/(main)/settings/{common/features/Theme → features}/ThemeSwatches/index.ts +0 -0
- /package/src/app/(main)/settings/sync/{features/Alert.tsx → Alert.tsx} +0 -0
- /package/src/app/(main)/settings/sync/{features/WebRTC → components}/SyncSwitch/index.css +0 -0
- /package/src/app/(main)/settings/sync/{features/WebRTC → components}/SyncSwitch/index.tsx +0 -0
- /package/src/app/(main)/settings/sync/{features/WebRTC/generateRandomRoomName.ts → util.ts} +0 -0
- /package/src/app/(main)/settings/tts/{features/const.ts → TTS/options.ts} +0 -0
- /package/src/features/AgentSetting/{AgentModal → AgentConfig}/ModelSelect.tsx +0 -0
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
'use client';
|
|
2
|
-
|
|
3
1
|
import { Minimax } from '@lobehub/icons';
|
|
2
|
+
import { useTheme } from 'antd-style';
|
|
4
3
|
import { memo } from 'react';
|
|
5
4
|
|
|
6
5
|
import { ModelProvider } from '@/libs/agent-runtime';
|
|
@@ -8,11 +7,18 @@ import { ModelProvider } from '@/libs/agent-runtime';
|
|
|
8
7
|
import ProviderConfig from '../components/ProviderConfig';
|
|
9
8
|
|
|
10
9
|
const MinimaxProvider = memo(() => {
|
|
10
|
+
const theme = useTheme();
|
|
11
|
+
|
|
11
12
|
return (
|
|
12
13
|
<ProviderConfig
|
|
13
14
|
checkModel={'abab5.5s-chat'}
|
|
14
15
|
provider={ModelProvider.Minimax}
|
|
15
|
-
title={
|
|
16
|
+
title={
|
|
17
|
+
<Minimax.Combine
|
|
18
|
+
color={theme.isDarkMode ? theme.colorText : Minimax.colorPrimary}
|
|
19
|
+
size={32}
|
|
20
|
+
/>
|
|
21
|
+
}
|
|
16
22
|
/>
|
|
17
23
|
);
|
|
18
24
|
});
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
'use client';
|
|
2
|
-
|
|
3
1
|
import { Mistral } from '@lobehub/icons';
|
|
2
|
+
import { useTheme } from 'antd-style';
|
|
4
3
|
import { memo } from 'react';
|
|
5
4
|
|
|
6
5
|
import { ModelProvider } from '@/libs/agent-runtime';
|
|
@@ -8,11 +7,18 @@ import { ModelProvider } from '@/libs/agent-runtime';
|
|
|
8
7
|
import ProviderConfig from '../components/ProviderConfig';
|
|
9
8
|
|
|
10
9
|
const MistralProvider = memo(() => {
|
|
10
|
+
const theme = useTheme();
|
|
11
|
+
|
|
11
12
|
return (
|
|
12
13
|
<ProviderConfig
|
|
13
14
|
checkModel={'open-mistral-7b'}
|
|
14
15
|
provider={ModelProvider.Mistral}
|
|
15
|
-
title={
|
|
16
|
+
title={
|
|
17
|
+
<Mistral.Combine
|
|
18
|
+
color={theme.isDarkMode ? theme.colorText : Mistral.colorPrimary}
|
|
19
|
+
size={24}
|
|
20
|
+
/>
|
|
21
|
+
}
|
|
16
22
|
/>
|
|
17
23
|
);
|
|
18
24
|
});
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
'use client';
|
|
2
|
-
|
|
3
1
|
import { Moonshot } from '@lobehub/icons';
|
|
4
2
|
import { useTheme } from 'antd-style';
|
|
5
3
|
import { memo } from 'react';
|
|
@@ -18,7 +16,7 @@ const MoonshotProvider = memo(() => {
|
|
|
18
16
|
title={
|
|
19
17
|
<Moonshot.Combine
|
|
20
18
|
color={theme.isDarkMode ? theme.colorText : Moonshot.colorPrimary}
|
|
21
|
-
size={
|
|
19
|
+
size={24}
|
|
22
20
|
/>
|
|
23
21
|
}
|
|
24
22
|
/>
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
'use client';
|
|
2
|
-
|
|
3
1
|
import { Ollama } from '@lobehub/icons';
|
|
4
2
|
import { memo } from 'react';
|
|
5
3
|
import { useTranslation } from 'react-i18next';
|
|
@@ -25,7 +23,7 @@ const OllamaProvider = memo(() => {
|
|
|
25
23
|
showApiKey={false}
|
|
26
24
|
showBrowserRequest
|
|
27
25
|
showEndpoint
|
|
28
|
-
title={<Ollama.Combine size={
|
|
26
|
+
title={<Ollama.Combine size={24} />}
|
|
29
27
|
/>
|
|
30
28
|
);
|
|
31
29
|
});
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
'use client';
|
|
2
|
-
|
|
3
1
|
import { OpenRouter } from '@lobehub/icons';
|
|
2
|
+
import { useTheme } from 'antd-style';
|
|
4
3
|
import { memo } from 'react';
|
|
5
4
|
|
|
6
5
|
import { ModelProvider } from '@/libs/agent-runtime';
|
|
@@ -8,12 +7,19 @@ import { ModelProvider } from '@/libs/agent-runtime';
|
|
|
8
7
|
import ProviderConfig from '../components/ProviderConfig';
|
|
9
8
|
|
|
10
9
|
const OpenRouterProvider = memo(() => {
|
|
10
|
+
const theme = useTheme();
|
|
11
|
+
|
|
11
12
|
return (
|
|
12
13
|
<ProviderConfig
|
|
13
14
|
checkModel={'mistralai/mistral-7b-instruct:free'}
|
|
14
15
|
modelList={{ showModelFetcher: true }}
|
|
15
16
|
provider={ModelProvider.OpenRouter}
|
|
16
|
-
title={
|
|
17
|
+
title={
|
|
18
|
+
<OpenRouter.Combine
|
|
19
|
+
color={theme.isDarkMode ? theme.colorText : OpenRouter.colorPrimary}
|
|
20
|
+
size={24}
|
|
21
|
+
/>
|
|
22
|
+
}
|
|
17
23
|
/>
|
|
18
24
|
);
|
|
19
25
|
});
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
'use client';
|
|
2
|
-
|
|
3
1
|
import { Perplexity } from '@lobehub/icons';
|
|
2
|
+
import { useTheme } from 'antd-style';
|
|
4
3
|
import { memo } from 'react';
|
|
5
4
|
|
|
6
5
|
import { ModelProvider } from '@/libs/agent-runtime';
|
|
@@ -8,11 +7,18 @@ import { ModelProvider } from '@/libs/agent-runtime';
|
|
|
8
7
|
import ProviderConfig from '../components/ProviderConfig';
|
|
9
8
|
|
|
10
9
|
const PerplexityProvider = memo(() => {
|
|
10
|
+
const theme = useTheme();
|
|
11
|
+
|
|
11
12
|
return (
|
|
12
13
|
<ProviderConfig
|
|
13
14
|
checkModel={'pplx-7b-chat'}
|
|
14
15
|
provider={ModelProvider.Perplexity}
|
|
15
|
-
title={
|
|
16
|
+
title={
|
|
17
|
+
<Perplexity.Combine
|
|
18
|
+
color={theme.isDarkMode ? theme.colorText : Perplexity.colorPrimary}
|
|
19
|
+
size={24}
|
|
20
|
+
/>
|
|
21
|
+
}
|
|
16
22
|
/>
|
|
17
23
|
);
|
|
18
24
|
});
|
|
@@ -1,17 +1,23 @@
|
|
|
1
|
-
'use client';
|
|
2
|
-
|
|
3
1
|
import { Together } from '@lobehub/icons';
|
|
2
|
+
import { useTheme } from 'antd-style';
|
|
4
3
|
import { memo } from 'react';
|
|
5
4
|
|
|
6
5
|
import ProviderConfig from '../components/ProviderConfig';
|
|
7
6
|
|
|
8
7
|
const TogetherAIProvider = memo(() => {
|
|
8
|
+
const theme = useTheme();
|
|
9
|
+
|
|
9
10
|
return (
|
|
10
11
|
<ProviderConfig
|
|
11
12
|
checkModel={'togethercomputer/alpaca-7b'}
|
|
12
13
|
modelList={{ showModelFetcher: true }}
|
|
13
14
|
provider={'togetherai'}
|
|
14
|
-
title={
|
|
15
|
+
title={
|
|
16
|
+
<Together.Combine
|
|
17
|
+
color={theme.isDarkMode ? theme.colorText : Together.colorPrimary}
|
|
18
|
+
size={24}
|
|
19
|
+
/>
|
|
20
|
+
}
|
|
15
21
|
/>
|
|
16
22
|
);
|
|
17
23
|
});
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
'use client';
|
|
2
|
-
|
|
3
1
|
import { ZeroOne } from '@lobehub/icons';
|
|
2
|
+
import { useTheme } from 'antd-style';
|
|
4
3
|
import { memo } from 'react';
|
|
5
4
|
|
|
6
5
|
import { ModelProvider } from '@/libs/agent-runtime';
|
|
@@ -8,11 +7,18 @@ import { ModelProvider } from '@/libs/agent-runtime';
|
|
|
8
7
|
import ProviderConfig from '../components/ProviderConfig';
|
|
9
8
|
|
|
10
9
|
const ZeroOneProvider = memo(() => {
|
|
10
|
+
const theme = useTheme();
|
|
11
|
+
|
|
11
12
|
return (
|
|
12
13
|
<ProviderConfig
|
|
13
14
|
checkModel={'yi-34b-chat-0205'}
|
|
14
15
|
provider={ModelProvider.ZeroOne}
|
|
15
|
-
title={
|
|
16
|
+
title={
|
|
17
|
+
<ZeroOne.Combine
|
|
18
|
+
color={theme.isDarkMode ? theme.colorText : ZeroOne.colorPrimary}
|
|
19
|
+
size={32}
|
|
20
|
+
/>
|
|
21
|
+
}
|
|
16
22
|
/>
|
|
17
23
|
);
|
|
18
24
|
});
|
|
@@ -1,16 +1,23 @@
|
|
|
1
|
-
'use client';
|
|
2
|
-
|
|
3
1
|
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
|
+
|
|
9
11
|
return (
|
|
10
12
|
<ProviderConfig
|
|
11
13
|
checkModel={'glm-3-turbo'}
|
|
12
14
|
provider={'zhipu'}
|
|
13
|
-
title={
|
|
15
|
+
title={
|
|
16
|
+
<Zhipu.Combine
|
|
17
|
+
color={theme.isDarkMode ? lighten(0.1, Zhipu.colorPrimary) : Zhipu.colorPrimary}
|
|
18
|
+
size={32}
|
|
19
|
+
/>
|
|
20
|
+
}
|
|
14
21
|
/>
|
|
15
22
|
);
|
|
16
23
|
});
|
|
@@ -1,11 +1,8 @@
|
|
|
1
|
-
'use client';
|
|
2
|
-
|
|
3
1
|
import { Form, type FormItemProps, type ItemGroup } from '@lobehub/ui';
|
|
4
2
|
import { Form as AntForm, Input, Switch } from 'antd';
|
|
5
3
|
import { debounce } from 'lodash-es';
|
|
6
4
|
import { ReactNode, memo } from 'react';
|
|
7
5
|
import { useTranslation } from 'react-i18next';
|
|
8
|
-
import { Flexbox } from 'react-layout-kit';
|
|
9
6
|
|
|
10
7
|
import { useSyncSettings } from '@/app/(main)/settings/hooks/useSyncSettings';
|
|
11
8
|
import {
|
|
@@ -145,19 +142,7 @@ const ProviderConfig = memo<ProviderConfigProps>(
|
|
|
145
142
|
value={enabled}
|
|
146
143
|
/>
|
|
147
144
|
) : undefined,
|
|
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
|
-
),
|
|
145
|
+
title,
|
|
161
146
|
};
|
|
162
147
|
|
|
163
148
|
return (
|
|
@@ -1,7 +1,13 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
|
|
3
|
-
import
|
|
3
|
+
import Link from 'next/link';
|
|
4
|
+
import { memo } from 'react';
|
|
5
|
+
import { Trans, useTranslation } from 'react-i18next';
|
|
4
6
|
|
|
7
|
+
import PageTitle from '@/components/PageTitle';
|
|
8
|
+
import { MORE_MODEL_PROVIDER_REQUEST_URL } from '@/const/url';
|
|
9
|
+
|
|
10
|
+
import Footer from '../features/Footer';
|
|
5
11
|
import Anthropic from './Anthropic';
|
|
6
12
|
import Azure from './Azure';
|
|
7
13
|
import Bedrock from './Bedrock';
|
|
@@ -17,14 +23,16 @@ import Perplexity from './Perplexity';
|
|
|
17
23
|
import TogetherAI from './TogetherAI';
|
|
18
24
|
import ZeroOne from './ZeroOne';
|
|
19
25
|
import Zhipu from './Zhipu';
|
|
20
|
-
import Footer from './components/Footer';
|
|
21
26
|
|
|
22
|
-
|
|
27
|
+
export default memo(() => {
|
|
28
|
+
const { t } = useTranslation('setting');
|
|
29
|
+
|
|
23
30
|
return (
|
|
24
|
-
|
|
31
|
+
<>
|
|
32
|
+
<PageTitle title={t('tab.llm')} />
|
|
25
33
|
<OpenAI />
|
|
26
|
-
<Azure />
|
|
27
34
|
<Ollama />
|
|
35
|
+
<Azure />
|
|
28
36
|
<Google />
|
|
29
37
|
<Anthropic />
|
|
30
38
|
<Bedrock />
|
|
@@ -37,11 +45,15 @@ const Page = () => {
|
|
|
37
45
|
<Moonshot />
|
|
38
46
|
<Zhipu />
|
|
39
47
|
<ZeroOne />
|
|
40
|
-
<Footer
|
|
41
|
-
|
|
48
|
+
<Footer>
|
|
49
|
+
<Trans i18nKey="llm.waitingForMore" ns={'setting'}>
|
|
50
|
+
更多模型正在
|
|
51
|
+
<Link aria-label={'todo'} href={MORE_MODEL_PROVIDER_REQUEST_URL} target="_blank">
|
|
52
|
+
计划接入
|
|
53
|
+
</Link>
|
|
54
|
+
中 ,敬请期待 ✨
|
|
55
|
+
</Trans>
|
|
56
|
+
</Footer>
|
|
57
|
+
</>
|
|
42
58
|
);
|
|
43
|
-
};
|
|
44
|
-
|
|
45
|
-
Page.displayName = 'LlmSetting';
|
|
46
|
-
|
|
47
|
-
export default Page;
|
|
59
|
+
});
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { notFound } from 'next/navigation';
|
|
2
|
+
import { PropsWithChildren } from 'react';
|
|
3
|
+
|
|
4
|
+
import { serverFeatureFlags } from '@/config/server/featureFlags';
|
|
5
|
+
|
|
6
|
+
export default ({ children }: PropsWithChildren) => {
|
|
7
|
+
const showLLM = serverFeatureFlags().showLLM;
|
|
8
|
+
if (!showLLM) return notFound();
|
|
9
|
+
|
|
10
|
+
return children;
|
|
11
|
+
};
|
|
@@ -1,20 +1,5 @@
|
|
|
1
|
-
import { notFound } from 'next/navigation';
|
|
2
|
-
|
|
3
|
-
import { serverFeatureFlags } from '@/config/server/featureFlags';
|
|
4
|
-
import { translation } from '@/server/translation';
|
|
5
|
-
|
|
6
1
|
import Page from './index';
|
|
7
2
|
|
|
8
|
-
export const generateMetadata = async () => {
|
|
9
|
-
const { t } = await translation('setting');
|
|
10
|
-
return {
|
|
11
|
-
title: t('tab.llm'),
|
|
12
|
-
};
|
|
13
|
-
};
|
|
14
|
-
|
|
15
3
|
export default () => {
|
|
16
|
-
const showLLM = serverFeatureFlags().showLLM;
|
|
17
|
-
if (!showLLM) return notFound();
|
|
18
|
-
|
|
19
4
|
return <Page />;
|
|
20
5
|
};
|
|
@@ -1,7 +1,19 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { getServerConfig } from '@/config/server';
|
|
2
|
+
import { isMobileDevice } from '@/utils/responsive';
|
|
3
|
+
|
|
4
|
+
import DesktopPage from './(desktop)';
|
|
5
|
+
import MobilePage from './(mobile)';
|
|
2
6
|
|
|
3
7
|
const Page = () => {
|
|
4
|
-
|
|
8
|
+
const mobile = isMobileDevice();
|
|
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
|
+
);
|
|
5
17
|
};
|
|
6
18
|
|
|
7
19
|
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: 12px;
|
|
9
9
|
|
|
10
10
|
.${responsive.mobile} {
|
|
11
11
|
width: 100%;
|
|
12
12
|
}
|
|
13
13
|
`,
|
|
14
14
|
icon: css`
|
|
15
|
-
width:
|
|
16
|
-
height:
|
|
15
|
+
width: 40px;
|
|
16
|
+
height: 40px;
|
|
17
17
|
`,
|
|
18
18
|
title: css`
|
|
19
|
-
font-size:
|
|
19
|
+
font-size: 20px;
|
|
20
20
|
`,
|
|
21
21
|
}));
|
|
22
22
|
|
|
@@ -27,14 +27,13 @@ const Card = memo<{ icon: ReactNode; title: string }>(({ title, icon }) => {
|
|
|
27
27
|
<Flexbox
|
|
28
28
|
align={'center'}
|
|
29
29
|
className={styles.container}
|
|
30
|
-
flex={1}
|
|
31
30
|
gap={12}
|
|
32
31
|
horizontal
|
|
33
32
|
paddingBlock={12}
|
|
34
33
|
paddingInline={20}
|
|
35
34
|
>
|
|
36
35
|
<Center className={styles.icon}>{icon}</Center>
|
|
37
|
-
<
|
|
36
|
+
<Flexbox className={styles.title}>{title}</Flexbox>
|
|
38
37
|
</Flexbox>
|
|
39
38
|
);
|
|
40
39
|
});
|
|
@@ -0,0 +1,66 @@
|
|
|
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 gap={4}>
|
|
29
|
+
<Flexbox
|
|
30
|
+
align={'center'}
|
|
31
|
+
height={40}
|
|
32
|
+
horizontal
|
|
33
|
+
style={{ fontSize: 20, fontWeight: 'bold' }}
|
|
34
|
+
width={'100%'}
|
|
35
|
+
>
|
|
36
|
+
{!deviceName && !editing && (
|
|
37
|
+
<Flexbox
|
|
38
|
+
onClick={() => {
|
|
39
|
+
setEditing(true);
|
|
40
|
+
}}
|
|
41
|
+
style={{ cursor: 'pointer' }}
|
|
42
|
+
>
|
|
43
|
+
<Typography.Text type={'secondary'}>{t('sync.device.deviceName.hint')}</Typography.Text>
|
|
44
|
+
</Flexbox>
|
|
45
|
+
)}
|
|
46
|
+
<EditableText
|
|
47
|
+
editing={editing}
|
|
48
|
+
onBlur={(e) => {
|
|
49
|
+
updateDeviceName(e.target.value);
|
|
50
|
+
}}
|
|
51
|
+
onChange={(e) => {
|
|
52
|
+
updateDeviceName(e);
|
|
53
|
+
}}
|
|
54
|
+
onEditingChange={setEditing}
|
|
55
|
+
placeholder={t('sync.device.deviceName.placeholder')}
|
|
56
|
+
size={'large'}
|
|
57
|
+
style={{ maxWidth: 200 }}
|
|
58
|
+
type={'block'}
|
|
59
|
+
value={deviceName}
|
|
60
|
+
/>
|
|
61
|
+
</Flexbox>
|
|
62
|
+
</Flexbox>
|
|
63
|
+
);
|
|
64
|
+
});
|
|
65
|
+
|
|
66
|
+
export default DeviceName;
|
|
@@ -10,22 +10,47 @@ import { Flexbox } from 'react-layout-kit';
|
|
|
10
10
|
import { BrowserIcon } from '@/components/BrowserIcon';
|
|
11
11
|
import { MAX_WIDTH } from '@/const/layoutTokens';
|
|
12
12
|
|
|
13
|
+
import SystemIcon from '../components/SystemIcon';
|
|
13
14
|
import Card from './Card';
|
|
14
15
|
import DeviceName from './DeviceName';
|
|
15
|
-
import SystemIcon from './SystemIcon';
|
|
16
16
|
|
|
17
17
|
const useStyles = createStyles(({ css, cx, responsive, isDarkMode, token, stylish }) => ({
|
|
18
|
+
cards: css`
|
|
19
|
+
flex-direction: row;
|
|
20
|
+
${responsive.mobile} {
|
|
21
|
+
flex-direction: column;
|
|
22
|
+
width: 100%;
|
|
23
|
+
}
|
|
24
|
+
`,
|
|
18
25
|
container: css`
|
|
19
26
|
position: relative;
|
|
20
27
|
width: 100%;
|
|
21
28
|
border-radius: ${token.borderRadiusLG}px;
|
|
22
29
|
`,
|
|
23
|
-
content:
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
30
|
+
content: cx(
|
|
31
|
+
stylish.blurStrong,
|
|
32
|
+
css`
|
|
33
|
+
z-index: 2;
|
|
34
|
+
|
|
35
|
+
flex-direction: row;
|
|
36
|
+
justify-content: space-between;
|
|
37
|
+
|
|
38
|
+
height: 88px;
|
|
39
|
+
padding: 12px;
|
|
40
|
+
|
|
41
|
+
background: ${rgba(token.colorBgContainer, isDarkMode ? 0.7 : 1)};
|
|
42
|
+
border-radius: ${token.borderRadiusLG - 1}px;
|
|
43
|
+
|
|
44
|
+
${responsive.mobile} {
|
|
45
|
+
flex-direction: column;
|
|
46
|
+
gap: 16px;
|
|
47
|
+
align-items: flex-start;
|
|
48
|
+
|
|
49
|
+
width: 100%;
|
|
50
|
+
padding: 8px;
|
|
51
|
+
}
|
|
52
|
+
`,
|
|
53
|
+
),
|
|
29
54
|
glow: cx(
|
|
30
55
|
stylish.gradientAnimation,
|
|
31
56
|
css`
|
|
@@ -65,26 +90,15 @@ const DeviceCard = memo<DeviceCardProps>(({ browser, os }) => {
|
|
|
65
90
|
<Flexbox className={styles.container} padding={4}>
|
|
66
91
|
<Flexbox horizontal paddingBlock={8} paddingInline={12}>
|
|
67
92
|
<div>
|
|
68
|
-
<Typography style={{
|
|
69
|
-
{t('sync.device.title')}
|
|
70
|
-
</Typography>
|
|
93
|
+
<Typography style={{ fontWeight: 'bold' }}>{t('sync.device.title')}</Typography>
|
|
71
94
|
</div>
|
|
72
95
|
</Flexbox>
|
|
73
|
-
<Flexbox
|
|
74
|
-
align={'center'}
|
|
75
|
-
className={styles.content}
|
|
76
|
-
flex={1}
|
|
77
|
-
gap={16}
|
|
78
|
-
horizontal
|
|
79
|
-
justify={'space-between'}
|
|
80
|
-
padding={12}
|
|
81
|
-
wrap={'wrap'}
|
|
82
|
-
>
|
|
96
|
+
<Flexbox align={'center'} className={styles.content} flex={1} padding={12}>
|
|
83
97
|
<DeviceName />
|
|
84
|
-
<Flexbox
|
|
98
|
+
<Flexbox className={styles.cards} gap={12}>
|
|
85
99
|
<Card icon={<SystemIcon title={os} />} title={os || t('sync.device.unknownOS')} />
|
|
86
100
|
<Card
|
|
87
|
-
icon={browser && <BrowserIcon browser={browser} size={
|
|
101
|
+
icon={browser && <BrowserIcon browser={browser} size={32} />}
|
|
88
102
|
title={browser || t('sync.device.unknownBrowser')}
|
|
89
103
|
/>
|
|
90
104
|
</Flexbox>
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
3
|
+
import { memo } from 'react';
|
|
4
|
+
import { useTranslation } from 'react-i18next';
|
|
5
|
+
|
|
6
|
+
import PageTitle from '@/components/PageTitle';
|
|
7
|
+
|
|
8
|
+
export default memo(() => {
|
|
9
|
+
const { t } = useTranslation('setting');
|
|
10
|
+
return <PageTitle title={t('tab.sync')} />;
|
|
11
|
+
});
|
|
@@ -5,13 +5,13 @@ import { LucideDices } from 'lucide-react';
|
|
|
5
5
|
import { memo, useState } from 'react';
|
|
6
6
|
import { useTranslation } from 'react-i18next';
|
|
7
7
|
|
|
8
|
-
import { generateRandomRoomName } from '
|
|
8
|
+
import { generateRandomRoomName } from '../util';
|
|
9
9
|
|
|
10
10
|
interface ChannelNameInputProps extends Omit<InputProps, 'form'> {
|
|
11
11
|
form: FormInstance;
|
|
12
12
|
}
|
|
13
13
|
|
|
14
|
-
const ChannelNameInput = memo<ChannelNameInputProps>(({ form, ...
|
|
14
|
+
const ChannelNameInput = memo<ChannelNameInputProps>(({ form, ...res }) => {
|
|
15
15
|
const { t } = useTranslation('setting');
|
|
16
16
|
const [loading, setLoading] = useState(false);
|
|
17
17
|
|
|
@@ -38,7 +38,7 @@ const ChannelNameInput = memo<ChannelNameInputProps>(({ form, ...rest }) => {
|
|
|
38
38
|
title={t('sync.webrtc.channelName.shuffle')}
|
|
39
39
|
/>
|
|
40
40
|
}
|
|
41
|
-
{...
|
|
41
|
+
{...res}
|
|
42
42
|
/>
|
|
43
43
|
);
|
|
44
44
|
});
|