diff --git a/ui/src/components/customModal/ActivateTenantModal.tsx b/ui/src/components/customModal/ActivateTenantModal.tsx index c216c9e4d..cb2b93b70 100644 --- a/ui/src/components/customModal/ActivateTenantModal.tsx +++ b/ui/src/components/customModal/ActivateTenantModal.tsx @@ -31,7 +31,7 @@ export default function ActivateTenantModal({ const handleSubmit = async () => { await activateTenant({ ns, name, failover: true }); }; - const handleCancel = () => setVisible(false); + const onCancel = () => setVisible(false); return (

{intl.formatMessage({ diff --git a/ui/src/components/customModal/AddNSModal.tsx b/ui/src/components/customModal/AddNSModal.tsx index c9e07d094..ce65d626f 100644 --- a/ui/src/components/customModal/AddNSModal.tsx +++ b/ui/src/components/customModal/AddNSModal.tsx @@ -39,7 +39,7 @@ export default function AddNSModal({ form.submit(); } catch (err) {} }; - const handleCancel = () => setVisible(false); + const onCancel = () => setVisible(false); const onFinish = async (val: FormData) => { newNamespace.current = val.namespace; await createNS(val.namespace); @@ -50,9 +50,9 @@ export default function AddNSModal({ id: 'OBDashboard.components.customModal.AddNSModal.AddNamespace', defaultMessage: '新增命名空间', })} - isOpen={visible} - handleOk={handleSubmit} - handleCancel={handleCancel} + open={visible} + onOk={handleSubmit} + onCancel={onCancel} >

{ + const onCancel = () => { form.resetFields(); setVisible(false); }; @@ -62,9 +62,9 @@ export default function AddZoneModal({ id: 'OBDashboard.components.customModal.AddZoneModal.AddZone', defaultMessage: '新增Zone', })} - isOpen={visible} - handleOk={handleSubmit} - handleCancel={handleCancel} + open={visible} + onOk={handleSubmit} + onCancel={onCancel} > { + open={visible} + onOk={handleSubmit} + onCancel={() => { form.resetFields(); setVisible(false); }} diff --git a/ui/src/components/customModal/HandleRoleModal.tsx b/ui/src/components/customModal/HandleRoleModal.tsx index b14df28fd..65a07d860 100644 --- a/ui/src/components/customModal/HandleRoleModal.tsx +++ b/ui/src/components/customModal/HandleRoleModal.tsx @@ -227,9 +227,9 @@ export default function HandleRoleModal({ }), }, )} - isOpen={visible} - handleOk={handleSubmit} - handleCancel={() => { + open={visible} + onOk={handleSubmit} + onCancel={() => { form.resetFields(); setVisible(false); }} diff --git a/ui/src/components/customModal/LogReplayModal.tsx b/ui/src/components/customModal/LogReplayModal.tsx index 47ee3834b..cea77fa9c 100644 --- a/ui/src/components/customModal/LogReplayModal.tsx +++ b/ui/src/components/customModal/LogReplayModal.tsx @@ -24,7 +24,7 @@ export default function LogReplayModal({ } catch (err) {} }; - const handleCancel = () => setVisible(false); + const onCancel = () => setVisible(false); const onFinish = async (values: any) => { const res = await replayLogOfTenant({ namespace, name, ...values }); if (res.successful) { @@ -46,9 +46,9 @@ export default function LogReplayModal({ id: 'Dashboard.components.customModal.LogReplayModal.StandbyTenantLogPlayback', defaultMessage: '备租户日志回放', })} - isOpen={visible} - handleOk={handleSubmit} - handleCancel={handleCancel} + open={visible} + onOk={handleSubmit} + onCancel={onCancel} > setVisible(false); + const onCancel = () => setVisible(false); const onFinish = async (values: any) => { const res = await changeTenantPassword({ ns, @@ -53,9 +53,9 @@ export default function ModifyPasswordModal({ id: 'Dashboard.components.customModal.ModifyPasswordModal.ModifyRootPassword', defaultMessage: '修改 root 密码', })} - isOpen={visible} - handleOk={handleSubmit} - handleCancel={handleCancel} + open={visible} + onOk={handleSubmit} + onCancel={onCancel} > { + const onCancel = () => { if (setEditZone) { setEditZone(''); setSelectZones([]); @@ -255,9 +255,9 @@ export default function ModifyUnitDetailModal({ defaultMessage: '编辑资源池', }) } - isOpen={visible} - handleOk={handleSubmit} - handleCancel={handleCancel} + open={visible} + onOk={handleSubmit} + onCancel={onCancel} > setVisible(false); + const onCancel = () => setVisible(false); const onFinish = async (values: any) => { const res = await modifyUnitNumReportWrap({ ns, @@ -61,9 +61,9 @@ export default function ModifyUnitModal({ id: 'Dashboard.components.customModal.ModifyUnitModal.ModifyTheNumberOfUnits', defaultMessage: '修改 Unit 数量', })} - isOpen={visible} - handleOk={handleSubmit} - handleCancel={handleCancel} + open={visible} + onOk={handleSubmit} + onCancel={onCancel} > { + open={visible} + onCancel={() => { setVisible(false); }} + maskClosable={true} footer={