@lobehub/chat 0.145.8 → 0.145.9
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 +25 -0
- package/docs/self-hosting/advanced/sso-providers/auth0.mdx +7 -7
- package/docs/self-hosting/advanced/sso-providers/auth0.zh-CN.mdx +7 -7
- package/package.json +1 -1
- package/src/app/chat/features/TopicListContent/Topic/index.tsx +8 -1
- package/src/app/chat/features/TopicListContent/index.tsx +1 -6
- package/src/layout/GlobalProvider/AppTheme.tsx +36 -2
- package/src/styles/global.ts +3 -15
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,31 @@
|
|
|
2
2
|
|
|
3
3
|
# Changelog
|
|
4
4
|
|
|
5
|
+
### [Version 0.145.9](https://github.com/lobehub/lobe-chat/compare/v0.145.8...v0.145.9)
|
|
6
|
+
|
|
7
|
+
<sup>Released on **2024-04-02**</sup>
|
|
8
|
+
|
|
9
|
+
#### 💄 Styles
|
|
10
|
+
|
|
11
|
+
- **misc**: Improve scrollbar style.
|
|
12
|
+
|
|
13
|
+
<br/>
|
|
14
|
+
|
|
15
|
+
<details>
|
|
16
|
+
<summary><kbd>Improvements and Fixes</kbd></summary>
|
|
17
|
+
|
|
18
|
+
#### Styles
|
|
19
|
+
|
|
20
|
+
- **misc**: Improve scrollbar style, closes [#1869](https://github.com/lobehub/lobe-chat/issues/1869) ([33d857f](https://github.com/lobehub/lobe-chat/commit/33d857f))
|
|
21
|
+
|
|
22
|
+
</details>
|
|
23
|
+
|
|
24
|
+
<div align="right">
|
|
25
|
+
|
|
26
|
+
[](#readme-top)
|
|
27
|
+
|
|
28
|
+
</div>
|
|
29
|
+
|
|
5
30
|
### [Version 0.145.8](https://github.com/lobehub/lobe-chat/compare/v0.145.7...v0.145.8)
|
|
6
31
|
|
|
7
32
|
<sup>Released on **2024-04-02**</sup>
|
|
@@ -5,15 +5,15 @@
|
|
|
5
5
|
|
|
6
6
|
Register and log in to [Auth0][auth0-client-page], click on the "Applications" in the left navigation bar to switch to the application management interface, and click "Create Application" in the upper right corner to create an application.
|
|
7
7
|
|
|
8
|
-
<Image alt="Create Auth0 Application S1" inStep src="
|
|
8
|
+
<Image alt="Create Auth0 Application S1" inStep src="https://github.com/lobehub/lobe-chat/assets/30863298/f068190f-0027-4d3b-8667-d632e43d5a86" />
|
|
9
9
|
|
|
10
10
|
Fill in the application name you want to display to the organization users, choose any application type, and click "Create".
|
|
11
11
|
|
|
12
|
-
<Image alt="Create Auth0 Application S2" inStep src="https://github.com/
|
|
12
|
+
<Image alt="Create Auth0 Application S2" inStep src="https://github.com/lobehub/lobe-chat/assets/30863298/3e0082df-9b6f-46f3-b67f-bdc79e1eb2cc" />
|
|
13
13
|
|
|
14
14
|
After successful creation, click on the corresponding application to enter the application details page, switch to the "Settings" tab, and you can see the corresponding configuration information.
|
|
15
15
|
|
|
16
|
-
<Image alt="Create Auth0 Application S3" inStep src="https://github.com/
|
|
16
|
+
<Image alt="Create Auth0 Application S3" inStep src="https://github.com/lobehub/lobe-chat/assets/30863298/df4cea85-616a-46f5-b2de-42725d9b82a6" />
|
|
17
17
|
|
|
18
18
|
In the application configuration page, you also need to configure Allowed Callback URLs, where you should fill in:
|
|
19
19
|
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
http(s)://your-domain/api/auth/callback/auth0
|
|
22
22
|
```
|
|
23
23
|
|
|
24
|
-
<Image alt="Create Auth0 Application S4" inStep src="https://github.com/
|
|
24
|
+
<Image alt="Create Auth0 Application S4" inStep src="https://github.com/lobehub/lobe-chat/assets/30863298/62fbd09f-a69a-4460-949b-0f6285fa65b9" />
|
|
25
25
|
|
|
26
26
|
<Callout type={'important'}>
|
|
27
27
|
You can fill in or modify Allowed Callback URLs after deployment, but make sure the filled URL is
|
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
|
|
33
33
|
Click on the "Users Management" in the left navigation bar to enter the user management interface, where you can create users for your organization to log in to LobeChat.
|
|
34
34
|
|
|
35
|
-
<Image alt="Add Users" inStep src="https://github.com/
|
|
35
|
+
<Image alt="Add Users" inStep src="https://github.com/lobehub/lobe-chat/assets/30863298/0beda150-d0b6-43cf-a9f1-fce928b83a96" />
|
|
36
36
|
|
|
37
37
|
### Configure Environment Variables
|
|
38
38
|
|
|
@@ -67,13 +67,13 @@ If your enterprise or organization already has a unified identity authentication
|
|
|
67
67
|
|
|
68
68
|
Auth0 supports single sign-on services such as Azure Active Directory, Slack, Google Workspace, Office 365, Zoom, and more. For a detailed list of supported services, please refer to [this link][auth0-sso-integrations].
|
|
69
69
|
|
|
70
|
-
<Image alt="Connecting to an Existing Single Sign-On Service" src="https://github.com/
|
|
70
|
+
<Image alt="Connecting to an Existing Single Sign-On Service" src="https://github.com/lobehub/lobe-chat/assets/30863298/9891347e-a338-4aa9-8714-f16c8dbcfcec" />
|
|
71
71
|
|
|
72
72
|
### Configuring Social Login
|
|
73
73
|
|
|
74
74
|
If your enterprise or organization needs to support external user logins, you can configure social login services in Authentication -> Social.
|
|
75
75
|
|
|
76
|
-
<Image alt="Configuring Social Login" src="https://github.com/
|
|
76
|
+
<Image alt="Configuring Social Login" src="https://github.com/lobehub/lobe-chat/assets/30863298/880749a6-5ba4-4e20-a968-b583a54de7fa" />
|
|
77
77
|
|
|
78
78
|
<Callout type={'warning'}>
|
|
79
79
|
Configuring social login services by default allows anyone to authenticate, which may lead to
|
|
@@ -5,15 +5,15 @@
|
|
|
5
5
|
|
|
6
6
|
注册并登录 [Auth0][auth0-client-page],点击左侧导航栏的「Applications」,切换到应用管理界面,点击右上角「Create Application」以创建应用。
|
|
7
7
|
|
|
8
|
-
<Image alt="创建 Auth0 应用 S1" inStep src="
|
|
8
|
+
<Image alt="创建 Auth0 应用 S1" inStep src="https://github.com/lobehub/lobe-chat/assets/30863298/f068190f-0027-4d3b-8667-d632e43d5a86" />
|
|
9
9
|
|
|
10
10
|
填写你想向组织用户显示的应用名称,可选择任意应用类型,点击「Create」。
|
|
11
11
|
|
|
12
|
-
<Image alt="创建 Auth0 应用 S2" inStep src="https://github.com/
|
|
12
|
+
<Image alt="创建 Auth0 应用 S2" inStep src="https://github.com/lobehub/lobe-chat/assets/30863298/3e0082df-9b6f-46f3-b67f-bdc79e1eb2cc" />
|
|
13
13
|
|
|
14
14
|
创建成功后,点击相应的应用,进入应用详情页,切换到「Settings」标签页,就可以看到相应的配置信息
|
|
15
15
|
|
|
16
|
-
<Image alt="创建 Auth0 应用 S3" inStep src="https://github.com/
|
|
16
|
+
<Image alt="创建 Auth0 应用 S3" inStep src="https://github.com/lobehub/lobe-chat/assets/30863298/df4cea85-616a-46f5-b2de-42725d9b82a6" />
|
|
17
17
|
|
|
18
18
|
在应用配置页面中,还需要配置 Allowed Callback URLs,在此处填写:
|
|
19
19
|
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
http(s)://your-domain/api/auth/callback/auth0
|
|
22
22
|
```
|
|
23
23
|
|
|
24
|
-
<Image alt="创建 Auth0 应用 S4" inStep src="https://github.com/
|
|
24
|
+
<Image alt="创建 Auth0 应用 S4" inStep src="https://github.com/lobehub/lobe-chat/assets/30863298/62fbd09f-a69a-4460-949b-0f6285fa65b9" />
|
|
25
25
|
|
|
26
26
|
<Callout type={'important'}>
|
|
27
27
|
可以在部署后再填写或修改 Allowed Callback URLs,但是务必保证填写的 URL 与部署的 URL 一致
|
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
|
|
32
32
|
点击左侧导航栏的「Users Management」,进入用户管理界面,可以为你的组织新建用户,用以登录 LobeChat
|
|
33
33
|
|
|
34
|
-
<Image alt="新增用户" inStep src="https://github.com/
|
|
34
|
+
<Image alt="新增用户" inStep src="https://github.com/lobehub/lobe-chat/assets/30863298/0beda150-d0b6-43cf-a9f1-fce928b83a96" />
|
|
35
35
|
|
|
36
36
|
### 配置环境变量
|
|
37
37
|
|
|
@@ -63,13 +63,13 @@
|
|
|
63
63
|
|
|
64
64
|
Auth0 支持 Azure Active Directory / Slack / Google Workspace / Office 365 / Zoom 等单点登录服务,详细支持列表可参考 [这里][auth0-sso-integrations]
|
|
65
65
|
|
|
66
|
-
<Image alt="Connecting to an Existing Single Sign-On Service" src="https://github.com/
|
|
66
|
+
<Image alt="Connecting to an Existing Single Sign-On Service" src="https://github.com/lobehub/lobe-chat/assets/30863298/9891347e-a338-4aa9-8714-f16c8dbcfcec" />
|
|
67
67
|
|
|
68
68
|
### 配置社交登录
|
|
69
69
|
|
|
70
70
|
如果你的企业或组织需要支持外部人员登录,可以在 Authentication -> Social 中,配置社交登录服务。
|
|
71
71
|
|
|
72
|
-
<Image alt="Configuring Social Login" src="https://github.com/
|
|
72
|
+
<Image alt="Configuring Social Login" src="https://github.com/lobehub/lobe-chat/assets/30863298/880749a6-5ba4-4e20-a968-b583a54de7fa" />
|
|
73
73
|
|
|
74
74
|
<Callout type={'warning'}>
|
|
75
75
|
配置社交登录服务默认会允许所有人通过认证,这可能会导致 LobeChat 被外部人员滥用。
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lobehub/chat",
|
|
3
|
-
"version": "0.145.
|
|
3
|
+
"version": "0.145.9",
|
|
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,5 +1,5 @@
|
|
|
1
1
|
import { EmptyCard } from '@lobehub/ui';
|
|
2
|
-
import { useThemeMode } from 'antd-style';
|
|
2
|
+
import { css, cx, useThemeMode } from 'antd-style';
|
|
3
3
|
import isEqual from 'fast-deep-equal';
|
|
4
4
|
import React, { memo, useCallback, useRef } from 'react';
|
|
5
5
|
import { useTranslation } from 'react-i18next';
|
|
@@ -15,6 +15,12 @@ import { ChatTopic } from '@/types/topic';
|
|
|
15
15
|
import { Placeholder, SkeletonList } from './SkeletonList';
|
|
16
16
|
import TopicItem from './TopicItem';
|
|
17
17
|
|
|
18
|
+
const container = css`
|
|
19
|
+
> div {
|
|
20
|
+
padding-inline: 8px;
|
|
21
|
+
}
|
|
22
|
+
`;
|
|
23
|
+
|
|
18
24
|
export const Topic = memo(() => {
|
|
19
25
|
const { t } = useTranslation('chat');
|
|
20
26
|
const virtuosoRef = useRef<VirtuosoHandle>(null);
|
|
@@ -78,6 +84,7 @@ export const Topic = memo(() => {
|
|
|
78
84
|
</Flexbox>
|
|
79
85
|
)}
|
|
80
86
|
<Virtuoso
|
|
87
|
+
className={cx(container)}
|
|
81
88
|
components={{ ScrollSeekPlaceholder: Placeholder }}
|
|
82
89
|
computeItemKey={(_, item) => item.id}
|
|
83
90
|
data={topics}
|
|
@@ -9,12 +9,7 @@ const TopicListContent = memo<{ mobile?: boolean }>(({ mobile }) => {
|
|
|
9
9
|
return (
|
|
10
10
|
<Flexbox gap={mobile ? 8 : 0} height={'100%'} style={{ overflow: 'hidden' }}>
|
|
11
11
|
{mobile ? <TopicSearchBar /> : <Header />}
|
|
12
|
-
<Flexbox
|
|
13
|
-
gap={16}
|
|
14
|
-
height={'100%'}
|
|
15
|
-
paddingInline={mobile ? 0 : 8}
|
|
16
|
-
style={{ paddingTop: 6, position: 'relative' }}
|
|
17
|
-
>
|
|
12
|
+
<Flexbox gap={16} height={'100%'} style={{ paddingTop: 6, position: 'relative' }}>
|
|
18
13
|
<Topic />
|
|
19
14
|
</Flexbox>
|
|
20
15
|
</Flexbox>
|
|
@@ -20,21 +20,55 @@ import { setCookie } from '@/utils/cookie';
|
|
|
20
20
|
|
|
21
21
|
const useStyles = createStyles(({ css, token }) => ({
|
|
22
22
|
bg: css`
|
|
23
|
+
position: relative;
|
|
24
|
+
|
|
23
25
|
overflow-y: hidden;
|
|
26
|
+
overscroll-behavior: none;
|
|
24
27
|
display: flex;
|
|
25
28
|
flex-direction: column;
|
|
26
29
|
align-items: center;
|
|
27
30
|
|
|
28
31
|
height: 100%;
|
|
32
|
+
max-height: 100dvh !important;
|
|
29
33
|
|
|
30
34
|
background: ${token.colorBgLayout};
|
|
31
35
|
`,
|
|
36
|
+
// scrollbar-width and scrollbar-color are supported from Chrome 121
|
|
37
|
+
// https://developer.mozilla.org/en-US/docs/Web/CSS/scrollbar-color
|
|
38
|
+
scrollbar: css`
|
|
39
|
+
scrollbar-color: ${token.colorFill} transparent;
|
|
40
|
+
scrollbar-width: thin;
|
|
41
|
+
`,
|
|
42
|
+
|
|
43
|
+
// so this is a polyfill for older browsers
|
|
44
|
+
scrollbarPolyfill: css`
|
|
45
|
+
::-webkit-scrollbar {
|
|
46
|
+
width: 0.75em;
|
|
47
|
+
height: 0.75em;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
::-webkit-scrollbar-thumb {
|
|
51
|
+
border-radius: 10px;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
:hover::-webkit-scrollbar-thumb {
|
|
55
|
+
background-color: ${token.colorText};
|
|
56
|
+
background-clip: content-box;
|
|
57
|
+
border: 3px solid transparent;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
::-webkit-scrollbar-track {
|
|
61
|
+
background-color: transparent;
|
|
62
|
+
}
|
|
63
|
+
`,
|
|
32
64
|
}));
|
|
33
65
|
|
|
34
66
|
const Container = memo<PropsWithChildren>(({ children }) => {
|
|
35
|
-
const { styles } = useStyles();
|
|
67
|
+
const { styles, cx } = useStyles();
|
|
36
68
|
|
|
37
|
-
return
|
|
69
|
+
return (
|
|
70
|
+
<App className={cx(styles.bg, styles.scrollbar, styles.scrollbarPolyfill)}>{children}</App>
|
|
71
|
+
);
|
|
38
72
|
});
|
|
39
73
|
|
|
40
74
|
export interface AppThemeProps {
|
package/src/styles/global.ts
CHANGED
|
@@ -9,25 +9,13 @@ export default ({ prefixCls }: { prefixCls: string }) => css`
|
|
|
9
9
|
overscroll-behavior: none;
|
|
10
10
|
height: 100% !important;
|
|
11
11
|
max-height: 100dvh !important;
|
|
12
|
+
}
|
|
12
13
|
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
width: 0;
|
|
16
|
-
height: 0;
|
|
17
|
-
}
|
|
14
|
+
* {
|
|
15
|
+
scrollbar-width: thin;
|
|
18
16
|
}
|
|
19
17
|
|
|
20
18
|
p {
|
|
21
19
|
margin-bottom: 0;
|
|
22
20
|
}
|
|
23
|
-
|
|
24
|
-
@media (max-width: 575px) {
|
|
25
|
-
* {
|
|
26
|
-
::-webkit-scrollbar {
|
|
27
|
-
display: none;
|
|
28
|
-
width: 0;
|
|
29
|
-
height: 0;
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
21
|
`;
|