From d076c51c3d528f3d1d5a0d8184ba6af61deb18eb Mon Sep 17 00:00:00 2001 From: vapao Date: Sun, 24 Jan 2021 10:32:04 +0800 Subject: [PATCH] fix bug --- spug_web/src/components/Action.js | 2 +- spug_web/src/pages/home/AlarmTrend.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/spug_web/src/components/Action.js b/spug_web/src/components/Action.js index 0c7c432..a742b7c 100644 --- a/spug_web/src/components/Action.js +++ b/spug_web/src/components/Action.js @@ -23,7 +23,7 @@ class Action extends React.Component { _handle = (data, el) => { const length = data.length; - if (canVisible(el.props.auth)) { + if (el && canVisible(el.props.auth)) { if (length !== 0) data.push() data.push(el) } diff --git a/spug_web/src/pages/home/AlarmTrend.js b/spug_web/src/pages/home/AlarmTrend.js index dbea0ab..4f2b68e 100644 --- a/spug_web/src/pages/home/AlarmTrend.js +++ b/spug_web/src/pages/home/AlarmTrend.js @@ -25,7 +25,7 @@ export default function () { const data = {}; http.get('/api/monitor/') .then(res => { - for (let item of res) { + for (let item of res.detections) { if (!data[item.type]) { data[item.type] = {value: item.type_alias, label: item.type_alias, children: []} }