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