fix: fix bugs
This commit is contained in:
@@ -2,7 +2,7 @@ import { useNavigation, useParams } from 'react-router';
|
||||
import { useAppVersionStore } from '../store';
|
||||
import { useShallow } from 'zustand/react/shallow';
|
||||
import { useCallback, useEffect, useMemo, useState } from 'react';
|
||||
import { Button, Form, Input, message, Modal, Tooltip } from 'antd';
|
||||
import { Button, Form, Input, message, Modal, Space, Tooltip } from 'antd';
|
||||
import { CloudUploadOutlined, DeleteOutlined, EditOutlined, FileOutlined, LeftOutlined, LinkOutlined, PlusOutlined } from '@ant-design/icons';
|
||||
import { isObjectNull } from '@/utils/is-null';
|
||||
import { FileUpload } from '../modules/FileUpload';
|
||||
@@ -99,6 +99,7 @@ export const AppVersionList = () => {
|
||||
}),
|
||||
);
|
||||
const navigate = useNewNavigate();
|
||||
const [modal, contextHolder] = Modal.useModal();
|
||||
const [isUpload, setIsUpload] = useState(false);
|
||||
useEffect(() => {
|
||||
// fetch app version list
|
||||
@@ -151,7 +152,7 @@ export const AppVersionList = () => {
|
||||
</Tooltip>
|
||||
</div>
|
||||
<div className='mt-4'>
|
||||
<Button.Group>
|
||||
<Space.Compact>
|
||||
{/* <Button
|
||||
onClick={() => {
|
||||
versionStore.setFormData(item);
|
||||
@@ -162,7 +163,7 @@ export const AppVersionList = () => {
|
||||
<Tooltip title='Delete'>
|
||||
<Button
|
||||
onClick={(e) => {
|
||||
Modal.confirm({
|
||||
modal.confirm({
|
||||
title: 'Delete',
|
||||
content: 'Are you sure delete this data?',
|
||||
onOk: () => {
|
||||
@@ -207,7 +208,7 @@ export const AppVersionList = () => {
|
||||
}}
|
||||
/>
|
||||
</Tooltip>
|
||||
</Button.Group>
|
||||
</Space.Compact>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
@@ -216,6 +217,7 @@ export const AppVersionList = () => {
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{contextHolder}
|
||||
<div className='shark h-full'>
|
||||
{isUpload && (
|
||||
<div className='bg-white p-2 w-[600px] h-full flex flex-col'>
|
||||
|
||||
@@ -1,10 +1,9 @@
|
||||
import { useShallow } from 'zustand/react/shallow';
|
||||
import { useUserAppStore } from '../store';
|
||||
import { useEffect } from 'react';
|
||||
import { Button, Form, Input, message, Modal, Select, Tooltip } from 'antd';
|
||||
import { CodeOutlined, DashboardOutlined, DeleteOutlined, EditOutlined, LinkOutlined, PlusOutlined, UnorderedListOutlined } from '@ant-design/icons';
|
||||
import { Button, Form, Input, message, Space, Modal, Select, Tooltip } from 'antd';
|
||||
import { CodeOutlined, DeleteOutlined, EditOutlined, LinkOutlined, PlusOutlined, UnorderedListOutlined } from '@ant-design/icons';
|
||||
import { isObjectNull } from '@/utils/is-null';
|
||||
import { FileUpload } from '../modules/FileUpload';
|
||||
import { useNewNavigate } from '@/modules';
|
||||
import { marked } from 'marked';
|
||||
import clsx from 'clsx';
|
||||
@@ -94,6 +93,8 @@ const FormModal = () => {
|
||||
};
|
||||
|
||||
export const List = () => {
|
||||
const [modal, contextHolder] = Modal.useModal();
|
||||
|
||||
const userAppStore = useUserAppStore(
|
||||
useShallow((state) => {
|
||||
return {
|
||||
@@ -150,7 +151,7 @@ export const List = () => {
|
||||
</div>
|
||||
</div>
|
||||
<div className='mt-2'>
|
||||
<Button.Group>
|
||||
<Space.Compact>
|
||||
<Tooltip title={'Edit'}>
|
||||
<Button
|
||||
icon={<EditOutlined />}
|
||||
@@ -171,9 +172,13 @@ export const List = () => {
|
||||
icon={<LinkOutlined />}
|
||||
onClick={() => {
|
||||
if (isRunning) {
|
||||
let baseUri = 'https://kevisual.xiongxiao.me';
|
||||
let baseUri = location.origin;
|
||||
if (item.domain) {
|
||||
baseUri = item.domain;
|
||||
if (item.domain.startsWith('http://') || item.domain.startsWith('https://')) {
|
||||
baseUri = item.domain;
|
||||
} else {
|
||||
baseUri = new URL(item.domain).origin;
|
||||
}
|
||||
}
|
||||
if (DEV_SERVER) {
|
||||
baseUri = 'http://localhost:3005';
|
||||
@@ -189,7 +194,8 @@ export const List = () => {
|
||||
<Button
|
||||
icon={<DeleteOutlined />}
|
||||
onClick={(e) => {
|
||||
Modal.confirm({
|
||||
console.log('delete', item);
|
||||
modal.confirm({
|
||||
title: 'Delete',
|
||||
content: 'Are you sure delete this data?',
|
||||
onOk: () => {
|
||||
@@ -199,7 +205,7 @@ export const List = () => {
|
||||
e.stopPropagation();
|
||||
}}></Button>
|
||||
</Tooltip>
|
||||
</Button.Group>
|
||||
</Space.Compact>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
@@ -208,6 +214,7 @@ export const List = () => {
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{contextHolder}
|
||||
<FormModal />
|
||||
</div>
|
||||
);
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { Button, Input, message, Modal, Select, Switch, Table, Tooltip } from 'antd';
|
||||
import { Button, Input, message, Modal, Select, Space, Switch, Table, Tooltip } from 'antd';
|
||||
import { Fragment, useEffect, useState } from 'react';
|
||||
import { TextArea } from '../components/TextArea';
|
||||
import { useContainerStore } from '../store';
|
||||
@@ -187,6 +187,7 @@ const PublishFormModal = () => {
|
||||
};
|
||||
export const ContainerList = () => {
|
||||
const navicate = useNewNavigate();
|
||||
const [modal, contextHolder] = Modal.useModal();
|
||||
const containerStore = useContainerStore(
|
||||
useShallow((state) => {
|
||||
return {
|
||||
@@ -253,7 +254,7 @@ export const ContainerList = () => {
|
||||
<TextArea className='max-h-[240px] scrollbar' value={item.code} readonly />
|
||||
</div>
|
||||
<div className='flex mt-2 '>
|
||||
<Button.Group>
|
||||
<Space.Compact>
|
||||
<Button
|
||||
onClick={() => {
|
||||
// containerStore.publishData(item);
|
||||
@@ -290,7 +291,7 @@ export const ContainerList = () => {
|
||||
<Button
|
||||
onClick={(e) => {
|
||||
e.stopPropagation();
|
||||
Modal.confirm({
|
||||
modal.confirm({
|
||||
title: 'Delete',
|
||||
content: 'Are you sure delete this data?',
|
||||
onOk: () => {
|
||||
@@ -301,7 +302,7 @@ export const ContainerList = () => {
|
||||
}}
|
||||
icon={<DeleteOutlined />}></Button>
|
||||
</Tooltip>
|
||||
</Button.Group>
|
||||
</Space.Compact>
|
||||
</div>
|
||||
</div>
|
||||
</Fragment>
|
||||
@@ -358,6 +359,7 @@ export const ContainerList = () => {
|
||||
</div>
|
||||
<FormModal />
|
||||
<PublishFormModal />
|
||||
{contextHolder}
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
||||
@@ -114,6 +114,7 @@ export const List = () => {
|
||||
}),
|
||||
);
|
||||
const [codeEdit, setCodeEdit] = useState(false);
|
||||
const [modal, contextHolder] = Modal.useModal();
|
||||
const [code, setCode] = useState('');
|
||||
useEffect(() => {
|
||||
userStore.getList();
|
||||
@@ -176,7 +177,7 @@ export const List = () => {
|
||||
</Tooltip>
|
||||
<Button
|
||||
onClick={(e) => {
|
||||
Modal.confirm({
|
||||
modal.confirm({
|
||||
title: 'Delete',
|
||||
content: 'Are you sure delete this data?',
|
||||
onOk: () => {
|
||||
@@ -233,6 +234,7 @@ export const List = () => {
|
||||
</div>
|
||||
</div>
|
||||
<FormModal />
|
||||
{contextHolder}
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { Button, Input, message, Modal, Table } from 'antd';
|
||||
import { Button, Input, message, Modal, Space, Table } from 'antd';
|
||||
import { Fragment, useEffect, useMemo, useState } from 'react';
|
||||
import { useUserStore } from '../store';
|
||||
import { useShallow } from 'zustand/react/shallow';
|
||||
@@ -81,6 +81,7 @@ const FormModal = () => {
|
||||
};
|
||||
export const List = () => {
|
||||
const navicate = useNewNavigate();
|
||||
const [modal, contextHolder] = Modal.useModal();
|
||||
const userStore = useUserStore(
|
||||
useShallow((state) => {
|
||||
return {
|
||||
@@ -137,7 +138,7 @@ export const List = () => {
|
||||
<div className='font-light text-xs mt-2'>{item.description ? item.description : '-'}</div>
|
||||
</div>
|
||||
<div className='flex mt-2 '>
|
||||
<Button.Group>
|
||||
<Space.Compact>
|
||||
<Button
|
||||
onClick={(e) => {
|
||||
userStore.setFormData(item);
|
||||
@@ -148,7 +149,7 @@ export const List = () => {
|
||||
icon={<EditOutlined />}></Button>
|
||||
<Button
|
||||
onClick={(e) => {
|
||||
Modal.confirm({
|
||||
modal.confirm({
|
||||
title: 'Delete',
|
||||
content: 'Are you sure delete this data?',
|
||||
onOk: () => {
|
||||
@@ -158,7 +159,7 @@ export const List = () => {
|
||||
e.stopPropagation();
|
||||
}}
|
||||
icon={<DeleteOutlined />}></Button>
|
||||
</Button.Group>
|
||||
</Space.Compact>
|
||||
</div>
|
||||
</div>
|
||||
</Fragment>
|
||||
@@ -202,6 +203,7 @@ export const List = () => {
|
||||
</div>
|
||||
</div>
|
||||
<FormModal />
|
||||
{contextHolder}
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user