diff --git a/web/src/pages/home/child/AddDashboardModal.tsx b/web/src/pages/home/child/AddDashboardModal.tsx index 11be382e..069a60e8 100644 --- a/web/src/pages/home/child/AddDashboardModal.tsx +++ b/web/src/pages/home/child/AddDashboardModal.tsx @@ -21,7 +21,10 @@ export const AddDashboardButton: React.FC = ( const handleOpen = () => setOpen(true) - const handleClose = () => setOpen(false) + const handleClose = () => { + form.resetFields() + setOpen(false) + } const handleCommit = () => { form.validateFields().then((values) => { diff --git a/web/src/pages/home/child/ConfigDashboardChart.tsx b/web/src/pages/home/child/ConfigDashboardChart.tsx index 82b762c4..eae3eafe 100644 --- a/web/src/pages/home/child/ConfigDashboardChart.tsx +++ b/web/src/pages/home/child/ConfigDashboardChart.tsx @@ -1,5 +1,5 @@ import DataForm from '@/components/Data/DataForm/DataForm' -import { Form, Modal } from 'antd' +import { Button, Form, Modal, Space } from 'antd' import React, { useEffect, useState } from 'react' import { addDashboardOptions } from '../options' import { UpdateDashboardRequest } from '@/apis/home/dashboard/types' @@ -61,6 +61,19 @@ export const ConfigDashboardChartModal: React.FC< }) } + const handleDelete = () => { + if (!dashboardId) { + return + } + setLoading(true) + dashboardApi + .deleteDashboard(dashboardId) + .then(() => { + handleOnOk() + }) + .finally(() => setLoading(false)) + } + useEffect(() => { if (!open) { return @@ -73,9 +86,26 @@ export const ConfigDashboardChartModal: React.FC< + + + + + } >