feat(ui): show errmsg if table loaded error

This commit is contained in:
Fu Diwei
2025-01-16 22:07:01 +08:00
parent 3a2baba746
commit d1dbbae101
5 changed files with 30 additions and 11 deletions

View File

@@ -129,7 +129,7 @@ const WorkflowRuns = ({ className, style, workflowId }: WorkflowRunsProps) => {
const [page, setPage] = useState<number>(1);
const [pageSize, setPageSize] = useState<number>(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: <Empty image={Empty.PRESENTED_IMAGE_SIMPLE} />,
emptyText: <Empty image={Empty.PRESENTED_IMAGE_SIMPLE} description={loadedError ? getErrMsg(loadedError) : undefined} />,
}}
pagination={{
current: page,