@lobehub/chat 0.162.23 → 0.162.25
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 +51 -0
- package/README.md +8 -8
- package/README.zh-CN.md +8 -8
- package/docs/self-hosting/platform/zeabur.mdx +1 -1
- package/docs/self-hosting/platform/zeabur.zh-CN.mdx +1 -1
- package/locales/ar/common.json +28 -1
- package/locales/bg-BG/common.json +28 -1
- package/locales/de-DE/common.json +28 -1
- package/locales/en-US/common.json +28 -1
- package/locales/es-ES/common.json +28 -1
- package/locales/fr-FR/common.json +28 -1
- package/locales/it-IT/common.json +28 -1
- package/locales/ja-JP/common.json +28 -1
- package/locales/ko-KR/common.json +28 -1
- package/locales/nl-NL/common.json +28 -1
- package/locales/pl-PL/common.json +28 -1
- package/locales/pt-BR/common.json +28 -1
- package/locales/ru-RU/common.json +28 -1
- package/locales/tr-TR/common.json +28 -1
- package/locales/vi-VN/common.json +28 -1
- package/locales/zh-CN/common.json +28 -1
- package/locales/zh-TW/common.json +28 -1
- package/package.json +2 -2
- package/src/app/(main)/settings/@category/default.tsx +1 -2
- package/src/app/(main)/settings/_layout/Desktop/index.tsx +4 -1
- package/src/app/(main)/settings/_layout/Mobile/index.tsx +7 -1
- package/src/app/(main)/settings/about/features/AboutList.tsx +13 -120
- package/src/app/(main)/settings/about/features/Analytics.tsx +1 -1
- package/src/app/(main)/settings/about/features/ItemCard.tsx +45 -0
- package/src/app/(main)/settings/about/features/ItemLink.tsx +32 -0
- package/src/app/(main)/settings/about/features/Version.tsx +75 -0
- package/src/app/(main)/settings/about/index.tsx +118 -25
- package/src/app/(main)/settings/features/Footer.tsx +80 -10
- package/src/app/(main)/settings/llm/components/Footer.tsx +14 -5
- package/src/app/(main)/settings/llm/components/ProviderConfig/index.tsx +11 -1
- package/src/app/(main)/settings/llm/index.tsx +3 -0
- package/src/app/(main)/settings/system-agent/page.tsx +11 -11
- package/src/app/@modal/_layout/SettingModalLayout.tsx +4 -2
- package/src/app/api/middleware/auth/index.ts +1 -1
- package/src/components/GuideModal/index.tsx +77 -0
- package/src/components/GuideVideo/index.tsx +30 -0
- package/src/const/url.ts +6 -1
- package/src/features/AgentSetting/AgentModal/index.tsx +6 -7
- package/src/features/Conversation/Error/OllamaBizError/SetupGuide.tsx +177 -173
- package/src/features/Conversation/Error/style.tsx +56 -31
- package/src/features/User/UserPanel/useMenu.tsx +2 -2
- package/src/locales/default/common.ts +27 -2
- package/src/services/ollama.ts +2 -2
- package/src/store/user/slices/modelList/selectors/keyVaults.test.ts +201 -0
- package/src/store/user/slices/modelList/selectors/keyVaults.ts +15 -3
- package/src/store/user/slices/modelList/selectors/modelConfig.test.ts +29 -1
- package/src/store/user/slices/modelList/selectors/modelConfig.ts +21 -1
- package/src/types/user/settings/keyVaults.ts +1 -1
- package/src/app/(main)/settings/about/features/Item.tsx +0 -50
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
import { metadataModule } from '@/server/metadata';
|
|
2
|
+
import { translation } from '@/server/translation';
|
|
3
3
|
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
4
|
+
export const generateMetadata = async () => {
|
|
5
|
+
const { t } = await translation('setting');
|
|
6
|
+
|
|
7
|
+
return metadataModule.generate({
|
|
8
|
+
description: t('header.desc'),
|
|
9
|
+
title: t('tab.systemAgent'),
|
|
10
|
+
url: '/settings/system-agent',
|
|
11
|
+
});
|
|
12
|
+
};
|
|
13
13
|
|
|
14
14
|
export { default } from './index';
|
|
@@ -6,6 +6,7 @@ import { Flexbox } from 'react-layout-kit';
|
|
|
6
6
|
|
|
7
7
|
import Header from '@/app/(main)/settings/_layout/Desktop/Header';
|
|
8
8
|
import SideBar from '@/app/(main)/settings/_layout/Desktop/SideBar';
|
|
9
|
+
import Footer from '@/app/(main)/settings/features/Footer';
|
|
9
10
|
|
|
10
11
|
interface SettingLayoutProps {
|
|
11
12
|
activeTitle?: ReactNode;
|
|
@@ -42,6 +43,7 @@ const SettingModalLayout = memo<SettingLayoutProps>(
|
|
|
42
43
|
<Flexbox
|
|
43
44
|
align={'center'}
|
|
44
45
|
gap={mobile ? 0 : 64}
|
|
46
|
+
paddingInline={mobile ? 0 : 56}
|
|
45
47
|
ref={ref}
|
|
46
48
|
style={{
|
|
47
49
|
background: mobile
|
|
@@ -52,12 +54,12 @@ const SettingModalLayout = memo<SettingLayoutProps>(
|
|
|
52
54
|
minHeight: '100%',
|
|
53
55
|
overflowX: 'hidden',
|
|
54
56
|
overflowY: 'auto',
|
|
55
|
-
|
|
56
|
-
paddingInline: mobile ? 0 : 56,
|
|
57
|
+
paddingTop: mobile ? 0 : 40,
|
|
57
58
|
}}
|
|
58
59
|
width={'100%'}
|
|
59
60
|
>
|
|
60
61
|
{children}
|
|
62
|
+
<Footer />
|
|
61
63
|
</Flexbox>
|
|
62
64
|
</Flexbox>
|
|
63
65
|
);
|
|
@@ -10,7 +10,7 @@ import { ChatErrorType } from '@/types/fetch';
|
|
|
10
10
|
import { checkAuthMethod, getJWTPayload } from './utils';
|
|
11
11
|
|
|
12
12
|
type CreateRuntime = (jwtPayload: JWTPayload) => AgentRuntime;
|
|
13
|
-
type RequestOptions = { createRuntime?: CreateRuntime
|
|
13
|
+
type RequestOptions = { createRuntime?: CreateRuntime; params: { provider: string } };
|
|
14
14
|
|
|
15
15
|
export type RequestHandler = (
|
|
16
16
|
req: Request,
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
3
|
+
import { ConfigProvider, Modal, type ModalProps } from 'antd';
|
|
4
|
+
import { createStyles } from 'antd-style';
|
|
5
|
+
import { lighten } from 'polished';
|
|
6
|
+
import { ReactNode, memo } from 'react';
|
|
7
|
+
import { Flexbox } from 'react-layout-kit';
|
|
8
|
+
|
|
9
|
+
const useStyles = createStyles(({ css, token, prefixCls }) => {
|
|
10
|
+
return {
|
|
11
|
+
content: css`
|
|
12
|
+
.${prefixCls}-modal-footer {
|
|
13
|
+
margin: 0;
|
|
14
|
+
padding: 16px;
|
|
15
|
+
}
|
|
16
|
+
.${prefixCls}-modal-header {
|
|
17
|
+
display: flex;
|
|
18
|
+
gap: 4px;
|
|
19
|
+
align-items: center;
|
|
20
|
+
justify-content: center;
|
|
21
|
+
|
|
22
|
+
height: 56px;
|
|
23
|
+
margin-block-end: 0;
|
|
24
|
+
padding: 16px;
|
|
25
|
+
}
|
|
26
|
+
.${prefixCls}-modal-content {
|
|
27
|
+
overflow: hidden;
|
|
28
|
+
padding: 0;
|
|
29
|
+
border: 1px solid ${token.colorSplit};
|
|
30
|
+
border-radius: ${token.borderRadiusLG}px;
|
|
31
|
+
}
|
|
32
|
+
`,
|
|
33
|
+
wrap: css`
|
|
34
|
+
overflow: hidden auto;
|
|
35
|
+
backdrop-filter: blur(2px);
|
|
36
|
+
`,
|
|
37
|
+
};
|
|
38
|
+
});
|
|
39
|
+
|
|
40
|
+
interface GuideModalProps extends ModalProps {
|
|
41
|
+
cover: ReactNode;
|
|
42
|
+
desc: ReactNode;
|
|
43
|
+
title: ReactNode;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
const GuideModal = memo<GuideModalProps>(
|
|
47
|
+
({ className, title, desc, cover, width = 360, ...rest }) => {
|
|
48
|
+
const { styles, cx, theme } = useStyles();
|
|
49
|
+
return (
|
|
50
|
+
<ConfigProvider
|
|
51
|
+
theme={{
|
|
52
|
+
token: {
|
|
53
|
+
colorBgElevated: lighten(0.005, theme.colorBgContainer),
|
|
54
|
+
},
|
|
55
|
+
}}
|
|
56
|
+
>
|
|
57
|
+
<Modal
|
|
58
|
+
centered
|
|
59
|
+
className={cx(styles.content, className)}
|
|
60
|
+
closable={false}
|
|
61
|
+
maskClosable
|
|
62
|
+
width={width}
|
|
63
|
+
wrapClassName={styles.wrap}
|
|
64
|
+
{...rest}
|
|
65
|
+
>
|
|
66
|
+
{cover}
|
|
67
|
+
<Flexbox padding={16}>
|
|
68
|
+
<h3 style={{ fontWeight: 'bold' }}>{title}</h3>
|
|
69
|
+
<p style={{ marginBottom: 0 }}>{desc}</p>
|
|
70
|
+
</Flexbox>
|
|
71
|
+
</Modal>
|
|
72
|
+
</ConfigProvider>
|
|
73
|
+
);
|
|
74
|
+
},
|
|
75
|
+
);
|
|
76
|
+
|
|
77
|
+
export default GuideModal;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { useTheme } from 'antd-style';
|
|
2
|
+
import { memo } from 'react';
|
|
3
|
+
|
|
4
|
+
interface GuideVideoProps {
|
|
5
|
+
height: number;
|
|
6
|
+
src: string;
|
|
7
|
+
width: number;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
const GuideVideo = memo<GuideVideoProps>(({ height, width, src }) => {
|
|
11
|
+
const theme = useTheme();
|
|
12
|
+
return (
|
|
13
|
+
<video
|
|
14
|
+
autoPlay
|
|
15
|
+
controls={false}
|
|
16
|
+
height={height}
|
|
17
|
+
loop
|
|
18
|
+
muted
|
|
19
|
+
src={src}
|
|
20
|
+
style={{
|
|
21
|
+
background: theme.colorFillSecondary,
|
|
22
|
+
height: 'auto',
|
|
23
|
+
width: '100%',
|
|
24
|
+
}}
|
|
25
|
+
width={width}
|
|
26
|
+
/>
|
|
27
|
+
);
|
|
28
|
+
});
|
|
29
|
+
|
|
30
|
+
export default GuideVideo;
|
package/src/const/url.ts
CHANGED
|
@@ -12,7 +12,7 @@ export const OFFICIAL_SITE = 'https://lobehub.com/';
|
|
|
12
12
|
export const getCanonicalUrl = (path: string) => urlJoin(OFFICIAL_URL, path);
|
|
13
13
|
|
|
14
14
|
export const GITHUB = pkg.homepage;
|
|
15
|
-
export const GITHUB_ISSUES = urlJoin(GITHUB, 'issues/new');
|
|
15
|
+
export const GITHUB_ISSUES = urlJoin(GITHUB, 'issues/new/choose');
|
|
16
16
|
export const CHANGELOG = urlJoin(GITHUB, 'blob/main/CHANGELOG.md');
|
|
17
17
|
export const DOCKER_IMAGE = 'https://hub.docker.com/r/lobehub/lobe-chat';
|
|
18
18
|
|
|
@@ -55,3 +55,8 @@ export const EMAIL_BUSINESS = 'hello@lobehub.com';
|
|
|
55
55
|
export const MEDIDUM = 'https://medium.com/@lobehub';
|
|
56
56
|
export const X = 'https://x.com/lobehub';
|
|
57
57
|
export const RELEASES_URL = urlJoin(GITHUB, 'releases');
|
|
58
|
+
|
|
59
|
+
export const R2_CDN_URL = 'https://hub-apac-1.lobeobjects.space/';
|
|
60
|
+
|
|
61
|
+
export const getR2Url = (filename: string) => urlJoin(R2_CDN_URL, filename);
|
|
62
|
+
export const mailTo = (email: string) => `mailto:${email}`;
|
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
|
|
3
3
|
import { Form, ItemGroup, SliderWithInput } from '@lobehub/ui';
|
|
4
4
|
import { Switch } from 'antd';
|
|
5
|
-
import { debounce } from 'lodash-es';
|
|
6
5
|
import { memo } from 'react';
|
|
7
6
|
import { useTranslation } from 'react-i18next';
|
|
8
7
|
|
|
@@ -17,10 +16,10 @@ const AgentModal = memo(() => {
|
|
|
17
16
|
const { t } = useTranslation('setting');
|
|
18
17
|
const [form] = Form.useForm();
|
|
19
18
|
|
|
20
|
-
const [enableMaxTokens, updateConfig] = useStore((s) =>
|
|
21
|
-
selectors.chatConfig(s)
|
|
22
|
-
s.setAgentConfig
|
|
23
|
-
|
|
19
|
+
const [enableMaxTokens, updateConfig] = useStore((s) => {
|
|
20
|
+
const config = selectors.chatConfig(s);
|
|
21
|
+
return [config.enableMaxTokens, s.setAgentConfig];
|
|
22
|
+
});
|
|
24
23
|
|
|
25
24
|
useAgentSyncSettings(form);
|
|
26
25
|
|
|
@@ -65,7 +64,7 @@ const AgentModal = memo(() => {
|
|
|
65
64
|
children: <Switch />,
|
|
66
65
|
label: t('settingModel.enableMaxTokens.title'),
|
|
67
66
|
minWidth: undefined,
|
|
68
|
-
name: 'enableMaxTokens',
|
|
67
|
+
name: ['chatConfig', 'enableMaxTokens'],
|
|
69
68
|
valuePropName: 'checked',
|
|
70
69
|
},
|
|
71
70
|
{
|
|
@@ -86,7 +85,7 @@ const AgentModal = memo(() => {
|
|
|
86
85
|
form={form}
|
|
87
86
|
items={[model]}
|
|
88
87
|
itemsType={'group'}
|
|
89
|
-
onValuesChange={
|
|
88
|
+
onValuesChange={updateConfig}
|
|
90
89
|
variant={'pure'}
|
|
91
90
|
{...FORM_STYLE}
|
|
92
91
|
/>
|
|
@@ -7,6 +7,8 @@ import { memo } from 'react';
|
|
|
7
7
|
import { Trans, useTranslation } from 'react-i18next';
|
|
8
8
|
import { Flexbox } from 'react-layout-kit';
|
|
9
9
|
|
|
10
|
+
import { ErrorActionContainer } from '@/features/Conversation/Error/style';
|
|
11
|
+
|
|
10
12
|
const useStyles = createStyles(({ css, prefixCls, token }) => ({
|
|
11
13
|
steps: css`
|
|
12
14
|
margin-top: 32px;
|
|
@@ -30,187 +32,189 @@ const SetupGuide = memo(() => {
|
|
|
30
32
|
const { styles } = useStyles();
|
|
31
33
|
const { t } = useTranslation('modelProvider');
|
|
32
34
|
return (
|
|
33
|
-
<
|
|
34
|
-
|
|
35
|
-
{
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
{
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
{
|
|
35
|
+
<ErrorActionContainer style={{ paddingBlock: 0 }}>
|
|
36
|
+
<TabsNav
|
|
37
|
+
items={[
|
|
38
|
+
{
|
|
39
|
+
children: (
|
|
40
|
+
<Steps
|
|
41
|
+
className={styles.steps}
|
|
42
|
+
direction={'vertical'}
|
|
43
|
+
items={[
|
|
44
|
+
{
|
|
45
|
+
description: (
|
|
46
|
+
<Trans i18nKey={'ollama.setup.install.description'} ns={'modelProvider'}>
|
|
47
|
+
请确认你已经开启 Ollama ,如果没有安装 Ollama ,请前往官网
|
|
48
|
+
<Link href={'https://ollama.com/download'}>下载</Link>
|
|
49
|
+
</Trans>
|
|
50
|
+
),
|
|
51
|
+
status: 'process',
|
|
52
|
+
title: t('ollama.setup.install.title'),
|
|
53
|
+
},
|
|
54
|
+
{
|
|
55
|
+
description: (
|
|
56
|
+
<Flexbox gap={8}>
|
|
57
|
+
{t('ollama.setup.cors.description')}
|
|
55
58
|
|
|
59
|
+
<Flexbox gap={8}>
|
|
60
|
+
{t('ollama.setup.cors.macos')}
|
|
61
|
+
<Snippet language={'bash'}>
|
|
62
|
+
{/* eslint-disable-next-line react/no-unescaped-entities */}
|
|
63
|
+
launchctl setenv OLLAMA_ORIGINS "*"
|
|
64
|
+
</Snippet>
|
|
65
|
+
{t('ollama.setup.cors.reboot')}
|
|
66
|
+
</Flexbox>
|
|
67
|
+
</Flexbox>
|
|
68
|
+
),
|
|
69
|
+
status: 'process',
|
|
70
|
+
title: t('ollama.setup.cors.title'),
|
|
71
|
+
},
|
|
72
|
+
]}
|
|
73
|
+
size={'small'}
|
|
74
|
+
/>
|
|
75
|
+
),
|
|
76
|
+
key: 'macos',
|
|
77
|
+
label: 'macOS',
|
|
78
|
+
},
|
|
79
|
+
{
|
|
80
|
+
children: (
|
|
81
|
+
<Steps
|
|
82
|
+
className={styles.steps}
|
|
83
|
+
direction={'vertical'}
|
|
84
|
+
items={[
|
|
85
|
+
{
|
|
86
|
+
description: (
|
|
87
|
+
<Trans i18nKey={'ollama.setup.install.description'} ns={'modelProvider'}>
|
|
88
|
+
请确认你已经开启 Ollama ,如果没有安装 Ollama ,请前往官网
|
|
89
|
+
<Link href={'https://ollama.com/download'}>下载</Link>
|
|
90
|
+
</Trans>
|
|
91
|
+
),
|
|
92
|
+
status: 'process',
|
|
93
|
+
title: t('ollama.setup.install.title'),
|
|
94
|
+
},
|
|
95
|
+
{
|
|
96
|
+
description: (
|
|
97
|
+
<Flexbox gap={8}>
|
|
98
|
+
{t('ollama.setup.cors.description')}
|
|
99
|
+
<div>{t('ollama.setup.cors.windows')}</div>
|
|
100
|
+
<div>{t('ollama.setup.cors.reboot')}</div>
|
|
101
|
+
</Flexbox>
|
|
102
|
+
),
|
|
103
|
+
status: 'process',
|
|
104
|
+
title: t('ollama.setup.cors.title'),
|
|
105
|
+
},
|
|
106
|
+
]}
|
|
107
|
+
size={'small'}
|
|
108
|
+
/>
|
|
109
|
+
),
|
|
110
|
+
key: 'windows',
|
|
111
|
+
label: t('ollama.setup.install.windowsTab'),
|
|
112
|
+
},
|
|
113
|
+
{
|
|
114
|
+
children: (
|
|
115
|
+
<Steps
|
|
116
|
+
className={styles.steps}
|
|
117
|
+
direction={'vertical'}
|
|
118
|
+
items={[
|
|
119
|
+
{
|
|
120
|
+
description: (
|
|
56
121
|
<Flexbox gap={8}>
|
|
57
|
-
{t('ollama.setup.
|
|
122
|
+
{t('ollama.setup.install.linux.command')}
|
|
58
123
|
<Snippet language={'bash'}>
|
|
59
|
-
|
|
60
|
-
launchctl setenv OLLAMA_ORIGINS "*"
|
|
124
|
+
curl -fsSL https://ollama.com/install.sh | sh
|
|
61
125
|
</Snippet>
|
|
62
|
-
|
|
126
|
+
<div>
|
|
127
|
+
<Trans i18nKey={'ollama.setup.install.linux.manual'} ns={'modelProvider'}>
|
|
128
|
+
或者,你也可以参考
|
|
129
|
+
<Link href={'https://github.com/ollama/ollama/blob/main/docs/linux.md'}>
|
|
130
|
+
Linux 手动安装指南
|
|
131
|
+
</Link>
|
|
132
|
+
。
|
|
133
|
+
</Trans>
|
|
134
|
+
</div>
|
|
63
135
|
</Flexbox>
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
),
|
|
73
|
-
key: 'macos',
|
|
74
|
-
label: 'macOS',
|
|
75
|
-
},
|
|
76
|
-
{
|
|
77
|
-
children: (
|
|
78
|
-
<Steps
|
|
79
|
-
className={styles.steps}
|
|
80
|
-
direction={'vertical'}
|
|
81
|
-
items={[
|
|
82
|
-
{
|
|
83
|
-
description: (
|
|
84
|
-
<Trans i18nKey={'ollama.setup.install.description'} ns={'modelProvider'}>
|
|
85
|
-
请确认你已经开启 Ollama ,如果没有安装 Ollama ,请前往官网
|
|
86
|
-
<Link href={'https://ollama.com/download'}>下载</Link>
|
|
87
|
-
</Trans>
|
|
88
|
-
),
|
|
89
|
-
status: 'process',
|
|
90
|
-
title: t('ollama.setup.install.title'),
|
|
91
|
-
},
|
|
92
|
-
{
|
|
93
|
-
description: (
|
|
94
|
-
<Flexbox gap={8}>
|
|
95
|
-
{t('ollama.setup.cors.description')}
|
|
96
|
-
<div>{t('ollama.setup.cors.windows')}</div>
|
|
97
|
-
<div>{t('ollama.setup.cors.reboot')}</div>
|
|
98
|
-
</Flexbox>
|
|
99
|
-
),
|
|
100
|
-
status: 'process',
|
|
101
|
-
title: t('ollama.setup.cors.title'),
|
|
102
|
-
},
|
|
103
|
-
]}
|
|
104
|
-
size={'small'}
|
|
105
|
-
/>
|
|
106
|
-
),
|
|
107
|
-
key: 'windows',
|
|
108
|
-
label: t('ollama.setup.install.windowsTab'),
|
|
109
|
-
},
|
|
110
|
-
{
|
|
111
|
-
children: (
|
|
112
|
-
<Steps
|
|
113
|
-
className={styles.steps}
|
|
114
|
-
direction={'vertical'}
|
|
115
|
-
items={[
|
|
116
|
-
{
|
|
117
|
-
description: (
|
|
118
|
-
<Flexbox gap={8}>
|
|
119
|
-
{t('ollama.setup.install.linux.command')}
|
|
120
|
-
<Snippet language={'bash'}>
|
|
121
|
-
curl -fsSL https://ollama.com/install.sh | sh
|
|
122
|
-
</Snippet>
|
|
123
|
-
<div>
|
|
124
|
-
<Trans i18nKey={'ollama.setup.install.linux.manual'} ns={'modelProvider'}>
|
|
125
|
-
或者,你也可以参考
|
|
126
|
-
<Link href={'https://github.com/ollama/ollama/blob/main/docs/linux.md'}>
|
|
127
|
-
Linux 手动安装指南
|
|
128
|
-
</Link>
|
|
129
|
-
。
|
|
130
|
-
</Trans>
|
|
131
|
-
</div>
|
|
132
|
-
</Flexbox>
|
|
133
|
-
),
|
|
134
|
-
status: 'process',
|
|
135
|
-
title: t('ollama.setup.install.title'),
|
|
136
|
-
},
|
|
137
|
-
{
|
|
138
|
-
description: (
|
|
139
|
-
<Flexbox gap={8}>
|
|
140
|
-
<div>{t('ollama.setup.cors.description')}</div>
|
|
136
|
+
),
|
|
137
|
+
status: 'process',
|
|
138
|
+
title: t('ollama.setup.install.title'),
|
|
139
|
+
},
|
|
140
|
+
{
|
|
141
|
+
description: (
|
|
142
|
+
<Flexbox gap={8}>
|
|
143
|
+
<div>{t('ollama.setup.cors.description')}</div>
|
|
141
144
|
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
145
|
+
<div>{t('ollama.setup.cors.linux.systemd')}</div>
|
|
146
|
+
{/* eslint-disable-next-line react/no-unescaped-entities */}
|
|
147
|
+
<Snippet language={'bash'}> sudo systemctl edit ollama.service</Snippet>
|
|
148
|
+
{t('ollama.setup.cors.linux.env')}
|
|
149
|
+
<Highlighter
|
|
150
|
+
// eslint-disable-next-line react/no-children-prop
|
|
151
|
+
children={`[Service]
|
|
149
152
|
|
|
150
153
|
Environment="OLLAMA_ORIGINS=*"`}
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
154
|
+
fileName={'ollama.service'}
|
|
155
|
+
fullFeatured
|
|
156
|
+
language={'bash'}
|
|
157
|
+
showLanguage
|
|
158
|
+
/>
|
|
159
|
+
{t('ollama.setup.cors.linux.reboot')}
|
|
160
|
+
</Flexbox>
|
|
161
|
+
),
|
|
162
|
+
status: 'process',
|
|
163
|
+
title: t('ollama.setup.cors.title'),
|
|
164
|
+
},
|
|
165
|
+
]}
|
|
166
|
+
size={'small'}
|
|
167
|
+
/>
|
|
168
|
+
),
|
|
169
|
+
key: 'linux',
|
|
170
|
+
label: 'Linux',
|
|
171
|
+
},
|
|
172
|
+
{
|
|
173
|
+
children: (
|
|
174
|
+
<Steps
|
|
175
|
+
className={styles.steps}
|
|
176
|
+
direction={'vertical'}
|
|
177
|
+
items={[
|
|
178
|
+
{
|
|
179
|
+
description: (
|
|
180
|
+
<Flexbox gap={8}>
|
|
181
|
+
{t('ollama.setup.install.description')}
|
|
182
|
+
<div>{t('ollama.setup.install.docker')}</div>
|
|
183
|
+
<Snippet language={'bash'}>docker pull ollama/ollama</Snippet>
|
|
184
|
+
</Flexbox>
|
|
185
|
+
),
|
|
186
|
+
status: 'process',
|
|
187
|
+
title: t('ollama.setup.install.title'),
|
|
188
|
+
},
|
|
189
|
+
{
|
|
190
|
+
description: (
|
|
191
|
+
<Flexbox gap={8}>
|
|
192
|
+
{t('ollama.setup.cors.description')}
|
|
193
|
+
<Highlighter
|
|
194
|
+
fileName={'ollama.service'}
|
|
195
|
+
fullFeatured
|
|
196
|
+
language={'bash'}
|
|
197
|
+
showLanguage
|
|
198
|
+
>
|
|
199
|
+
{/* eslint-disable-next-line react/no-unescaped-entities */}
|
|
200
|
+
docker run -d --gpus=all -v ollama:/root/.ollama -e OLLAMA_ORIGINS="*" -p
|
|
201
|
+
11434:11434 --name ollama ollama/ollama
|
|
202
|
+
</Highlighter>
|
|
203
|
+
</Flexbox>
|
|
204
|
+
),
|
|
205
|
+
status: 'process',
|
|
206
|
+
title: t('ollama.setup.cors.title'),
|
|
207
|
+
},
|
|
208
|
+
]}
|
|
209
|
+
size={'small'}
|
|
210
|
+
/>
|
|
211
|
+
),
|
|
212
|
+
key: 'docker',
|
|
213
|
+
label: 'Docker',
|
|
214
|
+
},
|
|
215
|
+
]}
|
|
216
|
+
/>
|
|
217
|
+
</ErrorActionContainer>
|
|
214
218
|
);
|
|
215
219
|
});
|
|
216
220
|
|