perf: publish change and panel to App
This commit is contained in:
@@ -8,13 +8,19 @@ import { useNavigate } from 'react-router';
|
||||
import { useToCodeEditor } from '@/pages/code-editor';
|
||||
import { CardBlank } from '@/components/card/CardBlank';
|
||||
import {
|
||||
AppstoreFilled,
|
||||
AppstoreOutlined,
|
||||
ArrowRightOutlined,
|
||||
CloudDownloadOutlined,
|
||||
CloudUploadOutlined,
|
||||
CodeOutlined,
|
||||
DeleteOutlined,
|
||||
EditOutlined,
|
||||
ForkOutlined,
|
||||
GoldOutlined,
|
||||
PlusOutlined,
|
||||
RocketFilled,
|
||||
RollbackOutlined,
|
||||
ToolOutlined,
|
||||
} from '@ant-design/icons';
|
||||
import { isObjectNull } from '@/utils/is-null';
|
||||
@@ -119,20 +125,40 @@ export const List = () => {
|
||||
|
||||
return (
|
||||
<div className='w-full h-full flex bg-gray-200'>
|
||||
<div className='p-2 bg-white rounded-r-lg'>
|
||||
<Button
|
||||
className='w-10 '
|
||||
icon={<PlusOutlined />}
|
||||
onClick={() => {
|
||||
editStore.setFormData({});
|
||||
editStore.setShowEdit(true);
|
||||
}}></Button>
|
||||
<div className='p-2 bg-white rounded-r-lg flex flex-col gap-2'>
|
||||
<Tooltip title='Add'>
|
||||
<Button
|
||||
className='w-10 '
|
||||
icon={<PlusOutlined />}
|
||||
onClick={() => {
|
||||
editStore.setFormData({});
|
||||
editStore.setShowEdit(true);
|
||||
}}></Button>
|
||||
</Tooltip>
|
||||
<Tooltip title='To App'>
|
||||
<Button
|
||||
onClick={() => {
|
||||
navicate('/app');
|
||||
}}
|
||||
icon={<AppstoreOutlined />}></Button>
|
||||
</Tooltip>
|
||||
<Tooltip title='To Container'>
|
||||
<Button
|
||||
onClick={() => {
|
||||
navicate('/container');
|
||||
}}
|
||||
icon={<CodeOutlined />}></Button>
|
||||
</Tooltip>
|
||||
</div>
|
||||
<div className='flex-grow overflow-scroll scrollbar mt-4'>
|
||||
<div className=''>
|
||||
<div className=' flex flex-wrap gap-10 justify-center h-full overflow-auto scrollbar'>
|
||||
{editStore.list.length > 0 &&
|
||||
editStore.list.map((item, index) => {
|
||||
const publish = item.publish;
|
||||
if (publish.id) {
|
||||
console.log(item, item.publish);
|
||||
}
|
||||
return (
|
||||
<div className='card w-[300px]' key={index}>
|
||||
<div className='card-title'>{item.title}</div>
|
||||
@@ -181,6 +207,17 @@ export const List = () => {
|
||||
icon={<CloudUploadOutlined />}
|
||||
/>
|
||||
</Tooltip>
|
||||
{item.publish?.id && (
|
||||
<Tooltip title={`转到${item?.publish.key || ''} App Version List`}>
|
||||
<Button
|
||||
onClick={() => {
|
||||
const app = '/app/' + item?.publish?.key + '/version/list';
|
||||
navicate(app);
|
||||
}}
|
||||
icon={<ArrowRightOutlined />}
|
||||
/>
|
||||
</Tooltip>
|
||||
)}
|
||||
<Tooltip title='Download'>
|
||||
<Button
|
||||
onClick={() => {
|
||||
@@ -209,8 +246,8 @@ export const List = () => {
|
||||
</div>
|
||||
);
|
||||
})}
|
||||
<CardBlank className='w-[300px]' />
|
||||
{editStore.list.length === 0 && <div className='text-center text-gray-500'>No data</div>}
|
||||
<CardBlank className='w-[300px]' />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -74,9 +74,11 @@ export const PublishFormModal = () => {
|
||||
<Input
|
||||
disabled={isEdit}
|
||||
addonAfter={
|
||||
<div className='cursor-pointer hover:text-gray-400' onClick={onPublish}>
|
||||
发布
|
||||
</div>
|
||||
!isEdit && (
|
||||
<div className='cursor-pointer hover:text-gray-400' onClick={onPublish}>
|
||||
发布
|
||||
</div>
|
||||
)
|
||||
}
|
||||
/>
|
||||
</Form.Item>
|
||||
@@ -84,12 +86,19 @@ export const PublishFormModal = () => {
|
||||
<Input.TextArea rows={4} />
|
||||
</Form.Item>
|
||||
<Form.Item label=' ' colon={false}>
|
||||
<Button type='primary' htmlType='submit'>
|
||||
Save
|
||||
</Button>
|
||||
<Button className='ml-2' htmlType='reset' onClick={onClose}>
|
||||
Cancel
|
||||
</Button>
|
||||
<div className='flex gap-2'>
|
||||
<Button type='primary' htmlType='submit'>
|
||||
Save
|
||||
</Button>
|
||||
<Button className='' htmlType='reset' onClick={onClose}>
|
||||
Cancel
|
||||
</Button>
|
||||
{isEdit && (
|
||||
<Button type='default' danger className='ml-4' onClick={onPublish}>
|
||||
Publish
|
||||
</Button>
|
||||
)}
|
||||
</div>
|
||||
</Form.Item>
|
||||
</Form>
|
||||
</Modal>
|
||||
|
||||
Reference in New Issue
Block a user