@lobehub/chat 1.51.10 → 1.51.12
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/changelog/v1.json +18 -0
- package/package.json +1 -1
- package/src/app/[variants]/(main)/files/layout.tsx +0 -2
- package/src/app/[variants]/(main)/settings/provider/(detail)/[id]/page.tsx +28 -28
- package/src/app/[variants]/(main)/settings/provider/layout.tsx +2 -0
- package/src/app/[variants]/page.tsx +0 -2
- package/src/layout/GlobalProvider/ImportSettings.tsx +30 -0
- package/src/layout/GlobalProvider/StoreInitialization.tsx +6 -31
- package/src/layout/GlobalProvider/index.tsx +3 -1
- /package/src/app/{(auth) → [variants]/(auth)}/layout.tsx +0 -0
- /package/src/app/{(auth) → [variants]/(auth)}/login/[[...login]]/page.tsx +0 -0
- /package/src/app/{(auth) → [variants]/(auth)}/next-auth/error/AuthErrorPage.tsx +0 -0
- /package/src/app/{(auth) → [variants]/(auth)}/next-auth/error/page.tsx +0 -0
- /package/src/app/{(auth) → [variants]/(auth)}/signup/[[...signup]]/page.tsx +0 -0
package/CHANGELOG.md
CHANGED
@@ -2,6 +2,56 @@
|
|
2
2
|
|
3
3
|
# Changelog
|
4
4
|
|
5
|
+
### [Version 1.51.12](https://github.com/lobehub/lobe-chat/compare/v1.51.11...v1.51.12)
|
6
|
+
|
7
|
+
<sup>Released on **2025-02-07**</sup>
|
8
|
+
|
9
|
+
#### 🐛 Bug Fixes
|
10
|
+
|
11
|
+
- **misc**: Try to fix next-auth issue.
|
12
|
+
|
13
|
+
<br/>
|
14
|
+
|
15
|
+
<details>
|
16
|
+
<summary><kbd>Improvements and Fixes</kbd></summary>
|
17
|
+
|
18
|
+
#### What's fixed
|
19
|
+
|
20
|
+
- **misc**: Try to fix next-auth issue, closes [#5813](https://github.com/lobehub/lobe-chat/issues/5813) ([8e316bd](https://github.com/lobehub/lobe-chat/commit/8e316bd))
|
21
|
+
|
22
|
+
</details>
|
23
|
+
|
24
|
+
<div align="right">
|
25
|
+
|
26
|
+
[](#readme-top)
|
27
|
+
|
28
|
+
</div>
|
29
|
+
|
30
|
+
### [Version 1.51.11](https://github.com/lobehub/lobe-chat/compare/v1.51.10...v1.51.11)
|
31
|
+
|
32
|
+
<sup>Released on **2025-02-06**</sup>
|
33
|
+
|
34
|
+
#### 🐛 Bug Fixes
|
35
|
+
|
36
|
+
- **misc**: Fix `/file/[id]` 500 issue.
|
37
|
+
|
38
|
+
<br/>
|
39
|
+
|
40
|
+
<details>
|
41
|
+
<summary><kbd>Improvements and Fixes</kbd></summary>
|
42
|
+
|
43
|
+
#### What's fixed
|
44
|
+
|
45
|
+
- **misc**: Fix `/file/[id]` 500 issue, closes [#5812](https://github.com/lobehub/lobe-chat/issues/5812) ([9bb387e](https://github.com/lobehub/lobe-chat/commit/9bb387e))
|
46
|
+
|
47
|
+
</details>
|
48
|
+
|
49
|
+
<div align="right">
|
50
|
+
|
51
|
+
[](#readme-top)
|
52
|
+
|
53
|
+
</div>
|
54
|
+
|
5
55
|
### [Version 1.51.10](https://github.com/lobehub/lobe-chat/compare/v1.51.9...v1.51.10)
|
6
56
|
|
7
57
|
<sup>Released on **2025-02-06**</sup>
|
package/changelog/v1.json
CHANGED
@@ -1,4 +1,22 @@
|
|
1
1
|
[
|
2
|
+
{
|
3
|
+
"children": {
|
4
|
+
"fixes": [
|
5
|
+
"Try to fix next-auth issue."
|
6
|
+
]
|
7
|
+
},
|
8
|
+
"date": "2025-02-07",
|
9
|
+
"version": "1.51.12"
|
10
|
+
},
|
11
|
+
{
|
12
|
+
"children": {
|
13
|
+
"fixes": [
|
14
|
+
"Fix /file/[id] 500 issue."
|
15
|
+
]
|
16
|
+
},
|
17
|
+
"date": "2025-02-06",
|
18
|
+
"version": "1.51.11"
|
19
|
+
},
|
2
20
|
{
|
3
21
|
"children": {
|
4
22
|
"fixes": [
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@lobehub/chat",
|
3
|
-
"version": "1.51.
|
3
|
+
"version": "1.51.12",
|
4
4
|
"description": "Lobe Chat - an open-source, high-performance chatbot framework that supports speech synthesis, multimodal, and extensible Function Call plugin system. Supports one-click free deployment of your private ChatGPT/LLM web application.",
|
5
5
|
"keywords": [
|
6
6
|
"framework",
|
@@ -1,14 +1,14 @@
|
|
1
|
-
|
1
|
+
import { redirect } from 'next/navigation';
|
2
|
+
|
2
3
|
import { DEFAULT_MODEL_PROVIDER_LIST } from '@/config/modelProviders';
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
4
|
+
import { isServerMode } from '@/const/version';
|
5
|
+
import { AiInfraRepos } from '@/database/repositories/aiInfra';
|
6
|
+
import { serverDB } from '@/database/server';
|
7
|
+
import { getServerGlobalConfig } from '@/server/globalConfig';
|
8
|
+
import { KeyVaultsGateKeeper } from '@/server/modules/KeyVaultsEncrypt';
|
8
9
|
import { PagePropsWithId } from '@/types/next';
|
9
|
-
|
10
|
-
|
11
|
-
// import { getUserAuth } from '@/utils/server/auth';
|
10
|
+
import { ProviderConfig } from '@/types/user/settings';
|
11
|
+
import { getUserAuth } from '@/utils/server/auth';
|
12
12
|
|
13
13
|
import ClientMode from './ClientMode';
|
14
14
|
import ProviderDetail from './index';
|
@@ -21,25 +21,25 @@ const Page = async (props: PagePropsWithId) => {
|
|
21
21
|
if (!!builtinProviderCard) return <ProviderDetail source={'builtin'} {...builtinProviderCard} />;
|
22
22
|
|
23
23
|
// if user custom provider
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
24
|
+
if (isServerMode) {
|
25
|
+
const { userId } = await getUserAuth();
|
26
|
+
|
27
|
+
const { aiProvider } = getServerGlobalConfig();
|
28
|
+
const aiInfraRepos = new AiInfraRepos(
|
29
|
+
serverDB,
|
30
|
+
userId!,
|
31
|
+
aiProvider as Record<string, ProviderConfig>,
|
32
|
+
);
|
33
|
+
|
34
|
+
const userCard = await aiInfraRepos.getAiProviderDetail(
|
35
|
+
params.id,
|
36
|
+
KeyVaultsGateKeeper.getUserKeyVaults,
|
37
|
+
);
|
38
|
+
|
39
|
+
if (!userCard) return redirect('/settings/provider');
|
40
|
+
|
41
|
+
return <ProviderDetail {...userCard} />;
|
42
|
+
}
|
43
43
|
|
44
44
|
return <ClientMode id={params.id} />;
|
45
45
|
};
|
@@ -0,0 +1,30 @@
|
|
1
|
+
'use client';
|
2
|
+
|
3
|
+
import { useQueryState } from 'nuqs';
|
4
|
+
import { memo, useEffect } from 'react';
|
5
|
+
|
6
|
+
import { LOBE_URL_IMPORT_NAME } from '@/const/url';
|
7
|
+
import { useUserStore } from '@/store/user';
|
8
|
+
|
9
|
+
const ImportSettings = memo(() => {
|
10
|
+
const [importUrlShareSettings, isUserStateInit] = useUserStore((s) => [
|
11
|
+
s.importUrlShareSettings,
|
12
|
+
s.isUserStateInit,
|
13
|
+
]);
|
14
|
+
|
15
|
+
// Import settings from the url
|
16
|
+
const [searchParam] = useQueryState(LOBE_URL_IMPORT_NAME, {
|
17
|
+
clearOnDefault: true,
|
18
|
+
defaultValue: '',
|
19
|
+
});
|
20
|
+
|
21
|
+
useEffect(() => {
|
22
|
+
// Why use `usUserStateInit`,
|
23
|
+
// see: https://github.com/lobehub/lobe-chat/pull/4072
|
24
|
+
if (searchParam && isUserStateInit) importUrlShareSettings(searchParam);
|
25
|
+
}, [searchParam, isUserStateInit]);
|
26
|
+
|
27
|
+
return null;
|
28
|
+
});
|
29
|
+
|
30
|
+
export default ImportSettings;
|
@@ -1,12 +1,10 @@
|
|
1
1
|
'use client';
|
2
2
|
|
3
3
|
import { useRouter } from 'next/navigation';
|
4
|
-
import {
|
5
|
-
import { memo, useEffect } from 'react';
|
4
|
+
import { memo } from 'react';
|
6
5
|
import { useTranslation } from 'react-i18next';
|
7
6
|
import { createStoreUpdater } from 'zustand-utils';
|
8
7
|
|
9
|
-
import { LOBE_URL_IMPORT_NAME } from '@/const/url';
|
10
8
|
import { useIsMobile } from '@/hooks/useIsMobile';
|
11
9
|
import { useEnabledDataSync } from '@/hooks/useSyncData';
|
12
10
|
import { useAgentStore } from '@/store/agent';
|
@@ -23,14 +21,11 @@ const StoreInitialization = memo(() => {
|
|
23
21
|
useTranslation('error');
|
24
22
|
|
25
23
|
const router = useRouter();
|
26
|
-
const [isLogin, isSignedIn, useInitUserState
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
s.importUrlShareSettings,
|
32
|
-
s.isUserStateInit,
|
33
|
-
]);
|
24
|
+
const [isLogin, isSignedIn, useInitUserState] = useUserStore((s) => [
|
25
|
+
authSelectors.isLogin(s),
|
26
|
+
s.isSignedIn,
|
27
|
+
s.useInitUserState,
|
28
|
+
]);
|
34
29
|
|
35
30
|
const { serverConfig } = useServerConfigStore();
|
36
31
|
|
@@ -81,26 +76,6 @@ const StoreInitialization = memo(() => {
|
|
81
76
|
useStoreUpdater('isMobile', mobile);
|
82
77
|
useStoreUpdater('router', router);
|
83
78
|
|
84
|
-
// Import settings from the url
|
85
|
-
const [searchParam] = useQueryState(LOBE_URL_IMPORT_NAME, {
|
86
|
-
clearOnDefault: true,
|
87
|
-
defaultValue: '',
|
88
|
-
});
|
89
|
-
|
90
|
-
useEffect(() => {
|
91
|
-
// Why use `usUserStateInit`,
|
92
|
-
// see: https://github.com/lobehub/lobe-chat/pull/4072
|
93
|
-
if (searchParam && isUserStateInit) importUrlShareSettings(searchParam);
|
94
|
-
}, [searchParam, isUserStateInit]);
|
95
|
-
|
96
|
-
useEffect(() => {
|
97
|
-
if (mobile) {
|
98
|
-
router.prefetch('/me');
|
99
|
-
} else {
|
100
|
-
router.prefetch('/chat/settings/modal');
|
101
|
-
}
|
102
|
-
}, [router, mobile]);
|
103
|
-
|
104
79
|
return null;
|
105
80
|
});
|
106
81
|
|
@@ -9,6 +9,7 @@ import { getAntdLocale } from '@/utils/locale';
|
|
9
9
|
|
10
10
|
import AntdV5MonkeyPatch from './AntdV5MonkeyPatch';
|
11
11
|
import AppTheme from './AppTheme';
|
12
|
+
import ImportSettings from './ImportSettings';
|
12
13
|
import Locale from './Locale';
|
13
14
|
import QueryProvider from './Query';
|
14
15
|
import ReactScan from './ReactScan';
|
@@ -54,8 +55,9 @@ const GlobalLayout = async ({
|
|
54
55
|
serverConfig={serverConfig}
|
55
56
|
>
|
56
57
|
<QueryProvider>{children}</QueryProvider>
|
58
|
+
<StoreInitialization />
|
57
59
|
<Suspense>
|
58
|
-
<
|
60
|
+
<ImportSettings />
|
59
61
|
<ReactScan />
|
60
62
|
{process.env.NODE_ENV === 'development' && <DevPanel />}
|
61
63
|
</Suspense>
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|