mirror of
https://github.com/labring/FastGPT.git
synced 2025-07-23 21:13:50 +00:00
perf: deploy
This commit is contained in:
@@ -50,13 +50,13 @@ const MermaidBlock = ({ code }: { code: string }) => {
|
|||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
(async () => {
|
(async () => {
|
||||||
if (!code || !ref.current) return;
|
if (!code) return;
|
||||||
try {
|
try {
|
||||||
const formatCode = code.replace(
|
const formatCode = code.replace(
|
||||||
new RegExp(`[${Object.keys(punctuationMap).join('')}]`, 'g'),
|
new RegExp(`[${Object.keys(punctuationMap).join('')}]`, 'g'),
|
||||||
(match) => punctuationMap[match]
|
(match) => punctuationMap[match]
|
||||||
);
|
);
|
||||||
const { svg } = await mermaidAPI.render(`mermaid-${Date.now()}`, formatCode);
|
const { svg } = await mermaid.render(`mermaid-${Date.now()}`, formatCode);
|
||||||
setSvg(svg);
|
setSvg(svg);
|
||||||
} catch (e: any) {
|
} catch (e: any) {
|
||||||
console.log('[Mermaid] ', e?.message);
|
console.log('[Mermaid] ', e?.message);
|
||||||
@@ -101,17 +101,25 @@ const MermaidBlock = ({ code }: { code: string }) => {
|
|||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Box position={'relative'}>
|
<Box
|
||||||
|
position={'relative'}
|
||||||
|
_hover={{
|
||||||
|
'& > .export': {
|
||||||
|
display: 'block'
|
||||||
|
}
|
||||||
|
}}
|
||||||
|
>
|
||||||
<Box
|
<Box
|
||||||
ref={ref}
|
ref={ref}
|
||||||
className={styles.mermaid}
|
className={`${styles.mermaid}`}
|
||||||
minW={'100px'}
|
minW={'100px'}
|
||||||
minH={'50px'}
|
minH={'50px'}
|
||||||
py={4}
|
py={4}
|
||||||
dangerouslySetInnerHTML={{ __html: svg }}
|
dangerouslySetInnerHTML={{ __html: svg }}
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<MyIcon
|
<MyIcon
|
||||||
|
className="export"
|
||||||
|
display={'none'}
|
||||||
name={'export'}
|
name={'export'}
|
||||||
w={'20px'}
|
w={'20px'}
|
||||||
position={'absolute'}
|
position={'absolute'}
|
||||||
@@ -128,4 +136,4 @@ const MermaidBlock = ({ code }: { code: string }) => {
|
|||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
export default memo(MermaidBlock);
|
export default MermaidBlock;
|
||||||
|
@@ -1,8 +1,8 @@
|
|||||||
version: '3.3'
|
version: '3.3'
|
||||||
services:
|
services:
|
||||||
pg:
|
pg:
|
||||||
image: ankane/pgvector:v0.4.2 # dockerhub
|
# image: ankane/pgvector:v0.4.2 # dockerhub
|
||||||
# image: registry.cn-hangzhou.aliyuncs.com/fastgpt/pgvector:v0.4.2 # 阿里云
|
image: registry.cn-hangzhou.aliyuncs.com/fastgpt/pgvector:v0.4.2 # 阿里云
|
||||||
container_name: pg
|
container_name: pg
|
||||||
restart: always
|
restart: always
|
||||||
ports:
|
ports:
|
||||||
@@ -17,8 +17,8 @@ services:
|
|||||||
- /root/fastgpt/pg/init.sql:/docker-entrypoint-initdb.d/init.sh
|
- /root/fastgpt/pg/init.sql:/docker-entrypoint-initdb.d/init.sh
|
||||||
- /root/fastgpt/pg/data:/var/lib/postgresql/data
|
- /root/fastgpt/pg/data:/var/lib/postgresql/data
|
||||||
mongodb:
|
mongodb:
|
||||||
image: mongo:5.0.18
|
# image: mongo:5.0.18
|
||||||
# image : registry.cn-hangzhou.aliyuncs.com/fastgpt/mongo:5.0.18 # 阿里云
|
image: registry.cn-hangzhou.aliyuncs.com/fastgpt/mongo:5.0.18 # 阿里云
|
||||||
container_name: mongo
|
container_name: mongo
|
||||||
restart: always
|
restart: always
|
||||||
ports:
|
ports:
|
||||||
@@ -31,9 +31,9 @@ services:
|
|||||||
- /root/fastgpt/mongo/data:/data/db
|
- /root/fastgpt/mongo/data:/data/db
|
||||||
- /root/fastgpt/mongo/logs:/var/log/mongodb
|
- /root/fastgpt/mongo/logs:/var/log/mongodb
|
||||||
fastgpt:
|
fastgpt:
|
||||||
image: ghcr.io/c121914yu/fastgpt:latest # github
|
# image: ghcr.io/c121914yu/fastgpt:latest # github
|
||||||
# image: c121914yu/fast-gpt:latest # docker hub
|
# image: c121914yu/fast-gpt:latest # docker hub
|
||||||
# image: registry.cn-hangzhou.aliyuncs.com/fastgpt/fastgpt:latest # 阿里云
|
image: registry.cn-hangzhou.aliyuncs.com/fastgpt/fastgpt:latest # 阿里云
|
||||||
network_mode: host
|
network_mode: host
|
||||||
restart: always
|
restart: always
|
||||||
container_name: fastgpt
|
container_name: fastgpt
|
||||||
@@ -76,7 +76,8 @@ services:
|
|||||||
- OPENAI_BASE_URL=https://api.openai.com/v1
|
- OPENAI_BASE_URL=https://api.openai.com/v1
|
||||||
- OPENAI_BASE_URL_AUTH=可选的安全凭证
|
- OPENAI_BASE_URL_AUTH=可选的安全凭证
|
||||||
nginx:
|
nginx:
|
||||||
image: nginx:alpine3.17
|
image: registry.cn-hangzhou.aliyuncs.com/fastgpt/nginx:alpine3.17
|
||||||
|
# image: nginx:alpine3.17
|
||||||
container_name: nginx
|
container_name: nginx
|
||||||
restart: always
|
restart: always
|
||||||
network_mode: host
|
network_mode: host
|
||||||
|
Reference in New Issue
Block a user