@riil-frontend/component-topology 13.0.5 → 13.0.8
Sign up to get free protection for your applications and to get access to all the features.
- package/build/index.js +17 -17
- package/es/core/hooks/useAlarm.js +4 -14
- package/es/core/hooks/useGraphAlarmDisplay.js +22 -17
- package/es/core/hooks/usePolling.js +1 -0
- package/es/core/models/Alarm.js +3 -3
- package/es/core/models/TopoApp.js +1 -1
- package/es/core/store/models/topoAlarm.js +7 -5
- package/es/core/utils/alarmUtil.js +11 -0
- package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/EventsCard.js +15 -29
- package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/ResourceOverview.js +52 -151
- package/es/networkTopo/hooks/viewer/useEdgeFlow.js +12 -8
- package/es/style.js +2 -2
- package/lib/core/hooks/useAlarm.js +4 -14
- package/lib/core/hooks/useGraphAlarmDisplay.js +24 -19
- package/lib/core/hooks/usePolling.js +1 -0
- package/lib/core/models/Alarm.js +12 -24
- package/lib/core/models/TopoApp.js +1 -1
- package/lib/core/store/models/topoAlarm.js +13 -12
- package/lib/core/utils/alarmUtil.js +17 -0
- package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/EventsCard.js +16 -29
- package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/ResourceOverview.js +52 -153
- package/lib/networkTopo/hooks/viewer/useEdgeFlow.js +11 -7
- package/lib/style.js +2 -2
- package/package.json +2 -2
@@ -2,18 +2,8 @@ import _extends from "@babel/runtime/helpers/extends";
|
|
2
2
|
import { useEffect } from "react";
|
3
3
|
import rlog from "@riil-frontend/component-topology-utils/es/rlog";
|
4
4
|
import useGraphAlarmDisplay from "./useGraphAlarmDisplay";
|
5
|
-
import useTopoEventListener from "./useTopoEventListener";
|
6
|
-
|
7
|
-
var showAlarmStatus = ["toDeal", "dealing", "change", "woDealing"];
|
8
|
-
/**
|
9
|
-
* 告警是否在活
|
10
|
-
* @param {*} alarm
|
11
|
-
* @returns
|
12
|
-
*/
|
13
|
-
|
14
|
-
var isAlarmAlive = function isAlarmAlive(alarm) {
|
15
|
-
return showAlarmStatus.indexOf(alarm.status) >= 0;
|
16
|
-
};
|
5
|
+
import useTopoEventListener from "./useTopoEventListener";
|
6
|
+
import { isAlarmAlive } from "../utils/alarmUtil";
|
17
7
|
|
18
8
|
var handleRiskData = function handleRiskData(topo, receivedData) {
|
19
9
|
var _risks, _topo$viewProps, _topo$viewProps2;
|
@@ -23,7 +13,7 @@ var handleRiskData = function handleRiskData(topo, receivedData) {
|
|
23
13
|
// 已关闭 closed
|
24
14
|
var prevRisks = topo.store.getModelState('topoAlarm').risks;
|
25
15
|
|
26
|
-
var
|
16
|
+
var isRiskAlive = function isRiskAlive(data) {
|
27
17
|
return ['recovered', 'closed'].indexOf(data.status) === -1;
|
28
18
|
};
|
29
19
|
|
@@ -52,7 +42,7 @@ var handleRiskData = function handleRiskData(topo, receivedData) {
|
|
52
42
|
(_risks = risks).push.apply(_risks, addRisks); // 过滤掉无权限、非在活的
|
53
43
|
|
54
44
|
|
55
|
-
risks = risks.filter(
|
45
|
+
risks = risks.filter(isRiskAlive).filter(hasCiPermission).sort(function (a, b) {
|
56
46
|
return a.executeTime - b.executeTime;
|
57
47
|
});
|
58
48
|
rlog.debug('更新风险', {
|
@@ -1,9 +1,10 @@
|
|
1
1
|
import { useEffect, useMemo } from "react";
|
2
|
-
import
|
2
|
+
import loglevel from 'loglevel';
|
3
3
|
import { getElements } from "../../utils/htElementUtils";
|
4
4
|
import { removeManageStatus, showManageStatus } from "../utils/showGraphManageStatusUtil";
|
5
|
-
import useCmpLinkAlarm from "./useCmpLinkAlarm";
|
6
|
-
|
5
|
+
import useCmpLinkAlarm from "./useCmpLinkAlarm";
|
6
|
+
import useLinkAlarmDisplay from "./useLinkAlarmDisplay";
|
7
|
+
var rlog = loglevel.getLogger('topo');
|
7
8
|
/**
|
8
9
|
* 获取ci的最高告警级别
|
9
10
|
* @param {Array} alarmList
|
@@ -102,23 +103,27 @@ export default function useGraphAlarmDisplay(options) {
|
|
102
103
|
|
103
104
|
var cmpRes = useMemo(function () {
|
104
105
|
return addCmpLinkOfflineStatusForDisplayLineColor(oldResources, cmpLinkRunStatus);
|
105
|
-
}, [oldResources, cmpLinkRunStatus]);
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
106
|
+
}, [oldResources, cmpLinkRunStatus]); // const resources=[...cmpRes];
|
107
|
+
// 拓扑链路特殊处理 暂时屏蔽这部分处理
|
108
|
+
|
109
|
+
var _useLinkAlarmDisplay = useLinkAlarmDisplay({
|
110
|
+
topo: topo,
|
111
|
+
resources: cmpRes,
|
112
|
+
graphLoaded: graphLoaded,
|
113
|
+
alarmList: alarmList
|
114
|
+
}),
|
115
|
+
linkRunStatus = _useLinkAlarmDisplay.linkRunStatus,
|
116
|
+
getlinkAlarmLevels = _useLinkAlarmDisplay.getlinkAlarmLevels;
|
117
|
+
|
118
|
+
var linkAlarmLevels = getlinkAlarmLevels(alarmList, cmpRes); // 排除掉处于断开状态的链路
|
119
|
+
|
120
|
+
var resources = cmpRes.filter(function (item) {
|
121
|
+
return !item.breakState;
|
122
|
+
}); /// 屏蔽------------
|
118
123
|
// ci告警级别
|
119
124
|
|
120
125
|
var cisEventLevel = useMemo(function () {
|
121
|
-
var levels = [].concat(alarmList || [], cmpLinkAlarmLevels, risks.map(function (item) {
|
126
|
+
var levels = [].concat(alarmList || [], cmpLinkAlarmLevels, linkAlarmLevels, risks.map(function (item) {
|
122
127
|
var _item$resourceId;
|
123
128
|
|
124
129
|
return {
|
@@ -124,6 +124,7 @@ var usePolling = function usePolling(props) {
|
|
124
124
|
position: 17,
|
125
125
|
icon: "resource.link.linkbreak"
|
126
126
|
});
|
127
|
+
element === null || element === void 0 ? void 0 : element.a('linkbreak', true);
|
127
128
|
topo.dataModel.updateData([_extends({}, link, {
|
128
129
|
breakState: true
|
129
130
|
})]);
|
package/es/core/models/Alarm.js
CHANGED
@@ -1,9 +1,9 @@
|
|
1
1
|
import _Dialog from "@alifd/next/es/dialog";
|
2
2
|
import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
|
3
3
|
import _regeneratorRuntime from "@babel/runtime/regenerator";
|
4
|
-
import
|
5
|
-
import { rlog } from '@riil-frontend/component-topology-utils';
|
4
|
+
import loglevel from 'loglevel';
|
6
5
|
import { isAvailableArray } from '@riil-frontend/utils';
|
6
|
+
var rlog = loglevel.getLogger('topo');
|
7
7
|
|
8
8
|
var Alarm = /*#__PURE__*/function () {
|
9
9
|
function Alarm() {
|
@@ -456,7 +456,7 @@ var Alarm = /*#__PURE__*/function () {
|
|
456
456
|
resIdsList = resAndMetrics.resIdsList, nodeIdsList = resAndMetrics.nodeIdsList, linkIdsList = resAndMetrics.linkIdsList;
|
457
457
|
alarmDispatchers = this.topo.store.getModelDispatchers('topoAlarm'); // 添加事件
|
458
458
|
|
459
|
-
|
459
|
+
rlog.debug("handleAlarmEvent-接收到推送的原始告警信息", alertData);
|
460
460
|
|
461
461
|
if (!(isAvailableArray(alertData) && isAvailableArray(resIdsList))) {
|
462
462
|
_context8.next = 25;
|
@@ -24,7 +24,7 @@ import ElementTagTipConfig from "./tagstips/ElementTagTipConfig";
|
|
24
24
|
import SelectionModel from "./SelectionModel";
|
25
25
|
import CiCache from "./cache/CiCache"; // eslint-disable-next-line no-undef
|
26
26
|
|
27
|
-
var version = typeof "13.0.
|
27
|
+
var version = typeof "13.0.8" === 'string' ? "13.0.8" : null;
|
28
28
|
console.info("\u62D3\u6251\u7248\u672C: " + version);
|
29
29
|
/**
|
30
30
|
* 拓扑显示和编辑
|
@@ -5,9 +5,11 @@ import _regeneratorRuntime from "@babel/runtime/regenerator";
|
|
5
5
|
/**
|
6
6
|
* 告警
|
7
7
|
*/
|
8
|
-
import
|
8
|
+
import loglevel from 'loglevel';
|
9
9
|
import _ from "lodash";
|
10
|
-
var
|
10
|
+
var rlog = loglevel.getLogger('topo'); // 在活告警状态
|
11
|
+
|
12
|
+
var aliveAlarmStatus = ["toDeal", "dealing", "change", "woDealing"];
|
11
13
|
|
12
14
|
var sortList = function sortList(a, b) {
|
13
15
|
if (a.level === b.level) {
|
@@ -111,7 +113,7 @@ export default function (topo) {
|
|
111
113
|
|
112
114
|
if ((resIdsList || []).indexOf(rid) >= 0) {
|
113
115
|
if (record.indexOf(item.alertId) < 0) {
|
114
|
-
if (
|
116
|
+
if (aliveAlarmStatus.indexOf(item.status) >= 0) {
|
115
117
|
// rlog.debug("这是一条新告警", item);
|
116
118
|
record.push(item.alertId);
|
117
119
|
|
@@ -141,7 +143,7 @@ export default function (topo) {
|
|
141
143
|
// item
|
142
144
|
// );
|
143
145
|
|
144
|
-
if (
|
146
|
+
if (aliveAlarmStatus.indexOf(item.status) >= 0) {
|
145
147
|
if (item.status === "change") {
|
146
148
|
old = doc[rid][sliceTag];
|
147
149
|
|
@@ -210,7 +212,7 @@ export default function (topo) {
|
|
210
212
|
// rlog.debug('xxxxxxxxxxxxxxxxxxxx', doc[id][0], alarmObj.status);
|
211
213
|
|
212
214
|
|
213
|
-
return
|
215
|
+
return aliveAlarmStatus.indexOf(alarmObj.status) >= 0 ? alarmObj : null;
|
214
216
|
} else {
|
215
217
|
return null;
|
216
218
|
}
|
package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/EventsCard.js
CHANGED
@@ -5,6 +5,7 @@ import _Icon from "@alifd/next/es/icon";
|
|
5
5
|
import _regeneratorRuntime from "@babel/runtime/regenerator";
|
6
6
|
import React from 'react';
|
7
7
|
import moment from 'moment';
|
8
|
+
import { history as iceHistory } from 'create-app-shared';
|
8
9
|
import BlockBox from "./BlockBox";
|
9
10
|
import Link from "../../../../../../../components/Link";
|
10
11
|
import service from "../../../../../../services/overview";
|
@@ -37,7 +38,7 @@ function EventsCard(props) {
|
|
37
38
|
log.debug('formatUrl(url)', url);
|
38
39
|
topo.viewProps.jumpto(url);
|
39
40
|
} else {
|
40
|
-
getHistory().push(formatUrl(url));
|
41
|
+
(getHistory() || iceHistory).push(formatUrl(url));
|
41
42
|
}
|
42
43
|
}; // 告警table列配置
|
43
44
|
|
@@ -47,34 +48,19 @@ function EventsCard(props) {
|
|
47
48
|
dataIndex: "title",
|
48
49
|
key: "title",
|
49
50
|
cell: function cell(value, index, record) {
|
50
|
-
return (
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
// </div>
|
64
|
-
React.createElement("div", {
|
65
|
-
className: styles['alarm-title'],
|
66
|
-
title: value,
|
67
|
-
onClick: function onClick() {
|
68
|
-
jumpTo(record.link);
|
69
|
-
}
|
70
|
-
}, /*#__PURE__*/React.createElement(_Icon, {
|
71
|
-
type: record.icon,
|
72
|
-
size: "xs",
|
73
|
-
className: styles['alarm-color-icon'] + " " + record.className
|
74
|
-
}), /*#__PURE__*/React.createElement("span", {
|
75
|
-
className: styles.link
|
76
|
-
}, value))
|
77
|
-
);
|
51
|
+
return /*#__PURE__*/React.createElement("div", {
|
52
|
+
className: styles['alarm-title'],
|
53
|
+
title: value,
|
54
|
+
onClick: function onClick() {
|
55
|
+
jumpTo(record.link);
|
56
|
+
}
|
57
|
+
}, /*#__PURE__*/React.createElement(_Icon, {
|
58
|
+
type: record.icon,
|
59
|
+
size: "xs",
|
60
|
+
className: styles['alarm-color-icon'] + " " + record.className
|
61
|
+
}), /*#__PURE__*/React.createElement("span", {
|
62
|
+
className: styles.link
|
63
|
+
}, value));
|
78
64
|
}
|
79
65
|
}, {
|
80
66
|
title: "时间",
|
@@ -1,6 +1,4 @@
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
2
|
-
import _Button from "@alifd/next/es/button";
|
3
|
-
import _Icon from "@alifd/next/es/icon";
|
4
2
|
import _Message from "@alifd/next/es/message";
|
5
3
|
import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
|
6
4
|
|
@@ -277,8 +275,7 @@ export default function ResourceOverview(props) {
|
|
277
275
|
|
278
276
|
function getAddressFormat(_x3) {
|
279
277
|
return _getAddressFormat.apply(this, arguments);
|
280
|
-
}
|
281
|
-
|
278
|
+
}
|
282
279
|
|
283
280
|
function _getAddressFormat() {
|
284
281
|
_getAddressFormat = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee3(_ref2) {
|
@@ -324,102 +321,6 @@ export default function ResourceOverview(props) {
|
|
324
321
|
return _getAddressFormat.apply(this, arguments);
|
325
322
|
}
|
326
323
|
|
327
|
-
var columns = [{
|
328
|
-
title: '描述',
|
329
|
-
dataIndex: 'title',
|
330
|
-
key: 'title',
|
331
|
-
cell: function cell(value, index, record) {
|
332
|
-
return /*#__PURE__*/React.createElement("div", {
|
333
|
-
className: styles['alarm-title'],
|
334
|
-
title: value,
|
335
|
-
onClick: onClose
|
336
|
-
}, /*#__PURE__*/React.createElement(_Icon, {
|
337
|
-
type: record.icon,
|
338
|
-
size: "xs",
|
339
|
-
className: styles['alarm-color-icon'] + " " + record.className
|
340
|
-
}), /*#__PURE__*/React.createElement(Link, {
|
341
|
-
className: styles.link,
|
342
|
-
to: formatUrl(record.link)
|
343
|
-
}, value));
|
344
|
-
}
|
345
|
-
}, {
|
346
|
-
title: '时间',
|
347
|
-
dataIndex: 'time',
|
348
|
-
key: 'time',
|
349
|
-
width: 144,
|
350
|
-
cell: function cell(value, index, record) {
|
351
|
-
return /*#__PURE__*/React.createElement("div", {
|
352
|
-
title: moment(value).format('YYYY-MM-DD HH:mm:ss')
|
353
|
-
}, moment(value).format('YYYY-MM-DD HH:mm:ss'));
|
354
|
-
}
|
355
|
-
}, {
|
356
|
-
title: '操作',
|
357
|
-
dataIndex: 'status',
|
358
|
-
key: 'status',
|
359
|
-
width: 64,
|
360
|
-
cell: function cell(status, index, record) {
|
361
|
-
if (record.type === 'alarm') {
|
362
|
-
return status === 'toDeal' ? /*#__PURE__*/React.createElement(_Button, {
|
363
|
-
text: true,
|
364
|
-
type: "primary",
|
365
|
-
onClick: function onClick() {
|
366
|
-
return alarmRiskOperation(record.type, record.params);
|
367
|
-
}
|
368
|
-
}, "\u53D7\u7406") : /*#__PURE__*/React.createElement(_Button, {
|
369
|
-
disabled: true,
|
370
|
-
text: true,
|
371
|
-
type: "primary"
|
372
|
-
}, "\u5DF2\u53D7\u7406");
|
373
|
-
} else {
|
374
|
-
// return <Button text type="primary" onClick={() => alarmRiskOperation(record.type, record)}>受理</Button>
|
375
|
-
return '';
|
376
|
-
}
|
377
|
-
}
|
378
|
-
}]; // 告警/风险 操作 (受理)
|
379
|
-
|
380
|
-
function alarmRiskOperation(_x4, _x5) {
|
381
|
-
return _alarmRiskOperation.apply(this, arguments);
|
382
|
-
}
|
383
|
-
|
384
|
-
function _alarmRiskOperation() {
|
385
|
-
_alarmRiskOperation = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee4(type, params) {
|
386
|
-
var res;
|
387
|
-
return _regeneratorRuntime.wrap(function _callee4$(_context4) {
|
388
|
-
while (1) switch (_context4.prev = _context4.next) {
|
389
|
-
case 0:
|
390
|
-
if (!(type === 'alarm')) {
|
391
|
-
_context4.next = 6;
|
392
|
-
break;
|
393
|
-
}
|
394
|
-
|
395
|
-
_context4.next = 3;
|
396
|
-
return service.handleAlarm(params);
|
397
|
-
|
398
|
-
case 3:
|
399
|
-
res = _context4.sent;
|
400
|
-
|
401
|
-
_Message.success('受理成功');
|
402
|
-
|
403
|
-
refreshAlarmData(id); // if (isAppTopo) {
|
404
|
-
// const {
|
405
|
-
// displayName: ciName,
|
406
|
-
// attributeMap: modelAttributeMap,
|
407
|
-
// domain,
|
408
|
-
// } = topo.ciTyeCache.getCiType(ciType);
|
409
|
-
// initAppTopo(monitorMetricModels, modelAttributeMap, ciName, domain);
|
410
|
-
// } else {
|
411
|
-
// getAlarmRiskData(id);
|
412
|
-
// }
|
413
|
-
|
414
|
-
case 6:
|
415
|
-
case "end":
|
416
|
-
return _context4.stop();
|
417
|
-
}
|
418
|
-
}, _callee4);
|
419
|
-
}));
|
420
|
-
return _alarmRiskOperation.apply(this, arguments);
|
421
|
-
}
|
422
|
-
|
423
324
|
var elementData = {
|
424
325
|
id: id,
|
425
326
|
ciType: ciType,
|
@@ -427,36 +328,36 @@ export default function ResourceOverview(props) {
|
|
427
328
|
name: resourceData.name ? resourceData.name : resourceData.attributes.name
|
428
329
|
}; // 基本信息设置改变
|
429
330
|
|
430
|
-
function baseInfoColChange(
|
331
|
+
function baseInfoColChange(_x4) {
|
431
332
|
return _baseInfoColChange.apply(this, arguments);
|
432
333
|
} // 获取属性信息
|
433
334
|
|
434
335
|
|
435
336
|
function _baseInfoColChange() {
|
436
|
-
_baseInfoColChange = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
337
|
+
_baseInfoColChange = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee4(col) {
|
437
338
|
var _col;
|
438
339
|
|
439
340
|
var infoData, attributeMap, _loop, _iterator, _step;
|
440
341
|
|
441
|
-
return _regeneratorRuntime.wrap(function
|
442
|
-
while (1) switch (
|
342
|
+
return _regeneratorRuntime.wrap(function _callee4$(_context5) {
|
343
|
+
while (1) switch (_context5.prev = _context5.next) {
|
443
344
|
case 0:
|
444
345
|
if ((_col = col) !== null && _col !== void 0 && _col.length) {
|
445
|
-
|
346
|
+
_context5.next = 3;
|
446
347
|
break;
|
447
348
|
}
|
448
349
|
|
449
350
|
setBaseInfo([]);
|
450
|
-
return
|
351
|
+
return _context5.abrupt("return");
|
451
352
|
|
452
353
|
case 3:
|
453
354
|
settBaseInfoInitLoading(true);
|
454
355
|
infoData = [];
|
455
|
-
|
356
|
+
_context5.next = 7;
|
456
357
|
return getAttribute(id);
|
457
358
|
|
458
359
|
case 7:
|
459
|
-
attributeMap =
|
360
|
+
attributeMap = _context5.sent;
|
460
361
|
// console.log('getAttribute', attributeMap);
|
461
362
|
col = col.filter(function (item) {
|
462
363
|
return !item.hidden;
|
@@ -464,14 +365,14 @@ export default function ResourceOverview(props) {
|
|
464
365
|
_loop = /*#__PURE__*/_regeneratorRuntime.mark(function _loop() {
|
465
366
|
var item, value, contentTitle, link, address, owned_computer_room, owned_cabinet, roomLink, node, data, _ref3, _ref3$, _item, _attributeMap, object, _object2, displayName, attr;
|
466
367
|
|
467
|
-
return _regeneratorRuntime.wrap(function _loop$(
|
468
|
-
while (1) switch (
|
368
|
+
return _regeneratorRuntime.wrap(function _loop$(_context4) {
|
369
|
+
while (1) switch (_context4.prev = _context4.next) {
|
469
370
|
case 0:
|
470
371
|
item = _step.value;
|
471
372
|
value = formatMetric(attributeMap[item.dataIndex], ciTypeMeta.attributeMap[item.dataIndex]);
|
472
373
|
contentTitle = value;
|
473
|
-
|
474
|
-
|
374
|
+
_context4.t0 = item.dataIndex;
|
375
|
+
_context4.next = _context4.t0 === 'display_name' ? 6 : _context4.t0 === 'ciName' ? 9 : _context4.t0 === 'res_address' ? 12 : _context4.t0 === 'imageName' ? 19 : 23;
|
475
376
|
break;
|
476
377
|
|
477
378
|
case 6:
|
@@ -492,19 +393,19 @@ export default function ResourceOverview(props) {
|
|
492
393
|
}
|
493
394
|
|
494
395
|
contentTitle = attributeMap.display_name || '-';
|
495
|
-
return
|
396
|
+
return _context4.abrupt("break", 24);
|
496
397
|
|
497
398
|
case 9:
|
498
399
|
value = ciTypeMeta.displayName;
|
499
400
|
contentTitle = value;
|
500
|
-
return
|
401
|
+
return _context4.abrupt("break", 24);
|
501
402
|
|
502
403
|
case 12:
|
503
|
-
|
404
|
+
_context4.next = 14;
|
504
405
|
return getAddressFormat(attributeMap);
|
505
406
|
|
506
407
|
case 14:
|
507
|
-
address =
|
408
|
+
address = _context4.sent;
|
508
409
|
owned_computer_room = attributeMap.owned_computer_room, owned_cabinet = attributeMap.owned_cabinet; // 跳转3D机房定位设备
|
509
410
|
|
510
411
|
if (owned_computer_room && owned_cabinet) {
|
@@ -523,16 +424,16 @@ export default function ResourceOverview(props) {
|
|
523
424
|
}
|
524
425
|
|
525
426
|
contentTitle = address;
|
526
|
-
return
|
427
|
+
return _context4.abrupt("break", 24);
|
527
428
|
|
528
429
|
case 19:
|
529
430
|
node = topo.getDataModel().getDataByTag(id);
|
530
431
|
value = (node === null || node === void 0 ? void 0 : node.a('customName')) || (node === null || node === void 0 ? void 0 : node.a('name')) || '-';
|
531
432
|
contentTitle = value;
|
532
|
-
return
|
433
|
+
return _context4.abrupt("break", 24);
|
533
434
|
|
534
435
|
case 23:
|
535
|
-
return
|
436
|
+
return _context4.abrupt("break", 24);
|
536
437
|
|
537
438
|
case 24:
|
538
439
|
// 拿翻译字段属性数据
|
@@ -572,7 +473,7 @@ export default function ResourceOverview(props) {
|
|
572
473
|
|
573
474
|
case 33:
|
574
475
|
case "end":
|
575
|
-
return
|
476
|
+
return _context4.stop();
|
576
477
|
}
|
577
478
|
}, _loop);
|
578
479
|
});
|
@@ -580,14 +481,14 @@ export default function ResourceOverview(props) {
|
|
580
481
|
|
581
482
|
case 11:
|
582
483
|
if ((_step = _iterator()).done) {
|
583
|
-
|
484
|
+
_context5.next = 15;
|
584
485
|
break;
|
585
486
|
}
|
586
487
|
|
587
|
-
return
|
488
|
+
return _context5.delegateYield(_loop(), "t0", 13);
|
588
489
|
|
589
490
|
case 13:
|
590
|
-
|
491
|
+
_context5.next = 11;
|
591
492
|
break;
|
592
493
|
|
593
494
|
case 15:
|
@@ -596,56 +497,56 @@ export default function ResourceOverview(props) {
|
|
596
497
|
|
597
498
|
case 17:
|
598
499
|
case "end":
|
599
|
-
return
|
500
|
+
return _context5.stop();
|
600
501
|
}
|
601
|
-
},
|
502
|
+
}, _callee4);
|
602
503
|
}));
|
603
504
|
return _baseInfoColChange.apply(this, arguments);
|
604
505
|
}
|
605
506
|
|
606
|
-
function getAttribute(
|
507
|
+
function getAttribute(_x5) {
|
607
508
|
return _getAttribute.apply(this, arguments);
|
608
509
|
} // 指标设置改变
|
609
510
|
|
610
511
|
|
611
512
|
function _getAttribute() {
|
612
|
-
_getAttribute = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
513
|
+
_getAttribute = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee5(id) {
|
613
514
|
var _yield$resourceOvervi2, baseInfos, res, _ref4, attributes;
|
614
515
|
|
615
|
-
return _regeneratorRuntime.wrap(function
|
616
|
-
while (1) switch (
|
516
|
+
return _regeneratorRuntime.wrap(function _callee5$(_context6) {
|
517
|
+
while (1) switch (_context6.prev = _context6.next) {
|
617
518
|
case 0:
|
618
519
|
if (id) {
|
619
|
-
|
520
|
+
_context6.next = 2;
|
620
521
|
break;
|
621
522
|
}
|
622
523
|
|
623
|
-
return
|
524
|
+
return _context6.abrupt("return");
|
624
525
|
|
625
526
|
case 2:
|
626
527
|
if (!(resourceOverviewProps !== null && resourceOverviewProps !== void 0 && resourceOverviewProps.getData)) {
|
627
|
-
|
528
|
+
_context6.next = 9;
|
628
529
|
break;
|
629
530
|
}
|
630
531
|
|
631
|
-
|
532
|
+
_context6.next = 5;
|
632
533
|
return resourceOverviewProps === null || resourceOverviewProps === void 0 ? void 0 : resourceOverviewProps.getData({
|
633
534
|
id: id
|
634
535
|
});
|
635
536
|
|
636
537
|
case 5:
|
637
|
-
_yield$resourceOvervi2 =
|
538
|
+
_yield$resourceOvervi2 = _context6.sent;
|
638
539
|
baseInfos = _yield$resourceOvervi2.baseInfos;
|
639
540
|
|
640
541
|
if (!baseInfos) {
|
641
|
-
|
542
|
+
_context6.next = 9;
|
642
543
|
break;
|
643
544
|
}
|
644
545
|
|
645
|
-
return
|
546
|
+
return _context6.abrupt("return", baseInfos);
|
646
547
|
|
647
548
|
case 9:
|
648
|
-
|
549
|
+
_context6.next = 11;
|
649
550
|
return service.commonQueryCiData({
|
650
551
|
condition: "id('" + id + "')",
|
651
552
|
refAttribute: true,
|
@@ -658,31 +559,31 @@ export default function ResourceOverview(props) {
|
|
658
559
|
});
|
659
560
|
|
660
561
|
case 11:
|
661
|
-
res =
|
562
|
+
res = _context6.sent;
|
662
563
|
_ref4 = (res === null || res === void 0 ? void 0 : res.data[0]) || {}, attributes = _ref4.attributes;
|
663
|
-
return
|
564
|
+
return _context6.abrupt("return", attributes || {});
|
664
565
|
|
665
566
|
case 14:
|
666
567
|
case "end":
|
667
|
-
return
|
568
|
+
return _context6.stop();
|
668
569
|
}
|
669
|
-
},
|
570
|
+
}, _callee5);
|
670
571
|
}));
|
671
572
|
return _getAttribute.apply(this, arguments);
|
672
573
|
}
|
673
574
|
|
674
|
-
function metricColChange(
|
575
|
+
function metricColChange(_x6) {
|
675
576
|
return _metricColChange.apply(this, arguments);
|
676
577
|
}
|
677
578
|
|
678
579
|
function _metricColChange() {
|
679
|
-
_metricColChange = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
580
|
+
_metricColChange = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee6(col) {
|
680
581
|
var _col2, _col3;
|
681
582
|
|
682
583
|
var codes, endTime, params, _ref6, times, metricList, metricLists;
|
683
584
|
|
684
|
-
return _regeneratorRuntime.wrap(function
|
685
|
-
while (1) switch (
|
585
|
+
return _regeneratorRuntime.wrap(function _callee6$(_context7) {
|
586
|
+
while (1) switch (_context7.prev = _context7.next) {
|
686
587
|
case 0:
|
687
588
|
// console.log('metricColChange col', col);
|
688
589
|
col = (_col2 = col) === null || _col2 === void 0 ? void 0 : _col2.filter(function (item) {
|
@@ -690,13 +591,13 @@ export default function ResourceOverview(props) {
|
|
690
591
|
});
|
691
592
|
|
692
593
|
if ((_col3 = col) !== null && _col3 !== void 0 && _col3.length) {
|
693
|
-
|
594
|
+
_context7.next = 4;
|
694
595
|
break;
|
695
596
|
}
|
696
597
|
|
697
598
|
setMetric([]); // Message.error('指标未设置')
|
698
599
|
|
699
|
-
return
|
600
|
+
return _context7.abrupt("return");
|
700
601
|
|
701
602
|
case 4:
|
702
603
|
codes = col.map(function (item) {
|
@@ -721,11 +622,11 @@ export default function ResourceOverview(props) {
|
|
721
622
|
}
|
722
623
|
|
723
624
|
setMetricInitLoading(true);
|
724
|
-
|
625
|
+
_context7.next = 11;
|
725
626
|
return service.getMetricList(params);
|
726
627
|
|
727
628
|
case 11:
|
728
|
-
metricList =
|
629
|
+
metricList = _context7.sent;
|
729
630
|
metricLists = metricList.concat(getNewMetricList());
|
730
631
|
rlog.debug('metricColChange', metricLists, monitorMetricModels);
|
731
632
|
setMetric(col.map(function (item, key) {
|
@@ -754,9 +655,9 @@ export default function ResourceOverview(props) {
|
|
754
655
|
|
755
656
|
case 17:
|
756
657
|
case "end":
|
757
|
-
return
|
658
|
+
return _context7.stop();
|
758
659
|
}
|
759
|
-
},
|
660
|
+
}, _callee6);
|
760
661
|
}));
|
761
662
|
return _metricColChange.apply(this, arguments);
|
762
663
|
}
|