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: []} }