temp: 暂存更新
This commit is contained in:
parent
ab6c4340f5
commit
c0359c7998
24
docker/Dockerfile
Normal file
24
docker/Dockerfile
Normal file
@ -0,0 +1,24 @@
|
||||
# Use the official Nginx image based on Alpine
|
||||
FROM nginx:alpine
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
# Copy the contents of the dist directory to the Nginx html directory
|
||||
COPY dist/ /default-app/
|
||||
|
||||
# 删除默认的defult.conf
|
||||
RUN rm /etc/nginx/conf.d/default.conf
|
||||
|
||||
COPY default.conf /etc/nginx/conf.d/default.conf
|
||||
|
||||
COPY app-init.sh /app-init.sh
|
||||
RUN chmod +x /app-init.sh
|
||||
|
||||
# Expose port 80
|
||||
EXPOSE 80
|
||||
|
||||
# 使用启动脚本作为 ENTRYPOINT
|
||||
ENTRYPOINT ["/app-init.sh"]
|
||||
|
||||
# Start Nginx
|
||||
# CMD ["nginx", "-g", "daemon off;"]
|
17
docker/app-init.sh
Normal file
17
docker/app-init.sh
Normal file
@ -0,0 +1,17 @@
|
||||
#!/bin/sh
|
||||
|
||||
# 宿主机挂载路径
|
||||
TARGET_DIR="/app"
|
||||
|
||||
# 检查目录是否为空
|
||||
if [ -z "$(ls -A $TARGET_DIR)" ]; then
|
||||
echo "Directory is empty. Copying default content..."
|
||||
cp -r /default-app/* $TARGET_DIR/
|
||||
else
|
||||
echo "Directory is not empty. Skipping copy."
|
||||
fi
|
||||
|
||||
# 启动应用或保持容器运行
|
||||
# exec "$@"
|
||||
|
||||
nginx -g "daemon off;"
|
9
docker/default.conf
Normal file
9
docker/default.conf
Normal file
@ -0,0 +1,9 @@
|
||||
|
||||
server {
|
||||
listen 80;
|
||||
listen [::]:80;
|
||||
root /app;
|
||||
location / {
|
||||
try_files $uri $uri/ /index.html;
|
||||
}
|
||||
}
|
@ -54,6 +54,7 @@
|
||||
@layer utilities {
|
||||
.layout-menu {
|
||||
@apply bg-gray-900 p-2 text-white flex justify-between h-12;
|
||||
-webkit-app-region: drag;
|
||||
}
|
||||
.bg-custom-blue {
|
||||
background-color: #3490dc;
|
||||
|
@ -1,4 +1,4 @@
|
||||
import { AiMoudle } from '@/pages/ai-chat';
|
||||
import { AiMoudle, useAiStore } from '@/pages/ai-chat';
|
||||
import { MenuOutlined, SwapOutlined } from '@ant-design/icons';
|
||||
import { Button, Tooltip } from 'antd';
|
||||
import { Outlet } from 'react-router-dom';
|
||||
@ -8,6 +8,8 @@ import { useShallow } from 'zustand/react/shallow';
|
||||
import { useEffect } from 'react';
|
||||
import { LayoutUser } from './LayoutUser';
|
||||
import PandaPNG from '@/assets/panda.png';
|
||||
import { Panel, PanelGroup, PanelResizeHandle } from 'react-resizable-panels';
|
||||
import clsx from 'clsx';
|
||||
|
||||
type LayoutMainProps = {
|
||||
title?: React.ReactNode;
|
||||
@ -26,6 +28,11 @@ export const LayoutMain = (props: LayoutMainProps) => {
|
||||
};
|
||||
}),
|
||||
);
|
||||
const aiStore = useAiStore(
|
||||
useShallow((state) => {
|
||||
return { open: state.open };
|
||||
}),
|
||||
);
|
||||
useEffect(() => {
|
||||
menuStore.getMe();
|
||||
}, []);
|
||||
@ -71,12 +78,22 @@ export const LayoutMain = (props: LayoutMainProps) => {
|
||||
style={{
|
||||
height: 'calc(100vh - 3rem)',
|
||||
}}>
|
||||
<div className='flex-grow overflow-hidden'>
|
||||
<div className='w-full h-full rounded-lg'>
|
||||
<Outlet />
|
||||
</div>
|
||||
</div>
|
||||
<AiMoudle />
|
||||
<PanelGroup className='w-full h-full panel-layout' autoSaveId='editor-layout-main' direction='horizontal'>
|
||||
<Panel style={{ height: '100%' }}>
|
||||
<div className='h-full overflow-hidden'>
|
||||
<div className='w-full h-full rounded-lg'>
|
||||
<Outlet />
|
||||
</div>
|
||||
</div>
|
||||
</Panel>
|
||||
|
||||
<PanelResizeHandle />
|
||||
<Panel style={{ height: '100%' }} defaultSize={25} className={clsx(!aiStore.open && 'hidden')}>
|
||||
<div className='w-full h-full'>
|
||||
<AiMoudle />
|
||||
</div>
|
||||
</Panel>
|
||||
</PanelGroup>
|
||||
</div>
|
||||
<LayoutUser />
|
||||
</div>
|
||||
|
@ -343,7 +343,7 @@ export const AiMoudle = () => {
|
||||
};
|
||||
});
|
||||
return (
|
||||
<div className={clsx('w-[600px] flex-shrink-0 bg-gray-100 border-l-2 shadow-lg flex flex-col', !aiStore?.open && 'hidden')}>
|
||||
<div className={clsx('w-full h-full flex-shrink-0 bg-gray-100 border-l-2 shadow-lg flex flex-col', !aiStore?.open && 'hidden')}>
|
||||
<div className='flex justify-between p-2 border bg-white'>
|
||||
<div className='flex gap-4'>
|
||||
<Button className='position ml-4 ' onClick={() => aiStore.setOpen(false)} icon={<CloseOutlined />}></Button>
|
||||
|
@ -1,11 +1,21 @@
|
||||
import { Button, Input, message, Modal, Table } from 'antd';
|
||||
import { Button, Input, message, Modal, Table, Tooltip } from 'antd';
|
||||
import { Fragment, useEffect, useMemo, useState } from 'react';
|
||||
import { usePromptStore } from '../store/prompt';
|
||||
import { useShallow } from 'zustand/react/shallow';
|
||||
import { Form } from 'antd';
|
||||
import copy from 'copy-to-clipboard';
|
||||
import { useNewNavigate } from '@/modules';
|
||||
import { EditOutlined, SettingOutlined, LinkOutlined, SaveOutlined, DeleteOutlined, LeftOutlined, CaretRightOutlined, PlusOutlined } from '@ant-design/icons';
|
||||
import {
|
||||
EditOutlined,
|
||||
SettingOutlined,
|
||||
LinkOutlined,
|
||||
SaveOutlined,
|
||||
DeleteOutlined,
|
||||
LeftOutlined,
|
||||
CaretRightOutlined,
|
||||
PlusOutlined,
|
||||
ExportOutlined,
|
||||
} from '@ant-design/icons';
|
||||
import clsx from 'clsx';
|
||||
import { TextArea } from '@/pages/container/components/TextArea';
|
||||
|
||||
@ -256,6 +266,14 @@ export const List = () => {
|
||||
message.error('Not implemented');
|
||||
}}
|
||||
/>
|
||||
<Tooltip title='Export Config'>
|
||||
<Button
|
||||
icon={<ExportOutlined />}
|
||||
onClick={() => {
|
||||
message.error('Not implemented');
|
||||
}}
|
||||
/>
|
||||
</Tooltip>
|
||||
</Button.Group>
|
||||
</div>
|
||||
</div>
|
||||
|
Loading…
x
Reference in New Issue
Block a user