From 92751d350851d2c6bff36bb7a32b7f96a20d6f3c Mon Sep 17 00:00:00 2001 From: fengfuqiu Date: Wed, 9 Mar 2022 18:05:00 +0800 Subject: [PATCH] OSCheck: Add Error info Popup dialog --- sysom_web/src/pages/diagnose/oscheck/index.jsx | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/sysom_web/src/pages/diagnose/oscheck/index.jsx b/sysom_web/src/pages/diagnose/oscheck/index.jsx index 74d11ba..50f2527 100644 --- a/sysom_web/src/pages/diagnose/oscheck/index.jsx +++ b/sysom_web/src/pages/diagnose/oscheck/index.jsx @@ -1,4 +1,5 @@ import { PageContainer } from '@ant-design/pro-layout'; +import { Modal } from "antd"; import { useState, useRef } from 'react'; import ProCard from '@ant-design/pro-card'; import OSCheckTaskForm from './osCheckTaskForm'; @@ -17,6 +18,17 @@ const NetList = () => { refOSCheckList.current.reload(); } + const onError = async (record) => { + const msg = await _getTask(record.id); + Modal.error({ + title: '诊断失败', + content: ( +
+
错误信息:{msg.result}
+
+ ), + }); + } const onListClick = async (record) => { let map = { @@ -51,7 +63,7 @@ const NetList = () => { let children = [] let maxStatusLevel = 0; for (let item in msg.result[type]) { - msg.result[type][item].summary = msg.result[type][item].summary + msg.result[type][item].summary = msg.result[type][item].summary children.push({ ...msg.result[type][item], item: map[item], key: type + item }) maxStatusLevel = maxStatusLevel < statusLevelMap[msg.result[type][item].level] ? statusLevelMap[msg.result[type][item].level] : maxStatusLevel @@ -70,7 +82,7 @@ const NetList = () => { + search={true} onClick={onListClick} onError={onError} ref={refOSCheckList} /> { osCheckResult ? : <>