feat: add preview and change edit and flow

This commit is contained in:
2024-09-18 23:11:13 +08:00
parent b838488776
commit 052dd919cd
13 changed files with 755 additions and 58 deletions

View File

@@ -4,7 +4,8 @@ import { TextArea } from '../components/TextArea';
import { useContainerStore } from '../store';
import { useShallow } from 'zustand/react/shallow';
import { Form } from 'antd';
import copy from 'copy-to-clipboard';
import { useNavigate } from 'react-router';
const FormModal = () => {
const [form] = Form.useForm();
const containerStore = useContainerStore(
@@ -73,6 +74,7 @@ const FormModal = () => {
);
};
export const ContainerList = () => {
const navicate = useNavigate();
const containerStore = useContainerStore(
useShallow((state) => {
return {
@@ -90,10 +92,23 @@ export const ContainerList = () => {
}, []);
const columns = [
// {
// title: 'ID',
// dataIndex: 'id',
// },
{
title: 'ID',
dataIndex: 'id',
render: (text: string) => {
return (
<div
className='w-40 truncate cursor-pointer'
title={text}
onClick={() => {
copy(text);
message.success('copy success');
}}>
{text}
</div>
);
},
},
{
title: 'Title',
dataIndex: 'title',
@@ -124,6 +139,12 @@ export const ContainerList = () => {
}}>
Edit
</Button>
<Button
onClick={() => {
navicate('/container/preview/' + record.id);
}}>
Preview
</Button>
<Button
danger
onClick={() => {