diff --git a/ui/src/components/workflow/WorkflowRuns.tsx b/ui/src/components/workflow/WorkflowRuns.tsx index df5a93dc..f716b8c4 100644 --- a/ui/src/components/workflow/WorkflowRuns.tsx +++ b/ui/src/components/workflow/WorkflowRuns.tsx @@ -129,7 +129,7 @@ const WorkflowRuns = ({ className, style, workflowId }: WorkflowRunsProps) => { const [page, setPage] = useState(1); const [pageSize, setPageSize] = useState(10); - const { loading } = useRequest( + const { loading, loadedError } = useRequest( () => { return listWorkflowRuns({ workflowId: workflowId, @@ -150,6 +150,8 @@ const WorkflowRuns = ({ className, style, workflowId }: WorkflowRunsProps) => { console.error(err); notificationApi.error({ message: t("common.text.request_error"), description: getErrMsg(err) }); + + throw err; }, } ); @@ -164,7 +166,7 @@ const WorkflowRuns = ({ className, style, workflowId }: WorkflowRunsProps) => { dataSource={tableData} loading={loading} locale={{ - emptyText: , + emptyText: , }} pagination={{ current: page, diff --git a/ui/src/pages/accesses/AccessList.tsx b/ui/src/pages/accesses/AccessList.tsx index 6fa03647..bbc7abe6 100644 --- a/ui/src/pages/accesses/AccessList.tsx +++ b/ui/src/pages/accesses/AccessList.tsx @@ -130,7 +130,7 @@ const AccessList = () => { }); }, []); - const { loading, run: refreshTableData } = useRequest( + const { loading, run: refreshData } = useRequest( () => { const startIndex = (page - 1) * pageSize; const endIndex = startIndex + pageSize; @@ -157,7 +157,7 @@ const AccessList = () => { // TODO: 有关联数据的不允许被删除 try { await deleteAccess(data); - refreshTableData(); + refreshData(); } catch (err) { console.error(err); notificationApi.error({ message: t("common.text.request_error"), description: getErrMsg(err) }); diff --git a/ui/src/pages/certificates/CertificateList.tsx b/ui/src/pages/certificates/CertificateList.tsx index a78c9326..b2b861e0 100644 --- a/ui/src/pages/certificates/CertificateList.tsx +++ b/ui/src/pages/certificates/CertificateList.tsx @@ -1,7 +1,7 @@ import { useState } from "react"; import { useTranslation } from "react-i18next"; import { useNavigate, useSearchParams } from "react-router-dom"; -import { DeleteOutlined as DeleteOutlinedIcon, SelectOutlined as SelectOutlinedIcon } from "@ant-design/icons"; +import { DeleteOutlined as DeleteOutlinedIcon, SelectOutlined as SelectOutlinedIcon, WarningOutlined as WarningOutlinedIcon } from "@ant-design/icons"; import { PageHeader } from "@ant-design/pro-components"; import { useRequest } from "ahooks"; import { Button, Divider, Empty, Menu, type MenuProps, Modal, Radio, Space, Table, type TableProps, Tooltip, Typography, notification, theme } from "antd"; @@ -188,7 +188,11 @@ const CertificateList = () => { const [page, setPage] = useState(() => parseInt(+searchParams.get("page")! + "") || 1); const [pageSize, setPageSize] = useState(() => parseInt(+searchParams.get("perPage")! + "") || 10); - const { loading, run: refreshTableData } = useRequest( + const { + loading, + error: loadedError, + run: refreshData, + } = useRequest( () => { return listCertificate({ page: page, @@ -209,6 +213,8 @@ const CertificateList = () => { console.error(err); notificationApi.error({ message: t("common.text.request_error"), description: getErrMsg(err) }); + + throw err; }, } ); @@ -222,7 +228,7 @@ const CertificateList = () => { const resp = await removeCertificate(certificate); if (resp) { setTableData((prev) => prev.filter((item) => item.id !== certificate.id)); - refreshTableData(); + refreshData(); } } catch (err) { console.error(err); @@ -244,7 +250,7 @@ const CertificateList = () => { dataSource={tableData} loading={loading} locale={{ - emptyText: , + emptyText: , }} pagination={{ current: page, diff --git a/ui/src/pages/dashboard/Dashboard.tsx b/ui/src/pages/dashboard/Dashboard.tsx index 531bae58..be6323dd 100644 --- a/ui/src/pages/dashboard/Dashboard.tsx +++ b/ui/src/pages/dashboard/Dashboard.tsx @@ -66,6 +66,8 @@ const Dashboard = () => { console.error(err); notificationApi.error({ message: t("common.text.request_error"), description: getErrMsg(err) }); + + throw err; }, } ); @@ -176,6 +178,8 @@ const Dashboard = () => { console.error(err); notificationApi.error({ message: t("common.text.request_error"), description: getErrMsg(err) }); + + throw err; }, } ); diff --git a/ui/src/pages/workflows/WorkflowList.tsx b/ui/src/pages/workflows/WorkflowList.tsx index 30975917..ba1f7bb2 100644 --- a/ui/src/pages/workflows/WorkflowList.tsx +++ b/ui/src/pages/workflows/WorkflowList.tsx @@ -20,6 +20,7 @@ import { type MenuProps, Modal, Radio, + Result, Space, Switch, Table, @@ -240,7 +241,11 @@ const WorkflowList = () => { const [page, setPage] = useState(() => parseInt(+searchParams.get("page")! + "") || 1); const [pageSize, setPageSize] = useState(() => parseInt(+searchParams.get("perPage")! + "") || 10); - const { loading, run: refreshTableData } = useRequest( + const { + loading, + error: loadedError, + run: refreshData, + } = useRequest( () => { return listWorkflow({ page: page, @@ -261,6 +266,8 @@ const WorkflowList = () => { console.error(err); notificationApi.error({ message: t("common.text.request_error"), description: getErrMsg(err) }); + + throw err; }, } ); @@ -305,7 +312,7 @@ const WorkflowList = () => { const resp = await removeWorkflow(workflow); if (resp) { setTableData((prev) => prev.filter((item) => item.id !== workflow.id)); - refreshTableData(); + refreshData(); } } catch (err) { console.error(err); @@ -342,7 +349,7 @@ const WorkflowList = () => { dataSource={tableData} loading={loading} locale={{ - emptyText: , + emptyText: , }} pagination={{ current: page,