@lobehub/chat 0.152.5 → 0.152.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +50 -0
- package/README.md +8 -8
- package/README.zh-CN.md +8 -8
- package/docs/self-hosting/advanced/settings-url-share.mdx +100 -0
- package/docs/self-hosting/advanced/settings-url-share.zh-CN.mdx +100 -0
- package/locales/ar/common.json +1 -0
- package/locales/ar/setting.json +4 -1
- package/locales/bg-BG/common.json +1 -0
- package/locales/bg-BG/setting.json +4 -1
- package/locales/de-DE/common.json +1 -0
- package/locales/de-DE/setting.json +4 -1
- package/locales/en-US/common.json +1 -0
- package/locales/en-US/setting.json +4 -1
- package/locales/es-ES/common.json +1 -0
- package/locales/es-ES/setting.json +4 -1
- package/locales/fr-FR/common.json +1 -0
- package/locales/fr-FR/setting.json +4 -1
- package/locales/it-IT/common.json +1 -0
- package/locales/it-IT/setting.json +4 -1
- package/locales/ja-JP/common.json +1 -0
- package/locales/ja-JP/setting.json +4 -1
- package/locales/ko-KR/common.json +1 -0
- package/locales/ko-KR/setting.json +4 -1
- package/locales/nl-NL/common.json +1 -0
- package/locales/nl-NL/setting.json +4 -1
- package/locales/pl-PL/common.json +1 -0
- package/locales/pl-PL/setting.json +4 -1
- package/locales/pt-BR/common.json +1 -0
- package/locales/pt-BR/setting.json +4 -1
- package/locales/ru-RU/common.json +1 -0
- package/locales/ru-RU/setting.json +4 -1
- package/locales/tr-TR/common.json +1 -0
- package/locales/tr-TR/setting.json +4 -1
- package/locales/vi-VN/common.json +1 -0
- package/locales/vi-VN/setting.json +4 -1
- package/locales/zh-CN/common.json +1 -0
- package/locales/zh-CN/setting.json +4 -1
- package/locales/zh-TW/common.json +1 -0
- package/locales/zh-TW/setting.json +4 -1
- package/package.json +1 -1
- package/src/app/(main)/(mobile)/me/features/AvatarBanner.tsx +52 -0
- package/src/app/(main)/(mobile)/me/features/Cate.tsx +35 -0
- package/src/app/(main)/(mobile)/me/features/ExtraCate.tsx +26 -0
- package/src/app/(main)/(mobile)/me/features/useExtraCate.tsx +62 -0
- package/src/app/(main)/(mobile)/me/layout.tsx +11 -0
- package/src/app/(main)/(mobile)/me/loading.tsx +17 -0
- package/src/app/(main)/(mobile)/me/page.tsx +31 -0
- package/src/app/(main)/@nav/_layout/Desktop/index.tsx +1 -1
- package/src/app/(main)/@nav/_layout/Mobile.tsx +3 -3
- package/src/app/(main)/chat/(mobile)/features/SessionHeader.tsx +1 -1
- package/src/app/(main)/chat/_layout/Desktop/index.tsx +6 -8
- package/src/app/(main)/chat/_layout/Mobile/index.tsx +5 -3
- package/src/app/(main)/chat/_layout/type.ts +5 -0
- package/src/app/(main)/chat/features/SettingButton.tsx +3 -4
- package/src/app/(main)/chat/layout.ts +5 -2
- package/src/app/(main)/chat/settings/{(desktop) → _layout/Desktop}/Header.tsx +2 -0
- package/src/app/(main)/chat/settings/_layout/Desktop/index.tsx +28 -0
- package/src/app/(main)/chat/settings/{(mobile) → _layout/Mobile}/Header.tsx +3 -2
- package/src/app/(main)/chat/settings/_layout/Mobile/index.tsx +15 -0
- package/src/app/(main)/chat/settings/error.tsx +5 -0
- package/src/app/(main)/chat/settings/features/HeaderContent.tsx +15 -9
- package/src/app/(main)/chat/settings/features/SubmitAgentButton/SubmitAgentModal.tsx +2 -0
- package/src/app/(main)/chat/settings/features/SubmitAgentButton/index.tsx +16 -8
- package/src/app/(main)/chat/settings/layout.tsx +9 -2
- package/src/app/(main)/chat/settings/loading.tsx +3 -0
- package/src/app/(main)/chat/settings/not-found.tsx +3 -0
- package/src/app/(main)/chat/settings/page.tsx +2 -9
- package/src/app/(main)/market/@detail/default.tsx +1 -10
- package/src/app/(main)/market/{@detail/_layout/Desktop.tsx → _layout/Desktop/DetailSidebar.tsx} +2 -2
- package/src/app/(main)/market/_layout/Desktop/index.tsx +2 -1
- package/src/app/(main)/market/{@detail/_layout/Mobile.tsx → _layout/Mobile/DetailModal.tsx} +2 -2
- package/src/app/(main)/market/_layout/Mobile/index.tsx +3 -1
- package/src/app/(main)/settings/@category/default.tsx +16 -0
- package/src/app/(main)/settings/@category/features/CategoryContent.tsx +33 -0
- package/src/app/(main)/settings/@category/features/UpgradeAlert.tsx +38 -0
- package/src/app/(main)/settings/_layout/Desktop/Header.tsx +78 -23
- package/src/app/(main)/settings/_layout/Desktop/SideBar.tsx +39 -27
- package/src/app/(main)/settings/_layout/Desktop/index.tsx +41 -17
- package/src/app/(main)/settings/_layout/Mobile/{SubSettingHeader.tsx → Header.tsx} +3 -1
- package/src/app/(main)/settings/_layout/Mobile/index.tsx +7 -18
- package/src/app/(main)/settings/_layout/type.ts +6 -0
- package/src/app/(main)/settings/about/features/AboutList.tsx +134 -0
- package/src/app/(main)/settings/about/features/Analytics.tsx +42 -0
- package/src/app/(main)/settings/about/index.tsx +46 -0
- package/src/app/(main)/settings/about/page.tsx +13 -33
- package/src/app/(main)/settings/agent/{Agent.tsx → index.tsx} +8 -4
- package/src/app/(main)/settings/agent/page.tsx +8 -16
- package/src/app/(main)/settings/common/{Common.tsx → features/Common.tsx} +6 -4
- package/src/app/(main)/settings/common/{Theme.tsx → features/Theme/index.tsx} +8 -6
- package/src/app/(main)/settings/common/index.tsx +11 -16
- package/src/app/(main)/settings/common/page.tsx +8 -7
- package/src/app/(main)/settings/error.tsx +5 -0
- package/src/app/(main)/settings/features/Footer.tsx +2 -0
- package/src/app/(main)/settings/features/UpgradeAlert.tsx +21 -13
- package/src/app/(main)/settings/hooks/useCategory.tsx +54 -0
- package/src/app/(main)/settings/hooks/useSyncSettings.ts +2 -2
- package/src/app/(main)/settings/layout.ts +4 -1
- package/src/app/(main)/settings/llm/Anthropic/index.tsx +4 -8
- package/src/app/(main)/settings/llm/Azure/index.tsx +3 -1
- package/src/app/(main)/settings/llm/Bedrock/index.tsx +3 -1
- package/src/app/(main)/settings/llm/Google/index.tsx +4 -2
- package/src/app/(main)/settings/llm/Groq/index.tsx +3 -1
- package/src/app/(main)/settings/llm/Minimax/index.tsx +3 -9
- package/src/app/(main)/settings/llm/Mistral/index.tsx +3 -9
- package/src/app/(main)/settings/llm/Moonshot/index.tsx +3 -1
- package/src/app/(main)/settings/llm/Ollama/index.tsx +3 -1
- package/src/app/(main)/settings/llm/OpenAI/index.tsx +2 -0
- package/src/app/(main)/settings/llm/OpenRouter/index.tsx +3 -9
- package/src/app/(main)/settings/llm/Perplexity/index.tsx +3 -9
- package/src/app/(main)/settings/llm/TogetherAI/index.tsx +3 -9
- package/src/app/(main)/settings/llm/ZeroOne/index.tsx +3 -9
- package/src/app/(main)/settings/llm/Zhipu/index.tsx +3 -10
- package/src/app/(main)/settings/llm/components/Checker.tsx +2 -0
- package/src/app/(main)/settings/llm/components/Footer.tsx +26 -0
- package/src/app/(main)/settings/llm/components/ProviderConfig/index.tsx +29 -3
- package/src/app/(main)/settings/llm/index.tsx +11 -23
- package/src/app/(main)/settings/llm/page.tsx +15 -0
- package/src/app/(main)/settings/loading.tsx +9 -0
- package/src/app/(main)/settings/not-found.tsx +3 -0
- package/src/app/(main)/settings/page.tsx +2 -14
- package/src/app/(main)/settings/sync/{DeviceInfo → features/DeviceInfo}/Card.tsx +6 -5
- package/src/app/(main)/settings/sync/features/DeviceInfo/DeviceName.tsx +63 -0
- package/src/app/(main)/settings/sync/{components → features/DeviceInfo}/SystemIcon.tsx +6 -14
- package/src/app/(main)/settings/sync/{DeviceInfo → features/DeviceInfo}/index.tsx +22 -36
- package/src/app/(main)/settings/sync/{WebRTC → features/WebRTC}/ChannelNameInput.tsx +3 -3
- package/src/app/(main)/settings/sync/{WebRTC → features/WebRTC}/index.tsx +10 -9
- package/src/app/(main)/settings/sync/index.tsx +17 -0
- package/src/app/(main)/settings/sync/page.tsx +11 -15
- package/src/app/(main)/settings/tts/features/OpenAI.tsx +54 -0
- package/src/app/(main)/settings/tts/{TTS/index.tsx → features/STT.tsx} +11 -27
- package/src/app/(main)/settings/tts/index.tsx +15 -0
- package/src/app/(main)/settings/tts/page.tsx +8 -16
- package/src/app/layout.tsx +6 -2
- package/src/components/BrandWatermark/index.tsx +39 -0
- package/src/components/Cell/Divider.tsx +19 -0
- package/src/components/Cell/index.tsx +38 -0
- package/src/components/Menu/index.tsx +97 -0
- package/src/components/SkeletonLoading/index.tsx +21 -0
- package/src/const/url.ts +2 -0
- package/src/features/AgentSetting/AgentChat/index.tsx +135 -0
- package/src/features/AgentSetting/AgentMeta/index.tsx +4 -3
- package/src/features/AgentSetting/AgentModal/index.tsx +95 -0
- package/src/features/AgentSetting/AgentPlugin/index.tsx +65 -66
- package/src/features/AgentSetting/AgentPrompt/index.tsx +101 -47
- package/src/features/AgentSetting/AgentTTS/index.tsx +4 -0
- package/src/features/AgentSetting/StoreUpdater.tsx +2 -0
- package/src/features/AgentSetting/index.tsx +6 -6
- package/src/features/AgentSetting/store/index.ts +2 -0
- package/src/features/AvatarWithUpload/index.tsx +2 -0
- package/src/features/Conversation/components/ChatItem/HistoryDivider.tsx +1 -1
- package/src/hooks/useQuery.test.ts +20 -0
- package/src/hooks/useQuery.ts +7 -0
- package/src/hooks/useQueryRoute.test.ts +86 -0
- package/src/hooks/useQueryRoute.ts +46 -0
- package/src/locales/default/common.ts +1 -0
- package/src/locales/default/setting.ts +3 -0
- package/src/store/global/initialState.ts +1 -0
- package/src/store/user/slices/common/action.test.ts +1 -1
- package/src/app/(main)/chat/settings/(desktop)/index.tsx +0 -23
- package/src/app/(main)/chat/settings/(mobile)/index.tsx +0 -16
- package/src/app/(main)/settings/(desktop)/index.tsx +0 -23
- package/src/app/(main)/settings/(mobile)/features/AvatarBanner.tsx +0 -68
- package/src/app/(main)/settings/(mobile)/features/ExtraList.tsx +0 -65
- package/src/app/(main)/settings/(mobile)/index.tsx +0 -53
- package/src/app/(main)/settings/about/AboutList.tsx +0 -53
- package/src/app/(main)/settings/about/Analytics.tsx +0 -40
- package/src/app/(main)/settings/about/style.ts +0 -22
- package/src/app/(main)/settings/agent/loading.tsx +0 -3
- package/src/app/(main)/settings/common/loading.tsx +0 -3
- package/src/app/(main)/settings/features/SettingList/index.tsx +0 -47
- package/src/app/(main)/settings/llm/layout.tsx +0 -11
- package/src/app/(main)/settings/llm/loading.tsx +0 -3
- package/src/app/(main)/settings/sync/DeviceInfo/DeviceName.tsx +0 -66
- package/src/app/(main)/settings/sync/PageTitle.tsx +0 -11
- package/src/app/(main)/settings/sync/layout.tsx +0 -12
- package/src/app/(main)/settings/sync/loading.tsx +0 -3
- package/src/app/(main)/settings/tts/loading.tsx +0 -3
- package/src/features/AgentSetting/AgentConfig/index.tsx +0 -202
- package/src/features/AgentSetting/AgentConfig/useSyncConfig.ts +0 -23
- /package/src/app/(main)/settings/{features/SettingList → about/features}/Item.tsx +0 -0
- /package/src/app/(main)/settings/{features → common/features/Theme}/ThemeSwatches/ThemeSwatchesNeutral.tsx +0 -0
- /package/src/app/(main)/settings/{features → common/features/Theme}/ThemeSwatches/ThemeSwatchesPrimary.tsx +0 -0
- /package/src/app/(main)/settings/{features → common/features/Theme}/ThemeSwatches/index.ts +0 -0
- /package/src/app/(main)/settings/sync/{Alert.tsx → features/Alert.tsx} +0 -0
- /package/src/app/(main)/settings/sync/{components → features/WebRTC}/SyncSwitch/index.css +0 -0
- /package/src/app/(main)/settings/sync/{components → features/WebRTC}/SyncSwitch/index.tsx +0 -0
- /package/src/app/(main)/settings/sync/{util.ts → features/WebRTC/generateRandomRoomName.ts} +0 -0
- /package/src/app/(main)/settings/tts/{TTS/options.ts → features/const.ts} +0 -0
- /package/src/features/AgentSetting/{AgentConfig → AgentModal}/ModelSelect.tsx +0 -0
|
@@ -7,8 +7,8 @@ import { globalService } from '@/services/global';
|
|
|
7
7
|
import { messageService } from '@/services/message';
|
|
8
8
|
import { userService } from '@/services/user';
|
|
9
9
|
import { useUserStore } from '@/store/user';
|
|
10
|
+
import { preferenceSelectors } from '@/store/user/selectors';
|
|
10
11
|
import { commonSelectors } from '@/store/user/slices/common/selectors';
|
|
11
|
-
import { preferenceSelectors } from '@/store/user/slices/preference/selectors';
|
|
12
12
|
import { syncSettingsSelectors } from '@/store/user/slices/settings/selectors';
|
|
13
13
|
import { GlobalServerConfig } from '@/types/serverConfig';
|
|
14
14
|
import { switchLang } from '@/utils/client/switchLang';
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
'use client';
|
|
2
|
-
|
|
3
|
-
import { memo } from 'react';
|
|
4
|
-
import { Flexbox } from 'react-layout-kit';
|
|
5
|
-
|
|
6
|
-
import SafeSpacing from '@/components/SafeSpacing';
|
|
7
|
-
import ClientResponsiveContent from '@/components/client/ClientResponsiveContent';
|
|
8
|
-
import { HEADER_HEIGHT } from '@/const/layoutTokens';
|
|
9
|
-
|
|
10
|
-
import EditPage from '../features/EditPage';
|
|
11
|
-
import Header from './Header';
|
|
12
|
-
|
|
13
|
-
const Desktop = memo(() => (
|
|
14
|
-
<>
|
|
15
|
-
<Header />
|
|
16
|
-
<Flexbox align={'center'} flex={1} gap={16} padding={24} style={{ overflow: 'scroll' }}>
|
|
17
|
-
<SafeSpacing height={HEADER_HEIGHT - 16} />
|
|
18
|
-
<EditPage />
|
|
19
|
-
</Flexbox>
|
|
20
|
-
</>
|
|
21
|
-
));
|
|
22
|
-
|
|
23
|
-
export default ClientResponsiveContent({ Desktop, Mobile: () => import('../(mobile)') });
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
'use client';
|
|
2
|
-
|
|
3
|
-
import { memo } from 'react';
|
|
4
|
-
|
|
5
|
-
import MobileContentLayout from '@/components/server/MobileNavLayout';
|
|
6
|
-
|
|
7
|
-
import EditPage from '../features/EditPage';
|
|
8
|
-
import Header from './Header';
|
|
9
|
-
|
|
10
|
-
const ChatSettings = memo(() => (
|
|
11
|
-
<MobileContentLayout header={<Header />} withNav={false}>
|
|
12
|
-
<EditPage />
|
|
13
|
-
</MobileContentLayout>
|
|
14
|
-
));
|
|
15
|
-
|
|
16
|
-
export default ChatSettings;
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
'use client';
|
|
2
|
-
|
|
3
|
-
import dynamic from 'next/dynamic';
|
|
4
|
-
import { FC, memo } from 'react';
|
|
5
|
-
|
|
6
|
-
import MobileSwitchLoading from '@/features/MobileSwitchLoading';
|
|
7
|
-
import { useIsMobile } from '@/hooks/useIsMobile';
|
|
8
|
-
|
|
9
|
-
import Common from '../common';
|
|
10
|
-
import { SettingsCommonProps } from '../common/Common';
|
|
11
|
-
|
|
12
|
-
const Mobile: FC = dynamic(() => import('../(mobile)'), {
|
|
13
|
-
loading: MobileSwitchLoading,
|
|
14
|
-
ssr: false,
|
|
15
|
-
}) as FC;
|
|
16
|
-
|
|
17
|
-
const Desktop = memo<SettingsCommonProps>((props) => {
|
|
18
|
-
const mobile = useIsMobile();
|
|
19
|
-
|
|
20
|
-
return mobile ? <Mobile /> : <Common {...props} />;
|
|
21
|
-
});
|
|
22
|
-
|
|
23
|
-
export default Desktop;
|
|
@@ -1,68 +0,0 @@
|
|
|
1
|
-
import { DivProps } from '@lobehub/ui';
|
|
2
|
-
import { createStyles } from 'antd-style';
|
|
3
|
-
import Image from 'next/image';
|
|
4
|
-
import { memo } from 'react';
|
|
5
|
-
import { Flexbox } from 'react-layout-kit';
|
|
6
|
-
|
|
7
|
-
import { DEFAULT_USER_AVATAR_URL } from '@/const/meta';
|
|
8
|
-
|
|
9
|
-
export const useStyles = createStyles(({ css, token }) => ({
|
|
10
|
-
banner: css`
|
|
11
|
-
position: relative;
|
|
12
|
-
|
|
13
|
-
overflow: hidden;
|
|
14
|
-
|
|
15
|
-
height: 172px;
|
|
16
|
-
min-height: 172px;
|
|
17
|
-
max-height: 172px;
|
|
18
|
-
`,
|
|
19
|
-
bannerBox: css`
|
|
20
|
-
position: relative;
|
|
21
|
-
|
|
22
|
-
width: 100%;
|
|
23
|
-
height: 100%;
|
|
24
|
-
|
|
25
|
-
background: ${token.colorBgLayout};
|
|
26
|
-
|
|
27
|
-
mask-image: linear-gradient(to bottom, #fff, transparent);
|
|
28
|
-
`,
|
|
29
|
-
bannerImg: css`
|
|
30
|
-
position: absolute;
|
|
31
|
-
top: -50%;
|
|
32
|
-
filter: blur(100px) saturate(2);
|
|
33
|
-
`,
|
|
34
|
-
}));
|
|
35
|
-
|
|
36
|
-
interface AgentCardBannerProps extends DivProps {
|
|
37
|
-
avatar: string;
|
|
38
|
-
size?: number;
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
const AvatarBanner = memo<AgentCardBannerProps>(
|
|
42
|
-
({ avatar, className, size = 200, children, ...props }) => {
|
|
43
|
-
const { styles, cx } = useStyles();
|
|
44
|
-
|
|
45
|
-
return (
|
|
46
|
-
<Flexbox
|
|
47
|
-
align={'center'}
|
|
48
|
-
className={cx(styles.banner, className)}
|
|
49
|
-
justify={'center'}
|
|
50
|
-
{...props}
|
|
51
|
-
>
|
|
52
|
-
<Flexbox align={'center'} className={styles.bannerBox} justify={'center'}>
|
|
53
|
-
<Image
|
|
54
|
-
alt={'banner'}
|
|
55
|
-
className={styles.bannerImg}
|
|
56
|
-
height={size}
|
|
57
|
-
src={avatar || DEFAULT_USER_AVATAR_URL}
|
|
58
|
-
unoptimized
|
|
59
|
-
width={size}
|
|
60
|
-
/>
|
|
61
|
-
</Flexbox>
|
|
62
|
-
{children}
|
|
63
|
-
</Flexbox>
|
|
64
|
-
);
|
|
65
|
-
},
|
|
66
|
-
);
|
|
67
|
-
|
|
68
|
-
export default AvatarBanner;
|
|
@@ -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,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,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
|
-
};
|