@lobehub/chat 0.152.0 → 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 +50 -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 +12 -0
- package/src/app/(main)/market/{features/AgentDetailContent/AgentInfo → @detail/features/AgentDetailContent}/Header.tsx +30 -21
- package/src/app/(main)/market/{features/AgentDetailContent/AgentInfo → @detail/features/AgentDetailContent}/index.tsx +10 -4
- package/src/app/(main)/market/{features/AgentDetailContent/AgentInfo → @detail/features/AgentDetailContent}/style.ts +7 -11
- package/src/app/(main)/market/@detail/loading.tsx +1 -0
- package/src/app/(main)/market/_layout/Desktop/{AgentDetail.tsx → DetailSidebar.tsx} +17 -12
- package/src/app/(main)/market/_layout/Desktop/Header.tsx +3 -6
- package/src/app/(main)/market/_layout/Desktop/Hero.tsx +39 -0
- package/src/app/(main)/market/_layout/Desktop/index.tsx +24 -44
- package/src/app/(main)/market/{(mobile)/features/AgentDetail.tsx → _layout/Mobile/DetailModal.tsx} +9 -7
- package/src/app/(main)/market/_layout/Mobile/Header.tsx +2 -2
- package/src/app/(main)/market/_layout/Mobile/index.tsx +17 -9
- package/src/app/(main)/market/_layout/type.ts +6 -0
- package/src/app/(main)/market/features/AgentCard/AgentCardBanner.tsx +10 -9
- package/src/app/(main)/market/features/AgentCard/index.tsx +133 -58
- package/src/app/(main)/market/features/AgentList.tsx +94 -0
- package/src/app/(main)/market/features/AgentSearchBar.tsx +42 -0
- package/src/app/(main)/market/features/ShareAgentButton/Inner.tsx +9 -7
- package/src/app/(main)/market/features/ShareAgentButton/index.tsx +22 -15
- package/src/app/(main)/market/features/TagList.tsx +65 -0
- package/src/app/(main)/market/layout.tsx +11 -0
- package/src/app/(main)/market/loading.tsx +2 -2
- package/src/app/(main)/market/page.tsx +22 -12
- 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/features/ChatInput/STT/browser.tsx +1 -1
- package/src/features/ChatInput/STT/openai.tsx +1 -1
- package/src/features/Conversation/components/InboxWelcome/AgentsSuggest.tsx +2 -2
- 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/locales/resources.ts +1 -0
- package/src/server/redirectHard.ts +9 -0
- package/src/server/translation.ts +20 -0
- package/src/services/__tests__/chat.test.ts +1 -1
- package/src/store/global/initialState.ts +1 -0
- package/src/store/market/action.ts +1 -1
- package/src/store/session/slices/session/action.ts +1 -1
- package/src/utils/difference.ts +2 -1
- 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)/market/(desktop)/index.tsx +0 -20
- package/src/app/(main)/market/(mobile)/features/AgentCard.tsx +0 -31
- package/src/app/(main)/market/(mobile)/index.tsx +0 -25
- package/src/app/(main)/market/components/Loading.tsx +0 -13
- package/src/app/(main)/market/features/AgentCard/AgentCardItem.tsx +0 -54
- package/src/app/(main)/market/features/AgentCard/style.ts +0 -33
- package/src/app/(main)/market/features/AgentDetailContent/index.tsx +0 -12
- package/src/app/(main)/market/features/AgentSearchBar/index.tsx +0 -40
- package/src/app/(main)/market/features/PageTitle/index.tsx +0 -13
- package/src/app/(main)/market/features/TagList/Inner.tsx +0 -28
- package/src/app/(main)/market/features/TagList/index.tsx +0 -23
- package/src/app/(main)/market/layout.ts +0 -8
- 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)/market/{features/AgentDetailContent/AgentInfo → @detail/features/AgentDetailContent}/Comment.tsx +0 -0
- /package/src/app/(main)/market/{features/AgentDetailContent/AgentInfo → @detail/features/AgentDetailContent}/Loading.tsx +0 -0
- /package/src/app/(main)/market/{features/AgentDetailContent/AgentInfo → @detail/features/AgentDetailContent}/TokenTag.tsx +0 -0
- /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,65 +0,0 @@
|
|
|
1
|
-
import { Upload } from 'antd';
|
|
2
|
-
import { useResponsive } from 'antd-style';
|
|
3
|
-
import { Feather, FileClock, HardDriveDownload, HardDriveUpload } from 'lucide-react';
|
|
4
|
-
import { memo } from 'react';
|
|
5
|
-
import { useTranslation } from 'react-i18next';
|
|
6
|
-
|
|
7
|
-
import { CHANGELOG, FEEDBACK } from '@/const/url';
|
|
8
|
-
import { useImportConfig } from '@/hooks/useImportConfig';
|
|
9
|
-
import { configService } from '@/services/config';
|
|
10
|
-
import { SettingsTabs } from '@/store/global/initialState';
|
|
11
|
-
|
|
12
|
-
import Item from '../../features/SettingList/Item';
|
|
13
|
-
|
|
14
|
-
interface ExtraListProps {
|
|
15
|
-
activeTab?: SettingsTabs;
|
|
16
|
-
}
|
|
17
|
-
const ExtraList = memo<ExtraListProps>(({ activeTab }) => {
|
|
18
|
-
const { t } = useTranslation('common');
|
|
19
|
-
|
|
20
|
-
const { importConfig } = useImportConfig();
|
|
21
|
-
const { mobile } = useResponsive();
|
|
22
|
-
const items = [
|
|
23
|
-
{
|
|
24
|
-
icon: HardDriveDownload,
|
|
25
|
-
label: t('export'),
|
|
26
|
-
onClick: configService.exportAll,
|
|
27
|
-
value: 'export',
|
|
28
|
-
},
|
|
29
|
-
{
|
|
30
|
-
icon: Feather,
|
|
31
|
-
label: t('feedback'),
|
|
32
|
-
onClick: () => window.open(FEEDBACK, '__blank'),
|
|
33
|
-
value: 'feedback',
|
|
34
|
-
},
|
|
35
|
-
{
|
|
36
|
-
icon: FileClock,
|
|
37
|
-
label: t('changelog'),
|
|
38
|
-
onClick: () => window.open(CHANGELOG, '__blank'),
|
|
39
|
-
value: 'changelog',
|
|
40
|
-
},
|
|
41
|
-
];
|
|
42
|
-
|
|
43
|
-
return (
|
|
44
|
-
<>
|
|
45
|
-
<Upload
|
|
46
|
-
beforeUpload={(file) => {
|
|
47
|
-
importConfig(file);
|
|
48
|
-
|
|
49
|
-
return false;
|
|
50
|
-
}}
|
|
51
|
-
maxCount={1}
|
|
52
|
-
showUploadList={false}
|
|
53
|
-
>
|
|
54
|
-
<Item icon={HardDriveUpload} label={t('import')} style={{ width: '100vw' }} />
|
|
55
|
-
</Upload>
|
|
56
|
-
{items.map(({ value, icon, label, onClick }) => (
|
|
57
|
-
<div key={value} onClick={onClick}>
|
|
58
|
-
<Item active={mobile ? false : activeTab === value} icon={icon} label={label} />
|
|
59
|
-
</div>
|
|
60
|
-
))}
|
|
61
|
-
</>
|
|
62
|
-
);
|
|
63
|
-
});
|
|
64
|
-
|
|
65
|
-
export default ExtraList;
|
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
'use client';
|
|
2
|
-
|
|
3
|
-
import { Divider } from 'antd';
|
|
4
|
-
import { createStyles } from 'antd-style';
|
|
5
|
-
import { memo } from 'react';
|
|
6
|
-
import { Center, Flexbox } from 'react-layout-kit';
|
|
7
|
-
|
|
8
|
-
import { CURRENT_VERSION } from '@/const/version';
|
|
9
|
-
import AvatarWithUpload from '@/features/AvatarWithUpload';
|
|
10
|
-
import { useUserStore } from '@/store/user';
|
|
11
|
-
import { commonSelectors } from '@/store/user/selectors';
|
|
12
|
-
|
|
13
|
-
import SettingList from '../features/SettingList';
|
|
14
|
-
import AvatarBanner from './features/AvatarBanner';
|
|
15
|
-
import ExtraList from './features/ExtraList';
|
|
16
|
-
|
|
17
|
-
const useStyles = createStyles(({ css, token }) => ({
|
|
18
|
-
divider: css`
|
|
19
|
-
height: 6px;
|
|
20
|
-
background: ${token.colorFillTertiary};
|
|
21
|
-
`,
|
|
22
|
-
footer: css`
|
|
23
|
-
font-size: 12px;
|
|
24
|
-
color: ${token.colorTextQuaternary};
|
|
25
|
-
`,
|
|
26
|
-
}));
|
|
27
|
-
|
|
28
|
-
const Setting = memo(() => {
|
|
29
|
-
const avatar = useUserStore(commonSelectors.userAvatar);
|
|
30
|
-
const { styles } = useStyles();
|
|
31
|
-
|
|
32
|
-
return (
|
|
33
|
-
<Flexbox style={{ overflow: 'scroll' }}>
|
|
34
|
-
<AvatarBanner avatar={avatar}>
|
|
35
|
-
<Center style={{ marginTop: 32, position: 'absolute', zIndex: 2 }}>
|
|
36
|
-
<AvatarWithUpload size={88} />
|
|
37
|
-
</Center>
|
|
38
|
-
</AvatarBanner>
|
|
39
|
-
<div style={{ width: '100%' }}>
|
|
40
|
-
<SettingList />
|
|
41
|
-
<div className={styles.divider} />
|
|
42
|
-
<ExtraList />
|
|
43
|
-
<Center style={{ paddingInline: 64 }}>
|
|
44
|
-
<Divider>
|
|
45
|
-
<span className={styles.footer}>LobeChat v{CURRENT_VERSION}</span>
|
|
46
|
-
</Divider>
|
|
47
|
-
</Center>
|
|
48
|
-
</div>
|
|
49
|
-
</Flexbox>
|
|
50
|
-
);
|
|
51
|
-
});
|
|
52
|
-
|
|
53
|
-
export default Setting;
|
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
import { Feather, FileClock, Heart } from 'lucide-react';
|
|
2
|
-
import { memo } from 'react';
|
|
3
|
-
import { useTranslation } from 'react-i18next';
|
|
4
|
-
import { Flexbox } from 'react-layout-kit';
|
|
5
|
-
|
|
6
|
-
import { ABOUT, CHANGELOG, FEEDBACK } from '@/const/url';
|
|
7
|
-
|
|
8
|
-
import Item from '../features/SettingList/Item';
|
|
9
|
-
import { useStyles } from './style';
|
|
10
|
-
|
|
11
|
-
const AboutList = memo(() => {
|
|
12
|
-
const { t } = useTranslation('setting');
|
|
13
|
-
const { styles } = useStyles();
|
|
14
|
-
const items = [
|
|
15
|
-
{
|
|
16
|
-
icon: Feather,
|
|
17
|
-
label: t('feedback', { ns: 'common' }),
|
|
18
|
-
onClick: () => window.open(FEEDBACK, '__blank'),
|
|
19
|
-
value: 'feedback',
|
|
20
|
-
},
|
|
21
|
-
{
|
|
22
|
-
icon: FileClock,
|
|
23
|
-
label: t('changelog', { ns: 'common' }),
|
|
24
|
-
onClick: () => window.open(CHANGELOG, '__blank'),
|
|
25
|
-
value: 'changelog',
|
|
26
|
-
},
|
|
27
|
-
{
|
|
28
|
-
icon: Heart,
|
|
29
|
-
label: t('about', { ns: 'common' }),
|
|
30
|
-
onClick: () => window.open(ABOUT, '__blank'),
|
|
31
|
-
value: 'about',
|
|
32
|
-
},
|
|
33
|
-
];
|
|
34
|
-
|
|
35
|
-
return (
|
|
36
|
-
<div className={styles.wrapper}>
|
|
37
|
-
<Flexbox className={styles.container} gap={24} padding={16}>
|
|
38
|
-
<Flexbox className={styles.title} gap={8} horizontal>
|
|
39
|
-
{t('about.title')}
|
|
40
|
-
</Flexbox>
|
|
41
|
-
<Flexbox width={'100%'}>
|
|
42
|
-
{items.map(({ value, icon, label, onClick }) => (
|
|
43
|
-
<div key={value} onClick={onClick}>
|
|
44
|
-
<Item active={false} icon={icon} label={label} />
|
|
45
|
-
</div>
|
|
46
|
-
))}
|
|
47
|
-
</Flexbox>
|
|
48
|
-
</Flexbox>
|
|
49
|
-
</div>
|
|
50
|
-
);
|
|
51
|
-
});
|
|
52
|
-
|
|
53
|
-
export default AboutList;
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
import { Switch } from 'antd';
|
|
2
|
-
import { memo } from 'react';
|
|
3
|
-
import { useTranslation } from 'react-i18next';
|
|
4
|
-
import { Flexbox } from 'react-layout-kit';
|
|
5
|
-
|
|
6
|
-
import { useUserStore } from '@/store/user';
|
|
7
|
-
import { preferenceSelectors } from '@/store/user/selectors';
|
|
8
|
-
|
|
9
|
-
import { useStyles } from './style';
|
|
10
|
-
|
|
11
|
-
const Analytics = memo(() => {
|
|
12
|
-
const { t } = useTranslation('setting');
|
|
13
|
-
const { styles } = useStyles();
|
|
14
|
-
const checked = useUserStore(preferenceSelectors.userAllowTrace);
|
|
15
|
-
const [updatePreference] = useUserStore((s) => [s.updatePreference]);
|
|
16
|
-
|
|
17
|
-
return (
|
|
18
|
-
<div className={styles.wrapper}>
|
|
19
|
-
<Flexbox className={styles.container} gap={24} padding={16}>
|
|
20
|
-
<Flexbox className={styles.title} gap={8} horizontal>
|
|
21
|
-
{t('analytics.title')}
|
|
22
|
-
</Flexbox>
|
|
23
|
-
<Flexbox gap={24} horizontal>
|
|
24
|
-
<Switch
|
|
25
|
-
checked={!!checked}
|
|
26
|
-
onChange={(e) => {
|
|
27
|
-
updatePreference({ telemetry: e });
|
|
28
|
-
}}
|
|
29
|
-
/>
|
|
30
|
-
<Flexbox gap={8}>
|
|
31
|
-
<Flexbox>{t('analytics.telemetry.title')}</Flexbox>
|
|
32
|
-
<Flexbox className={styles.desc}>{t('analytics.telemetry.desc')}</Flexbox>
|
|
33
|
-
</Flexbox>
|
|
34
|
-
</Flexbox>
|
|
35
|
-
</Flexbox>
|
|
36
|
-
</div>
|
|
37
|
-
);
|
|
38
|
-
});
|
|
39
|
-
|
|
40
|
-
export default Analytics;
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import { createStyles } from 'antd-style';
|
|
2
|
-
|
|
3
|
-
export const useStyles = createStyles(({ css, token, responsive }) => ({
|
|
4
|
-
container: css`
|
|
5
|
-
border: 1px solid ${token.colorBorder};
|
|
6
|
-
border-radius: 8px;
|
|
7
|
-
`,
|
|
8
|
-
desc: css`
|
|
9
|
-
color: ${token.colorTextTertiary};
|
|
10
|
-
`,
|
|
11
|
-
title: css`
|
|
12
|
-
font-size: 16px;
|
|
13
|
-
font-weight: 600;
|
|
14
|
-
`,
|
|
15
|
-
wrapper: css`
|
|
16
|
-
width: 100%;
|
|
17
|
-
|
|
18
|
-
${responsive.mobile} {
|
|
19
|
-
padding: 0 12px;
|
|
20
|
-
}
|
|
21
|
-
`,
|
|
22
|
-
}));
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import isEqual from 'fast-deep-equal';
|
|
2
|
-
import { memo } from 'react';
|
|
3
|
-
|
|
4
|
-
import { INBOX_SESSION_ID } from '@/const/session';
|
|
5
|
-
import AgentSetting from '@/features/AgentSetting';
|
|
6
|
-
import { useUserStore } from '@/store/user';
|
|
7
|
-
import { settingsSelectors } from '@/store/user/selectors';
|
|
8
|
-
|
|
9
|
-
const Agent = memo(() => {
|
|
10
|
-
const config = useUserStore(settingsSelectors.defaultAgentConfig, isEqual);
|
|
11
|
-
const meta = useUserStore(settingsSelectors.defaultAgentMeta, isEqual);
|
|
12
|
-
const [updateAgent] = useUserStore((s) => [s.updateDefaultAgent]);
|
|
13
|
-
|
|
14
|
-
return (
|
|
15
|
-
<AgentSetting
|
|
16
|
-
config={config}
|
|
17
|
-
id={INBOX_SESSION_ID}
|
|
18
|
-
meta={meta}
|
|
19
|
-
onConfigChange={(config) => {
|
|
20
|
-
updateAgent({ config });
|
|
21
|
-
}}
|
|
22
|
-
onMetaChange={(meta) => {
|
|
23
|
-
updateAgent({ meta });
|
|
24
|
-
}}
|
|
25
|
-
/>
|
|
26
|
-
);
|
|
27
|
-
});
|
|
28
|
-
|
|
29
|
-
export default Agent;
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
'use client';
|
|
2
|
-
|
|
3
|
-
import { memo } from 'react';
|
|
4
|
-
import { useTranslation } from 'react-i18next';
|
|
5
|
-
|
|
6
|
-
import PageTitle from '@/components/PageTitle';
|
|
7
|
-
import { CURRENT_VERSION } from '@/const/version';
|
|
8
|
-
|
|
9
|
-
import Footer from '../features/Footer';
|
|
10
|
-
import Common, { SettingsCommonProps } from './Common';
|
|
11
|
-
import Theme from './Theme';
|
|
12
|
-
|
|
13
|
-
export default memo<SettingsCommonProps>((props) => {
|
|
14
|
-
const { t } = useTranslation('setting');
|
|
15
|
-
|
|
16
|
-
return (
|
|
17
|
-
<>
|
|
18
|
-
<PageTitle title={t('tab.common')} />
|
|
19
|
-
<Theme />
|
|
20
|
-
<Common {...props} />
|
|
21
|
-
<Footer>LobeChat v{CURRENT_VERSION}</Footer>
|
|
22
|
-
</>
|
|
23
|
-
);
|
|
24
|
-
});
|
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
import { Bot, Cloudy, Info, Mic2, Settings2, Webhook } from 'lucide-react';
|
|
2
|
-
import Link from 'next/link';
|
|
3
|
-
import { memo } from 'react';
|
|
4
|
-
import { useTranslation } from 'react-i18next';
|
|
5
|
-
|
|
6
|
-
import { SettingsTabs } from '@/store/global/initialState';
|
|
7
|
-
import { featureFlagsSelectors, useServerConfigStore } from '@/store/serverConfig';
|
|
8
|
-
|
|
9
|
-
import Item from './Item';
|
|
10
|
-
|
|
11
|
-
interface TabItem {
|
|
12
|
-
icon: any;
|
|
13
|
-
label: string;
|
|
14
|
-
value: SettingsTabs;
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
export interface SettingListProps {
|
|
18
|
-
activeTab?: SettingsTabs;
|
|
19
|
-
mobile?: boolean;
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
const SettingList = memo<SettingListProps>(({ activeTab, mobile }) => {
|
|
23
|
-
const { t } = useTranslation('setting');
|
|
24
|
-
const { enableWebrtc, showLLM } = useServerConfigStore(featureFlagsSelectors);
|
|
25
|
-
|
|
26
|
-
const items = [
|
|
27
|
-
{ icon: Settings2, label: t('tab.common'), value: SettingsTabs.Common },
|
|
28
|
-
enableWebrtc && { icon: Cloudy, label: t('tab.sync'), value: SettingsTabs.Sync },
|
|
29
|
-
showLLM && { icon: Webhook, label: t('tab.llm'), value: SettingsTabs.LLM },
|
|
30
|
-
{ icon: Mic2, label: t('tab.tts'), value: SettingsTabs.TTS },
|
|
31
|
-
{ icon: Bot, label: t('tab.agent'), value: SettingsTabs.Agent },
|
|
32
|
-
{ icon: Info, label: t('tab.about'), value: SettingsTabs.About },
|
|
33
|
-
].filter(Boolean) as TabItem[];
|
|
34
|
-
|
|
35
|
-
return items.map(({ value, icon, label }) => (
|
|
36
|
-
<Link aria-label={label} href={`/settings/${value}`} key={value}>
|
|
37
|
-
<Item
|
|
38
|
-
active={mobile ? false : activeTab === value}
|
|
39
|
-
hoverable={!mobile}
|
|
40
|
-
icon={icon}
|
|
41
|
-
label={label}
|
|
42
|
-
/>
|
|
43
|
-
</Link>
|
|
44
|
-
));
|
|
45
|
-
});
|
|
46
|
-
|
|
47
|
-
export default SettingList;
|
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
'use client';
|
|
2
|
-
|
|
3
|
-
import Link from 'next/link';
|
|
4
|
-
import { memo } from 'react';
|
|
5
|
-
import { Trans, useTranslation } from 'react-i18next';
|
|
6
|
-
|
|
7
|
-
import PageTitle from '@/components/PageTitle';
|
|
8
|
-
import { MORE_MODEL_PROVIDER_REQUEST_URL } from '@/const/url';
|
|
9
|
-
|
|
10
|
-
import Footer from '../features/Footer';
|
|
11
|
-
import Anthropic from './Anthropic';
|
|
12
|
-
import Azure from './Azure';
|
|
13
|
-
import Bedrock from './Bedrock';
|
|
14
|
-
import Google from './Google';
|
|
15
|
-
import Groq from './Groq';
|
|
16
|
-
import Minimax from './Minimax';
|
|
17
|
-
import Mistral from './Mistral';
|
|
18
|
-
import Moonshot from './Moonshot';
|
|
19
|
-
import Ollama from './Ollama';
|
|
20
|
-
import OpenAI from './OpenAI';
|
|
21
|
-
import OpenRouter from './OpenRouter';
|
|
22
|
-
import Perplexity from './Perplexity';
|
|
23
|
-
import TogetherAI from './TogetherAI';
|
|
24
|
-
import ZeroOne from './ZeroOne';
|
|
25
|
-
import Zhipu from './Zhipu';
|
|
26
|
-
|
|
27
|
-
export default memo(() => {
|
|
28
|
-
const { t } = useTranslation('setting');
|
|
29
|
-
|
|
30
|
-
return (
|
|
31
|
-
<>
|
|
32
|
-
<PageTitle title={t('tab.llm')} />
|
|
33
|
-
<OpenAI />
|
|
34
|
-
<Ollama />
|
|
35
|
-
<Azure />
|
|
36
|
-
<Google />
|
|
37
|
-
<Anthropic />
|
|
38
|
-
<Bedrock />
|
|
39
|
-
<OpenRouter />
|
|
40
|
-
<TogetherAI />
|
|
41
|
-
<Groq />
|
|
42
|
-
<Perplexity />
|
|
43
|
-
<Minimax />
|
|
44
|
-
<Mistral />
|
|
45
|
-
<Moonshot />
|
|
46
|
-
<Zhipu />
|
|
47
|
-
<ZeroOne />
|
|
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
|
-
</>
|
|
58
|
-
);
|
|
59
|
-
});
|
|
@@ -1,11 +0,0 @@
|
|
|
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,66 +0,0 @@
|
|
|
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;
|
|
@@ -1,11 +0,0 @@
|
|
|
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
|
-
});
|
|
@@ -1,12 +0,0 @@
|
|
|
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 enableWebrtc = serverFeatureFlags().enableWebrtc;
|
|
8
|
-
|
|
9
|
-
if (!enableWebrtc) return notFound();
|
|
10
|
-
|
|
11
|
-
return children;
|
|
12
|
-
};
|