@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.
Files changed (214) hide show
  1. package/CHANGELOG.md +10 -35
  2. package/README.md +8 -8
  3. package/README.zh-CN.md +8 -8
  4. package/locales/ar/common.json +0 -14
  5. package/locales/ar/setting.json +1 -4
  6. package/locales/bg-BG/common.json +0 -14
  7. package/locales/bg-BG/setting.json +1 -4
  8. package/locales/de-DE/common.json +0 -14
  9. package/locales/de-DE/setting.json +1 -4
  10. package/locales/en-US/common.json +0 -14
  11. package/locales/en-US/setting.json +1 -4
  12. package/locales/es-ES/common.json +0 -14
  13. package/locales/es-ES/setting.json +1 -4
  14. package/locales/fr-FR/common.json +0 -14
  15. package/locales/fr-FR/setting.json +1 -4
  16. package/locales/it-IT/common.json +0 -14
  17. package/locales/it-IT/setting.json +1 -4
  18. package/locales/ja-JP/common.json +0 -14
  19. package/locales/ja-JP/setting.json +1 -4
  20. package/locales/ko-KR/common.json +0 -14
  21. package/locales/ko-KR/setting.json +1 -4
  22. package/locales/nl-NL/common.json +0 -14
  23. package/locales/nl-NL/setting.json +1 -4
  24. package/locales/pl-PL/common.json +0 -14
  25. package/locales/pl-PL/setting.json +1 -4
  26. package/locales/pt-BR/common.json +0 -14
  27. package/locales/pt-BR/setting.json +1 -4
  28. package/locales/ru-RU/common.json +0 -14
  29. package/locales/ru-RU/setting.json +1 -4
  30. package/locales/tr-TR/common.json +0 -14
  31. package/locales/tr-TR/setting.json +1 -4
  32. package/locales/vi-VN/common.json +0 -14
  33. package/locales/vi-VN/setting.json +1 -4
  34. package/locales/zh-CN/common.json +0 -14
  35. package/locales/zh-CN/setting.json +1 -4
  36. package/locales/zh-TW/common.json +0 -14
  37. package/locales/zh-TW/setting.json +1 -4
  38. package/package.json +1 -1
  39. package/src/app/(main)/@nav/_layout/Desktop/Avatar.tsx +11 -0
  40. package/src/app/(main)/@nav/_layout/Desktop/BottomActions.tsx +120 -7
  41. package/src/app/(main)/@nav/_layout/Desktop/index.tsx +2 -7
  42. package/src/app/(main)/@nav/_layout/Mobile.tsx +3 -3
  43. package/src/app/(main)/chat/(mobile)/features/SessionHeader.tsx +1 -1
  44. package/src/app/(main)/chat/_layout/Desktop/index.tsx +8 -6
  45. package/src/app/(main)/chat/_layout/Mobile/index.tsx +3 -5
  46. package/src/app/(main)/chat/features/SettingButton.tsx +5 -4
  47. package/src/app/(main)/chat/layout.ts +2 -5
  48. package/src/app/(main)/chat/settings/{_layout/Desktop → (desktop)}/Header.tsx +0 -2
  49. package/src/app/(main)/chat/settings/(desktop)/index.tsx +23 -0
  50. package/src/app/(main)/chat/settings/{_layout/Mobile → (mobile)}/Header.tsx +2 -3
  51. package/src/app/(main)/chat/settings/(mobile)/index.tsx +16 -0
  52. package/src/app/(main)/chat/settings/features/HeaderContent.tsx +9 -15
  53. package/src/app/(main)/chat/settings/features/SubmitAgentButton/SubmitAgentModal.tsx +0 -2
  54. package/src/app/(main)/chat/settings/features/SubmitAgentButton/index.tsx +8 -16
  55. package/src/app/(main)/chat/settings/layout.tsx +2 -9
  56. package/src/app/(main)/chat/settings/page.tsx +9 -2
  57. package/src/app/(main)/market/{_layout/Desktop/DetailSidebar.tsx → @detail/_layout/Desktop.tsx} +2 -2
  58. package/src/app/(main)/market/{_layout/Mobile/DetailModal.tsx → @detail/_layout/Mobile.tsx} +2 -2
  59. package/src/app/(main)/market/@detail/default.tsx +10 -1
  60. package/src/app/(main)/market/_layout/Desktop/index.tsx +1 -2
  61. package/src/app/(main)/market/_layout/Mobile/index.tsx +1 -3
  62. package/src/app/(main)/settings/(desktop)/index.tsx +23 -0
  63. package/src/app/(main)/settings/(mobile)/features/AvatarBanner.tsx +68 -0
  64. package/src/app/(main)/settings/(mobile)/features/ExtraList.tsx +65 -0
  65. package/src/app/(main)/settings/(mobile)/index.tsx +53 -0
  66. package/src/app/(main)/settings/_layout/Desktop/Header.tsx +23 -78
  67. package/src/app/(main)/settings/_layout/Desktop/SideBar.tsx +27 -39
  68. package/src/app/(main)/settings/_layout/Desktop/index.tsx +17 -41
  69. package/src/app/(main)/settings/_layout/Mobile/{Header.tsx → SubSettingHeader.tsx} +1 -3
  70. package/src/app/(main)/settings/_layout/Mobile/index.tsx +18 -7
  71. package/src/app/(main)/settings/about/AboutList.tsx +53 -0
  72. package/src/app/(main)/settings/about/Analytics.tsx +40 -0
  73. package/src/app/(main)/settings/about/page.tsx +33 -13
  74. package/src/app/(main)/settings/about/style.ts +22 -0
  75. package/src/app/(main)/settings/agent/Agent.tsx +29 -0
  76. package/src/app/(main)/settings/agent/loading.tsx +3 -0
  77. package/src/app/(main)/settings/agent/page.tsx +16 -8
  78. package/src/app/(main)/settings/common/{features/Common.tsx → Common.tsx} +5 -7
  79. package/src/app/(main)/settings/common/{features/Theme/index.tsx → Theme.tsx} +6 -8
  80. package/src/app/(main)/settings/common/index.tsx +16 -11
  81. package/src/app/(main)/settings/common/loading.tsx +3 -0
  82. package/src/app/(main)/settings/common/page.tsx +7 -8
  83. package/src/app/(main)/settings/features/Footer.tsx +0 -2
  84. package/src/app/(main)/settings/features/SettingList/index.tsx +47 -0
  85. package/src/app/(main)/settings/features/UpgradeAlert.tsx +13 -21
  86. package/src/app/(main)/settings/hooks/useSyncSettings.ts +2 -2
  87. package/src/app/(main)/settings/layout.ts +1 -4
  88. package/src/app/(main)/settings/llm/Anthropic/index.tsx +10 -4
  89. package/src/app/(main)/settings/llm/Azure/index.tsx +1 -3
  90. package/src/app/(main)/settings/llm/Bedrock/index.tsx +1 -3
  91. package/src/app/(main)/settings/llm/Google/index.tsx +2 -4
  92. package/src/app/(main)/settings/llm/Groq/index.tsx +1 -3
  93. package/src/app/(main)/settings/llm/Minimax/index.tsx +9 -3
  94. package/src/app/(main)/settings/llm/Mistral/index.tsx +9 -3
  95. package/src/app/(main)/settings/llm/Moonshot/index.tsx +1 -3
  96. package/src/app/(main)/settings/llm/Ollama/index.tsx +1 -3
  97. package/src/app/(main)/settings/llm/OpenAI/index.tsx +0 -2
  98. package/src/app/(main)/settings/llm/OpenRouter/index.tsx +9 -3
  99. package/src/app/(main)/settings/llm/Perplexity/index.tsx +9 -3
  100. package/src/app/(main)/settings/llm/TogetherAI/index.tsx +9 -3
  101. package/src/app/(main)/settings/llm/ZeroOne/index.tsx +9 -3
  102. package/src/app/(main)/settings/llm/Zhipu/index.tsx +10 -3
  103. package/src/app/(main)/settings/llm/components/Checker.tsx +0 -2
  104. package/src/app/(main)/settings/llm/components/ProviderConfig/index.tsx +1 -16
  105. package/src/app/(main)/settings/llm/index.tsx +24 -12
  106. package/src/app/(main)/settings/llm/layout.tsx +11 -0
  107. package/src/app/(main)/settings/llm/loading.tsx +3 -0
  108. package/src/app/(main)/settings/llm/page.tsx +0 -15
  109. package/src/app/(main)/settings/page.tsx +14 -2
  110. package/src/app/(main)/settings/sync/{features/DeviceInfo → DeviceInfo}/Card.tsx +5 -6
  111. package/src/app/(main)/settings/sync/DeviceInfo/DeviceName.tsx +66 -0
  112. package/src/app/(main)/settings/sync/{features/DeviceInfo → DeviceInfo}/index.tsx +36 -22
  113. package/src/app/(main)/settings/sync/PageTitle.tsx +11 -0
  114. package/src/app/(main)/settings/sync/{features/WebRTC → WebRTC}/ChannelNameInput.tsx +3 -3
  115. package/src/app/(main)/settings/sync/{features/WebRTC → WebRTC}/index.tsx +9 -10
  116. package/src/app/(main)/settings/sync/{features/DeviceInfo → components}/SystemIcon.tsx +14 -6
  117. package/src/app/(main)/settings/sync/layout.tsx +12 -0
  118. package/src/app/(main)/settings/sync/loading.tsx +3 -0
  119. package/src/app/(main)/settings/sync/page.tsx +15 -11
  120. package/src/app/(main)/settings/tts/{features/STT.tsx → TTS/index.tsx} +27 -11
  121. package/src/app/(main)/settings/tts/loading.tsx +3 -0
  122. package/src/app/(main)/settings/tts/page.tsx +16 -8
  123. package/src/app/layout.tsx +3 -11
  124. package/src/const/url.ts +0 -1
  125. package/src/features/AgentSetting/AgentConfig/index.tsx +202 -0
  126. package/src/features/AgentSetting/AgentConfig/useSyncConfig.ts +23 -0
  127. package/src/features/AgentSetting/AgentMeta/index.tsx +3 -4
  128. package/src/features/AgentSetting/AgentPlugin/index.tsx +66 -65
  129. package/src/features/AgentSetting/AgentPrompt/index.tsx +47 -101
  130. package/src/features/AgentSetting/AgentTTS/index.tsx +0 -4
  131. package/src/features/AgentSetting/StoreUpdater.tsx +0 -2
  132. package/src/features/AgentSetting/index.tsx +6 -6
  133. package/src/features/AgentSetting/store/index.ts +0 -2
  134. package/src/features/AvatarWithUpload/index.tsx +0 -2
  135. package/src/features/Conversation/components/ChatItem/HistoryDivider.tsx +1 -1
  136. package/src/locales/default/common.ts +0 -14
  137. package/src/locales/default/setting.ts +0 -3
  138. package/src/store/global/initialState.ts +0 -1
  139. package/src/app/(main)/(mobile)/me/features/AvatarBanner.tsx +0 -52
  140. package/src/app/(main)/(mobile)/me/features/Cate.tsx +0 -35
  141. package/src/app/(main)/(mobile)/me/features/ExtraCate.tsx +0 -26
  142. package/src/app/(main)/(mobile)/me/features/useExtraCate.tsx +0 -68
  143. package/src/app/(main)/(mobile)/me/layout.tsx +0 -11
  144. package/src/app/(main)/(mobile)/me/loading.tsx +0 -17
  145. package/src/app/(main)/(mobile)/me/page.tsx +0 -31
  146. package/src/app/(main)/@nav/features/UserAvatar.tsx +0 -24
  147. package/src/app/(main)/@nav/features/UserPanel/LangButton.tsx +0 -55
  148. package/src/app/(main)/@nav/features/UserPanel/Popover.tsx +0 -34
  149. package/src/app/(main)/@nav/features/UserPanel/ThemeButton.tsx +0 -70
  150. package/src/app/(main)/@nav/features/UserPanel/UserInfo.tsx +0 -35
  151. package/src/app/(main)/@nav/features/UserPanel/index.tsx +0 -69
  152. package/src/app/(main)/@nav/features/UserPanel/useMenu.tsx +0 -142
  153. package/src/app/(main)/@nav/features/UserPanel/useNewVersion.tsx +0 -12
  154. package/src/app/(main)/chat/_layout/type.ts +0 -5
  155. package/src/app/(main)/chat/settings/_layout/Desktop/index.tsx +0 -32
  156. package/src/app/(main)/chat/settings/_layout/Mobile/index.tsx +0 -15
  157. package/src/app/(main)/chat/settings/error.tsx +0 -5
  158. package/src/app/(main)/chat/settings/loading.tsx +0 -3
  159. package/src/app/(main)/chat/settings/m/page.tsx +0 -15
  160. package/src/app/(main)/chat/settings/not-found.tsx +0 -3
  161. package/src/app/(main)/market/@detail/loading.tsx +0 -1
  162. package/src/app/(main)/settings/@category/default.tsx +0 -16
  163. package/src/app/(main)/settings/@category/features/CategoryContent.tsx +0 -37
  164. package/src/app/(main)/settings/@category/features/UpgradeAlert.tsx +0 -38
  165. package/src/app/(main)/settings/_layout/type.ts +0 -6
  166. package/src/app/(main)/settings/about/features/AboutList.tsx +0 -122
  167. package/src/app/(main)/settings/about/features/Analytics.tsx +0 -42
  168. package/src/app/(main)/settings/about/index.tsx +0 -35
  169. package/src/app/(main)/settings/agent/index.tsx +0 -48
  170. package/src/app/(main)/settings/error.tsx +0 -5
  171. package/src/app/(main)/settings/hooks/useCategory.tsx +0 -54
  172. package/src/app/(main)/settings/llm/components/Footer.tsx +0 -26
  173. package/src/app/(main)/settings/loading.tsx +0 -9
  174. package/src/app/(main)/settings/m/page.tsx +0 -19
  175. package/src/app/(main)/settings/not-found.tsx +0 -3
  176. package/src/app/(main)/settings/sync/features/DeviceInfo/DeviceName.tsx +0 -63
  177. package/src/app/(main)/settings/sync/index.tsx +0 -17
  178. package/src/app/(main)/settings/tts/features/OpenAI.tsx +0 -54
  179. package/src/app/(main)/settings/tts/index.tsx +0 -15
  180. package/src/app/@modal/(.)settings/m/index.tsx +0 -34
  181. package/src/app/@modal/(.)settings/m/layout.tsx +0 -28
  182. package/src/app/@modal/(.)settings/m/loading.tsx +0 -5
  183. package/src/app/@modal/(.)settings/m/page.tsx +0 -10
  184. package/src/app/@modal/_layout/Desktop.tsx +0 -32
  185. package/src/app/@modal/_layout/Mobile.tsx +0 -1
  186. package/src/app/@modal/_layout/SettingModalLayout.tsx +0 -59
  187. package/src/app/@modal/chat/(.)settings/m/features/CategoryContent.tsx +0 -36
  188. package/src/app/@modal/chat/(.)settings/m/features/useCategory.tsx +0 -62
  189. package/src/app/@modal/chat/(.)settings/m/layout.tsx +0 -55
  190. package/src/app/@modal/chat/(.)settings/m/loading.tsx +0 -5
  191. package/src/app/@modal/chat/(.)settings/m/page.tsx +0 -34
  192. package/src/app/@modal/default.tsx +0 -1
  193. package/src/app/@modal/layout.tsx +0 -30
  194. package/src/app/@modal/loading.tsx +0 -5
  195. package/src/components/BrandWatermark/index.tsx +0 -39
  196. package/src/components/Cell/Divider.tsx +0 -19
  197. package/src/components/Cell/index.tsx +0 -38
  198. package/src/components/Menu/index.tsx +0 -97
  199. package/src/components/SkeletonLoading/index.tsx +0 -21
  200. package/src/features/AgentSetting/AgentChat/index.tsx +0 -135
  201. package/src/features/AgentSetting/AgentModal/index.tsx +0 -95
  202. package/src/hooks/useQuery.ts +0 -7
  203. package/src/hooks/useQueryRoute.ts +0 -16
  204. package/src/server/redirectHard.ts +0 -9
  205. /package/src/app/(main)/settings/{about/features → features/SettingList}/Item.tsx +0 -0
  206. /package/src/app/(main)/settings/{common/features/Theme → features}/ThemeSwatches/ThemeSwatchesNeutral.tsx +0 -0
  207. /package/src/app/(main)/settings/{common/features/Theme → features}/ThemeSwatches/ThemeSwatchesPrimary.tsx +0 -0
  208. /package/src/app/(main)/settings/{common/features/Theme → features}/ThemeSwatches/index.ts +0 -0
  209. /package/src/app/(main)/settings/sync/{features/Alert.tsx → Alert.tsx} +0 -0
  210. /package/src/app/(main)/settings/sync/{features/WebRTC → components}/SyncSwitch/index.css +0 -0
  211. /package/src/app/(main)/settings/sync/{features/WebRTC → components}/SyncSwitch/index.tsx +0 -0
  212. /package/src/app/(main)/settings/sync/{features/WebRTC/generateRandomRoomName.ts → util.ts} +0 -0
  213. /package/src/app/(main)/settings/tts/{features/const.ts → TTS/options.ts} +0 -0
  214. /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={<Minimax.Combine size={32} type={'color'} />}
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={<Mistral.Combine size={26} type={'color'} />}
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={22}
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={28} />}
26
+ title={<Ollama.Combine size={24} />}
29
27
  />
30
28
  );
31
29
  });
@@ -1,5 +1,3 @@
1
- 'use client';
2
-
3
1
  import { OpenAI } from '@lobehub/icons';
4
2
  import { memo } from 'react';
5
3
 
@@ -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={<OpenRouter.Combine iconProps={{ color: OpenRouter.colorPrimary }} size={20} />}
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={<Perplexity.Combine size={24} type={'color'} />}
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={<Together.Combine size={26} type={'color'} />}
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={<ZeroOne.Text size={20} />}
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={<Zhipu.Combine size={32} type={'color'} />}
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,5 +1,3 @@
1
- 'use client';
2
-
3
1
  import { CheckCircleFilled } from '@ant-design/icons';
4
2
  import { Alert, Highlighter } from '@lobehub/ui';
5
3
  import { Button } from 'antd';
@@ -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 { Flexbox } from 'react-layout-kit';
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
- const Page = () => {
27
+ export default memo(() => {
28
+ const { t } = useTranslation('setting');
29
+
23
30
  return (
24
- <Flexbox gap={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
- </Flexbox>
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
+ };
@@ -0,0 +1,3 @@
1
+ import { Skeleton } from 'antd';
2
+
3
+ export default () => <Skeleton paragraph={{ rows: 8 }} />;
@@ -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 { redirect } from 'next/navigation';
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
- return redirect('/settings/common');
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: ${token.borderRadius}px;
8
+ border-radius: 12px;
9
9
 
10
10
  .${responsive.mobile} {
11
11
  width: 100%;
12
12
  }
13
13
  `,
14
14
  icon: css`
15
- width: 24px;
16
- height: 24px;
15
+ width: 40px;
16
+ height: 40px;
17
17
  `,
18
18
  title: css`
19
- font-size: 16px;
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
- <div className={styles.title}>{title}</div>
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: css`
24
- z-index: 2;
25
- padding: 8px;
26
- background: ${rgba(token.colorBgContainer, isDarkMode ? 0.7 : 1)};
27
- border-radius: ${token.borderRadiusLG - 1}px;
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={{ fontSize: 18, fontWeight: 'bold' }}>
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 flex={1} gap={12} horizontal>
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={24} />}
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 './generateRandomRoomName';
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, ...rest }) => {
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
- {...rest}
41
+ {...res}
42
42
  />
43
43
  );
44
44
  });