@riil-frontend/component-topology 2.14.2-alpha.21 → 2.14.2-alpha.25
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/index.css +1 -1
- package/build/index.js +15 -15
- package/es/components/BatchAttrMetric/index.module.scss +3 -3
- package/es/core/components/DisplaySettingDrawer/DisplaySetting.js +7 -1
- package/es/core/components/DisplaySettingDrawer/LineExpandAllRadioGroup.js +24 -0
- package/es/core/models/AttributeMetricDisplay.js +27 -20
- package/es/core/models/common/Alarm.js +71 -47
- package/es/core/models/utils/linkUtils.js +1 -0
- package/es/core/services/overview.js +49 -0
- package/es/core/viewer/components/plugins/BaseInfo/components/ResourceOverview/index.js +209 -71
- package/es/core/viewer/components/plugins/BaseInfo/components/ResourceOverview/index.module.scss +29 -3
- package/es/core/viewer/components/plugins/BaseInfo/index.js +47 -4
- package/es/core/viewer/components/plugins/BaseInfo/index.module.scss +7 -1
- package/es/models/topoAlarm.js +45 -27
- package/es/utils/topoData.js +3 -1
- package/lib/components/BatchAttrMetric/index.module.scss +3 -3
- package/lib/core/components/DisplaySettingDrawer/DisplaySetting.js +8 -1
- package/lib/core/components/DisplaySettingDrawer/LineExpandAllRadioGroup.js +39 -0
- package/lib/core/models/AttributeMetricDisplay.js +27 -20
- package/lib/core/models/common/Alarm.js +67 -42
- package/lib/core/models/utils/linkUtils.js +1 -0
- package/lib/core/services/overview.js +49 -0
- package/lib/core/viewer/components/plugins/BaseInfo/components/ResourceOverview/index.js +210 -71
- package/lib/core/viewer/components/plugins/BaseInfo/components/ResourceOverview/index.module.scss +29 -3
- package/lib/core/viewer/components/plugins/BaseInfo/index.js +49 -3
- package/lib/core/viewer/components/plugins/BaseInfo/index.module.scss +7 -1
- package/lib/models/topoAlarm.js +46 -31
- package/lib/utils/topoData.js +3 -1
- package/package.json +2 -2
|
@@ -35,6 +35,55 @@ var _default = {
|
|
|
35
35
|
}
|
|
36
36
|
}, _callee);
|
|
37
37
|
}))();
|
|
38
|
+
},
|
|
39
|
+
|
|
40
|
+
/**
|
|
41
|
+
* 受理告警
|
|
42
|
+
* @param {*} params
|
|
43
|
+
*/
|
|
44
|
+
handleAlarm: function handleAlarm(params) {
|
|
45
|
+
return (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee2() {
|
|
46
|
+
return _regenerator["default"].wrap(function _callee2$(_context2) {
|
|
47
|
+
while (1) {
|
|
48
|
+
switch (_context2.prev = _context2.next) {
|
|
49
|
+
case 0:
|
|
50
|
+
_context2.next = 2;
|
|
51
|
+
return (0, _request.getRequest)().post('/alert/v1/api/alert/handleAlerts', params);
|
|
52
|
+
|
|
53
|
+
case 2:
|
|
54
|
+
return _context2.abrupt("return", _context2.sent);
|
|
55
|
+
|
|
56
|
+
case 3:
|
|
57
|
+
case "end":
|
|
58
|
+
return _context2.stop();
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
}, _callee2);
|
|
62
|
+
}))();
|
|
63
|
+
},
|
|
64
|
+
|
|
65
|
+
/**
|
|
66
|
+
* 获取用户id
|
|
67
|
+
*/
|
|
68
|
+
getUserId: function getUserId() {
|
|
69
|
+
return (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee3() {
|
|
70
|
+
return _regenerator["default"].wrap(function _callee3$(_context3) {
|
|
71
|
+
while (1) {
|
|
72
|
+
switch (_context3.prev = _context3.next) {
|
|
73
|
+
case 0:
|
|
74
|
+
_context3.next = 2;
|
|
75
|
+
return (0, _request.getRequest)().post('/auth-ui/v1/api/user/token/checkToken');
|
|
76
|
+
|
|
77
|
+
case 2:
|
|
78
|
+
return _context3.abrupt("return", _context3.sent);
|
|
79
|
+
|
|
80
|
+
case 3:
|
|
81
|
+
case "end":
|
|
82
|
+
return _context3.stop();
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
}, _callee3);
|
|
86
|
+
}))();
|
|
38
87
|
}
|
|
39
88
|
};
|
|
40
89
|
exports["default"] = _default;
|
|
@@ -7,6 +7,8 @@ exports["default"] = ResourceOverview;
|
|
|
7
7
|
|
|
8
8
|
var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
|
|
9
9
|
|
|
10
|
+
var _message = _interopRequireDefault(require("@alifd/next/lib/message"));
|
|
11
|
+
|
|
10
12
|
var _table = _interopRequireDefault(require("@alifd/next/lib/table"));
|
|
11
13
|
|
|
12
14
|
var _divider = _interopRequireDefault(require("@alifd/next/lib/divider"));
|
|
@@ -65,7 +67,8 @@ function BaseInfoRender(type, data) {
|
|
|
65
67
|
}, /*#__PURE__*/_react["default"].createElement("span", {
|
|
66
68
|
className: _indexModule["default"].label
|
|
67
69
|
}, "\u94FE\u8DEF\u5E26\u5BBD\uFF1A"), /*#__PURE__*/_react["default"].createElement("span", {
|
|
68
|
-
className: _indexModule["default"].content
|
|
70
|
+
className: _indexModule["default"].content,
|
|
71
|
+
title: data.rated_bandwidth
|
|
69
72
|
}, data.rated_bandwidth))), /*#__PURE__*/_react["default"].createElement("div", {
|
|
70
73
|
className: _indexModule["default"].row
|
|
71
74
|
}, /*#__PURE__*/_react["default"].createElement("div", {
|
|
@@ -73,13 +76,15 @@ function BaseInfoRender(type, data) {
|
|
|
73
76
|
}, /*#__PURE__*/_react["default"].createElement("span", {
|
|
74
77
|
className: _indexModule["default"].label
|
|
75
78
|
}, "\u6E90IP\u5730\u5740\uFF1A"), /*#__PURE__*/_react["default"].createElement("span", {
|
|
76
|
-
className: _indexModule["default"].content
|
|
79
|
+
className: _indexModule["default"].content,
|
|
80
|
+
title: data.source_ipv4
|
|
77
81
|
}, data.source_ipv4)), /*#__PURE__*/_react["default"].createElement("div", {
|
|
78
82
|
className: _indexModule["default"].item
|
|
79
83
|
}, /*#__PURE__*/_react["default"].createElement("span", {
|
|
80
84
|
className: _indexModule["default"].label
|
|
81
85
|
}, "\u76EE\u7684IP\u5730\u5740\uFF1A"), /*#__PURE__*/_react["default"].createElement("span", {
|
|
82
|
-
className: _indexModule["default"].content
|
|
86
|
+
className: _indexModule["default"].content,
|
|
87
|
+
title: data.destination_ipv4
|
|
83
88
|
}, data.destination_ipv4))), /*#__PURE__*/_react["default"].createElement("div", {
|
|
84
89
|
className: _indexModule["default"].row
|
|
85
90
|
}, /*#__PURE__*/_react["default"].createElement("div", {
|
|
@@ -87,13 +92,15 @@ function BaseInfoRender(type, data) {
|
|
|
87
92
|
}, /*#__PURE__*/_react["default"].createElement("span", {
|
|
88
93
|
className: _indexModule["default"].label
|
|
89
94
|
}, "\u6E90\u63A5\u53E3\uFF1A"), /*#__PURE__*/_react["default"].createElement("span", {
|
|
90
|
-
className: _indexModule["default"].content
|
|
95
|
+
className: _indexModule["default"].content,
|
|
96
|
+
title: data.source_Interface
|
|
91
97
|
}, data.source_Interface)), /*#__PURE__*/_react["default"].createElement("div", {
|
|
92
98
|
className: _indexModule["default"].item
|
|
93
99
|
}, /*#__PURE__*/_react["default"].createElement("span", {
|
|
94
100
|
className: _indexModule["default"].label
|
|
95
101
|
}, "\u76EE\u7684\u63A5\u53E3\uFF1A"), /*#__PURE__*/_react["default"].createElement("span", {
|
|
96
|
-
className: _indexModule["default"].content
|
|
102
|
+
className: _indexModule["default"].content,
|
|
103
|
+
title: data.destination_Interface
|
|
97
104
|
}, data.destination_Interface))));
|
|
98
105
|
} else {
|
|
99
106
|
return /*#__PURE__*/_react["default"].createElement("div", {
|
|
@@ -105,13 +112,15 @@ function BaseInfoRender(type, data) {
|
|
|
105
112
|
}, /*#__PURE__*/_react["default"].createElement("span", {
|
|
106
113
|
className: _indexModule["default"].label
|
|
107
114
|
}, "\u8D44\u6E90\u540D\u79F0\uFF1A"), /*#__PURE__*/_react["default"].createElement("span", {
|
|
108
|
-
className: _indexModule["default"].content
|
|
115
|
+
className: _indexModule["default"].content,
|
|
116
|
+
title: data.display_name
|
|
109
117
|
}, data.display_name)), /*#__PURE__*/_react["default"].createElement("div", {
|
|
110
118
|
className: _indexModule["default"].item
|
|
111
119
|
}, /*#__PURE__*/_react["default"].createElement("span", {
|
|
112
120
|
className: _indexModule["default"].label
|
|
113
121
|
}, "IP\u5730\u5740\uFF1A"), /*#__PURE__*/_react["default"].createElement("span", {
|
|
114
|
-
className: _indexModule["default"].content
|
|
122
|
+
className: _indexModule["default"].content,
|
|
123
|
+
title: data.ipv4_address
|
|
115
124
|
}, data.ipv4_address))), /*#__PURE__*/_react["default"].createElement("div", {
|
|
116
125
|
className: _indexModule["default"].row
|
|
117
126
|
}, /*#__PURE__*/_react["default"].createElement("div", {
|
|
@@ -119,13 +128,15 @@ function BaseInfoRender(type, data) {
|
|
|
119
128
|
}, /*#__PURE__*/_react["default"].createElement("span", {
|
|
120
129
|
className: _indexModule["default"].label
|
|
121
130
|
}, "\u8D44\u4EA7\u7F16\u53F7\uFF1A"), /*#__PURE__*/_react["default"].createElement("span", {
|
|
122
|
-
className: _indexModule["default"].content
|
|
131
|
+
className: _indexModule["default"].content,
|
|
132
|
+
title: data.asset_number
|
|
123
133
|
}, data.asset_number)), /*#__PURE__*/_react["default"].createElement("div", {
|
|
124
134
|
className: _indexModule["default"].item
|
|
125
135
|
}, /*#__PURE__*/_react["default"].createElement("span", {
|
|
126
136
|
className: _indexModule["default"].label
|
|
127
137
|
}, "\u8D44\u6E90\u7C7B\u578B\uFF1A"), /*#__PURE__*/_react["default"].createElement("span", {
|
|
128
|
-
className: _indexModule["default"].content
|
|
138
|
+
className: _indexModule["default"].content,
|
|
139
|
+
title: data.ciName
|
|
129
140
|
}, data.ciName))), /*#__PURE__*/_react["default"].createElement("div", {
|
|
130
141
|
className: _indexModule["default"].row
|
|
131
142
|
}, /*#__PURE__*/_react["default"].createElement("div", {
|
|
@@ -136,7 +147,8 @@ function BaseInfoRender(type, data) {
|
|
|
136
147
|
}, /*#__PURE__*/_react["default"].createElement("span", {
|
|
137
148
|
className: _indexModule["default"].label
|
|
138
149
|
}, "\u8D44\u6E90\u4F4D\u7F6E\uFF1A"), /*#__PURE__*/_react["default"].createElement("span", {
|
|
139
|
-
className: _indexModule["default"].content
|
|
150
|
+
className: _indexModule["default"].content,
|
|
151
|
+
title: data.res_address
|
|
140
152
|
}, data.res_address))));
|
|
141
153
|
}
|
|
142
154
|
} // 关键指标
|
|
@@ -153,7 +165,7 @@ function indicatorRander(type, data) {
|
|
|
153
165
|
unit: itemData.unit,
|
|
154
166
|
code: itemData.code
|
|
155
167
|
});
|
|
156
|
-
return format.value;
|
|
168
|
+
return format.value + " " + (format.value === '-' ? '' : format.unit);
|
|
157
169
|
}
|
|
158
170
|
|
|
159
171
|
return /*#__PURE__*/_react["default"].createElement("div", {
|
|
@@ -192,7 +204,8 @@ function ResourceOverview(props) {
|
|
|
192
204
|
id = props.id,
|
|
193
205
|
type = props.type,
|
|
194
206
|
ciType = props.ciType,
|
|
195
|
-
ciName = props.ciName
|
|
207
|
+
ciName = props.ciName,
|
|
208
|
+
userId = props.userId;
|
|
196
209
|
|
|
197
210
|
var _topo$store$useModelS = topo.store.useModelState('topoBizMod'),
|
|
198
211
|
attrsAndMetrics = _topo$store$useModelS.attrsAndMetrics;
|
|
@@ -232,6 +245,10 @@ function ResourceOverview(props) {
|
|
|
232
245
|
alarmRiskList = _useState3[0],
|
|
233
246
|
setAlarmRiskList = _useState3[1];
|
|
234
247
|
|
|
248
|
+
var _useState4 = (0, _react.useState)(false),
|
|
249
|
+
isAppTopo = _useState4[0],
|
|
250
|
+
setIsAppTopo = _useState4[1];
|
|
251
|
+
|
|
235
252
|
(0, _react.useEffect)(function () {
|
|
236
253
|
init();
|
|
237
254
|
}, [attrsAndMetrics, id]);
|
|
@@ -246,26 +263,11 @@ function ResourceOverview(props) {
|
|
|
246
263
|
var topModelMetrics = modelMetrics.slice(0, 6);
|
|
247
264
|
console.log('topModelMetrics', topModelMetrics); // 应用拓扑处理
|
|
248
265
|
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
var _topo$options$resourc2 = (_topo$options$resourc3 = topo.options.resourceOverviewDrawer) === null || _topo$options$resourc3 === void 0 ? void 0 : _topo$options$resourc3.getData({
|
|
255
|
-
id: id,
|
|
256
|
-
metrics: topModelMetrics
|
|
257
|
-
}),
|
|
258
|
-
_metrics = _topo$options$resourc2.metrics,
|
|
259
|
-
alarms = _topo$options$resourc2.alarms;
|
|
260
|
-
|
|
261
|
-
console.log('应用拓扑 参数获取', _metrics, alarms);
|
|
262
|
-
getAttribute(id);
|
|
263
|
-
setIndicator(topModelMetrics.map(function (item) {
|
|
264
|
-
return (0, _extends2["default"])({}, item, {
|
|
265
|
-
value: _metrics[item.code] || ''
|
|
266
|
-
});
|
|
267
|
-
}));
|
|
268
|
-
setAlarmRiskList(alarms || []);
|
|
266
|
+
var isAppTopo = !!((_topo$options$resourc = topo.options.resourceOverviewDrawer) !== null && _topo$options$resourc !== void 0 && _topo$options$resourc.getData);
|
|
267
|
+
setIsAppTopo(isAppTopo);
|
|
268
|
+
|
|
269
|
+
if (isAppTopo) {
|
|
270
|
+
initAppTopo(topModelMetrics);
|
|
269
271
|
return;
|
|
270
272
|
} // 拓扑(默认) ---------------------------
|
|
271
273
|
// 基本信息
|
|
@@ -312,23 +314,89 @@ function ResourceOverview(props) {
|
|
|
312
314
|
})); // 资源-告警/风险
|
|
313
315
|
|
|
314
316
|
getAlarmRiskData(id);
|
|
317
|
+
}
|
|
318
|
+
|
|
319
|
+
function initAppTopo(_x) {
|
|
320
|
+
return _initAppTopo.apply(this, arguments);
|
|
315
321
|
} // 获取属性信息(应用拓扑)
|
|
316
322
|
|
|
317
323
|
|
|
318
|
-
function
|
|
324
|
+
function _initAppTopo() {
|
|
325
|
+
_initAppTopo = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee(topModelMetrics) {
|
|
326
|
+
var _topo$options$resourc2, _alarmList;
|
|
327
|
+
|
|
328
|
+
var _yield$topo$options$r, metrics, alarmList;
|
|
329
|
+
|
|
330
|
+
return _regenerator["default"].wrap(function _callee$(_context) {
|
|
331
|
+
while (1) {
|
|
332
|
+
switch (_context.prev = _context.next) {
|
|
333
|
+
case 0:
|
|
334
|
+
console.log('应用拓扑 topo', topo);
|
|
335
|
+
topo.resourceOverviewDrawer = {
|
|
336
|
+
refreshData: function refreshData() {
|
|
337
|
+
init();
|
|
338
|
+
}
|
|
339
|
+
};
|
|
340
|
+
_context.next = 4;
|
|
341
|
+
return (_topo$options$resourc2 = topo.options.resourceOverviewDrawer) === null || _topo$options$resourc2 === void 0 ? void 0 : _topo$options$resourc2.getData({
|
|
342
|
+
id: id,
|
|
343
|
+
metrics: topModelMetrics
|
|
344
|
+
});
|
|
345
|
+
|
|
346
|
+
case 4:
|
|
347
|
+
_yield$topo$options$r = _context.sent;
|
|
348
|
+
metrics = _yield$topo$options$r.metrics;
|
|
349
|
+
alarmList = _yield$topo$options$r.alarms;
|
|
350
|
+
console.log('应用拓扑 参数获取', metrics, alarmList);
|
|
351
|
+
getAttribute(id);
|
|
352
|
+
setIndicator(topModelMetrics.map(function (item) {
|
|
353
|
+
return (0, _extends2["default"])({}, item, {
|
|
354
|
+
value: metrics[item.code] || ''
|
|
355
|
+
});
|
|
356
|
+
}));
|
|
357
|
+
alarmList = ((_alarmList = alarmList) === null || _alarmList === void 0 ? void 0 : _alarmList.map(function (item) {
|
|
358
|
+
return {
|
|
359
|
+
type: 'alarm',
|
|
360
|
+
icon: 'gaojing-3',
|
|
361
|
+
className: "alarm-color-icon-lv" + item.alertLevel,
|
|
362
|
+
title: "[" + item.alertObject + "] " + item.alertTitle,
|
|
363
|
+
link: "/default/pagecenter/alertDetail/view/" + item.alertId + "?alertId=" + item.alertId + "&resId=" + item.ciId + "&title=" + item.alertObject,
|
|
364
|
+
time: item.createTime,
|
|
365
|
+
status: item.status,
|
|
366
|
+
params: [{
|
|
367
|
+
alertId: item.alertId,
|
|
368
|
+
status: "dealing",
|
|
369
|
+
userId: userId,
|
|
370
|
+
isBaseAlert: false
|
|
371
|
+
}]
|
|
372
|
+
};
|
|
373
|
+
})) || [];
|
|
374
|
+
setAlarmRiskList(alarmList);
|
|
375
|
+
|
|
376
|
+
case 12:
|
|
377
|
+
case "end":
|
|
378
|
+
return _context.stop();
|
|
379
|
+
}
|
|
380
|
+
}
|
|
381
|
+
}, _callee);
|
|
382
|
+
}));
|
|
383
|
+
return _initAppTopo.apply(this, arguments);
|
|
384
|
+
}
|
|
385
|
+
|
|
386
|
+
function getAttribute(_x2) {
|
|
319
387
|
return _getAttribute.apply(this, arguments);
|
|
320
388
|
} // 获取告警/风险信息
|
|
321
389
|
|
|
322
390
|
|
|
323
391
|
function _getAttribute() {
|
|
324
|
-
_getAttribute = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function
|
|
392
|
+
_getAttribute = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee2(id) {
|
|
325
393
|
var res, _ref, attributes, attributeMap, res_address;
|
|
326
394
|
|
|
327
|
-
return _regenerator["default"].wrap(function
|
|
395
|
+
return _regenerator["default"].wrap(function _callee2$(_context2) {
|
|
328
396
|
while (1) {
|
|
329
|
-
switch (
|
|
397
|
+
switch (_context2.prev = _context2.next) {
|
|
330
398
|
case 0:
|
|
331
|
-
|
|
399
|
+
_context2.next = 2;
|
|
332
400
|
return _topo["default"].ciInfo.batchQueryCiInfo({
|
|
333
401
|
ciId: [{
|
|
334
402
|
ciId: id,
|
|
@@ -339,7 +407,7 @@ function ResourceOverview(props) {
|
|
|
339
407
|
});
|
|
340
408
|
|
|
341
409
|
case 2:
|
|
342
|
-
res =
|
|
410
|
+
res = _context2.sent;
|
|
343
411
|
console.log('应用拓扑 查询结果 res', res);
|
|
344
412
|
_ref = res[0] || {}, attributes = _ref.attributes;
|
|
345
413
|
attributeMap = {};
|
|
@@ -363,27 +431,27 @@ function ResourceOverview(props) {
|
|
|
363
431
|
|
|
364
432
|
case 10:
|
|
365
433
|
case "end":
|
|
366
|
-
return
|
|
434
|
+
return _context2.stop();
|
|
367
435
|
}
|
|
368
436
|
}
|
|
369
|
-
},
|
|
437
|
+
}, _callee2);
|
|
370
438
|
}));
|
|
371
439
|
return _getAttribute.apply(this, arguments);
|
|
372
440
|
}
|
|
373
441
|
|
|
374
|
-
function getAlarmRiskData(
|
|
442
|
+
function getAlarmRiskData(_x3) {
|
|
375
443
|
return _getAlarmRiskData.apply(this, arguments);
|
|
376
444
|
}
|
|
377
445
|
|
|
378
446
|
function _getAlarmRiskData() {
|
|
379
|
-
_getAlarmRiskData = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function
|
|
447
|
+
_getAlarmRiskData = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee3(id) {
|
|
380
448
|
var _yield$alertService$g, alarmList, _yield$service$getRis, riskList;
|
|
381
449
|
|
|
382
|
-
return _regenerator["default"].wrap(function
|
|
450
|
+
return _regenerator["default"].wrap(function _callee3$(_context3) {
|
|
383
451
|
while (1) {
|
|
384
|
-
switch (
|
|
452
|
+
switch (_context3.prev = _context3.next) {
|
|
385
453
|
case 0:
|
|
386
|
-
|
|
454
|
+
_context3.next = 2;
|
|
387
455
|
return _alert["default"].getAlarmByIds({
|
|
388
456
|
ciIdList: [id],
|
|
389
457
|
alertStatusList: ['toDeal', 'dealing'],
|
|
@@ -395,8 +463,29 @@ function ResourceOverview(props) {
|
|
|
395
463
|
});
|
|
396
464
|
|
|
397
465
|
case 2:
|
|
398
|
-
_yield$alertService$g =
|
|
466
|
+
_yield$alertService$g = _context3.sent;
|
|
399
467
|
alarmList = _yield$alertService$g.datas;
|
|
468
|
+
// {
|
|
469
|
+
// "alertId": 13548,
|
|
470
|
+
// "alertLevel": 3,
|
|
471
|
+
// "alertObject": "交换机S2652G_166.18(172.17.166.18)",
|
|
472
|
+
// "alertTitle": "CPU",
|
|
473
|
+
// "createTime": 1644997596000,
|
|
474
|
+
// "ruleId": "154",
|
|
475
|
+
// "alertType": "速率类告警",
|
|
476
|
+
// "duration": 7871000,
|
|
477
|
+
// "ciType": "交换机",
|
|
478
|
+
// "ciId": "000000001c52db09",
|
|
479
|
+
// "ciName": "S2652G_166.18",
|
|
480
|
+
// "processTime": 0,
|
|
481
|
+
// "changeTime": null,
|
|
482
|
+
// "recoverTime": 0,
|
|
483
|
+
// "closeTime": 0,
|
|
484
|
+
// "tags": null,
|
|
485
|
+
// "status": "toDeal",
|
|
486
|
+
// "alertAggInfo": null,
|
|
487
|
+
// "hasAuth": null
|
|
488
|
+
// }
|
|
400
489
|
alarmList = alarmList.map(function (item) {
|
|
401
490
|
return {
|
|
402
491
|
type: 'alarm',
|
|
@@ -405,10 +494,16 @@ function ResourceOverview(props) {
|
|
|
405
494
|
title: "[" + item.alertObject + "] " + item.alertTitle,
|
|
406
495
|
link: "/default/pagecenter/alertDetail/view/" + item.alertId + "?alertId=" + item.alertId + "&resId=" + item.ciId + "&title=" + item.alertObject,
|
|
407
496
|
time: item.createTime,
|
|
408
|
-
status: item.status
|
|
497
|
+
status: item.status,
|
|
498
|
+
params: [{
|
|
499
|
+
alertId: item.alertId,
|
|
500
|
+
status: "dealing",
|
|
501
|
+
userId: userId,
|
|
502
|
+
isBaseAlert: false
|
|
503
|
+
}]
|
|
409
504
|
};
|
|
410
505
|
});
|
|
411
|
-
|
|
506
|
+
_context3.next = 7;
|
|
412
507
|
return _overview["default"].getRiskByIds({
|
|
413
508
|
ciIdList: [id],
|
|
414
509
|
statusList: ['toDeal', 'dealing'],
|
|
@@ -417,18 +512,9 @@ function ResourceOverview(props) {
|
|
|
417
512
|
});
|
|
418
513
|
|
|
419
514
|
case 7:
|
|
420
|
-
_yield$service$getRis =
|
|
515
|
+
_yield$service$getRis = _context3.sent;
|
|
421
516
|
riskList = _yield$service$getRis.content;
|
|
422
|
-
|
|
423
|
-
return {
|
|
424
|
-
type: 'risk',
|
|
425
|
-
icon: 'Overall_risk_full',
|
|
426
|
-
className: 'risk-icon',
|
|
427
|
-
title: item.itemName,
|
|
428
|
-
link: "/default/inspectionTaskList/inspectionReport?title=" + item.ciName + "&reportId=20&reportTime=1644768602413&reportType=0&reportName=" + item.ciName,
|
|
429
|
-
time: item.firstFoundTime
|
|
430
|
-
};
|
|
431
|
-
});
|
|
517
|
+
|
|
432
518
|
/* {
|
|
433
519
|
"id": "5815",
|
|
434
520
|
"executeId": "20",
|
|
@@ -450,16 +536,25 @@ function ResourceOverview(props) {
|
|
|
450
536
|
"executeTime": 1644768602413,
|
|
451
537
|
"viewType": 0
|
|
452
538
|
} */
|
|
453
|
-
|
|
539
|
+
riskList = riskList.map(function (item) {
|
|
540
|
+
return {
|
|
541
|
+
type: 'risk',
|
|
542
|
+
icon: 'Overall_risk_full',
|
|
543
|
+
className: 'risk-icon',
|
|
544
|
+
title: item.itemName,
|
|
545
|
+
link: "/default/inspectionTaskList/inspectionReport?title=" + item.ciName + "&reportId=20&reportTime=1644768602413&reportType=0&reportName=" + item.ciName,
|
|
546
|
+
time: item.firstFoundTime
|
|
547
|
+
};
|
|
548
|
+
});
|
|
454
549
|
console.log('资源-告警/风险', alarmList, riskList);
|
|
455
550
|
setAlarmRiskList([].concat(alarmList, riskList));
|
|
456
551
|
|
|
457
552
|
case 12:
|
|
458
553
|
case "end":
|
|
459
|
-
return
|
|
554
|
+
return _context3.stop();
|
|
460
555
|
}
|
|
461
556
|
}
|
|
462
|
-
},
|
|
557
|
+
}, _callee3);
|
|
463
558
|
}));
|
|
464
559
|
return _getAlarmRiskData.apply(this, arguments);
|
|
465
560
|
}
|
|
@@ -474,6 +569,7 @@ function ResourceOverview(props) {
|
|
|
474
569
|
size: "xs",
|
|
475
570
|
className: _indexModule["default"]["alarm-color-icon"] + " " + record.className
|
|
476
571
|
}), /*#__PURE__*/_react["default"].createElement(_reactRouterDom.Link, {
|
|
572
|
+
className: _indexModule["default"].link,
|
|
477
573
|
to: record.link
|
|
478
574
|
}, value));
|
|
479
575
|
}
|
|
@@ -496,20 +592,63 @@ function ResourceOverview(props) {
|
|
|
496
592
|
if (record.type === 'alarm') {
|
|
497
593
|
return status === 'toDeal' ? /*#__PURE__*/_react["default"].createElement(_button["default"], {
|
|
498
594
|
text: true,
|
|
499
|
-
type: "primary"
|
|
595
|
+
type: "primary",
|
|
596
|
+
onClick: function onClick() {
|
|
597
|
+
return alarmRiskOperation(record.type, record.params);
|
|
598
|
+
}
|
|
500
599
|
}, "\u53D7\u7406") : /*#__PURE__*/_react["default"].createElement(_button["default"], {
|
|
501
600
|
disabled: true,
|
|
502
601
|
text: true,
|
|
503
602
|
type: "primary"
|
|
504
603
|
}, "\u5DF2\u53D7\u7406");
|
|
505
604
|
} else {
|
|
506
|
-
return
|
|
507
|
-
|
|
508
|
-
type: "primary"
|
|
509
|
-
}, "\u53D6\u6D88\u5173\u6CE8");
|
|
605
|
+
// return <Button text type="primary" onClick={() => alarmRiskOperation(record.type, record)}>受理</Button>
|
|
606
|
+
return '';
|
|
510
607
|
}
|
|
511
608
|
}
|
|
512
|
-
}];
|
|
609
|
+
}]; // 告警/风险 操作 (受理)
|
|
610
|
+
|
|
611
|
+
function alarmRiskOperation(_x4, _x5) {
|
|
612
|
+
return _alarmRiskOperation.apply(this, arguments);
|
|
613
|
+
}
|
|
614
|
+
|
|
615
|
+
function _alarmRiskOperation() {
|
|
616
|
+
_alarmRiskOperation = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee4(type, params) {
|
|
617
|
+
var res;
|
|
618
|
+
return _regenerator["default"].wrap(function _callee4$(_context4) {
|
|
619
|
+
while (1) {
|
|
620
|
+
switch (_context4.prev = _context4.next) {
|
|
621
|
+
case 0:
|
|
622
|
+
if (!(type === 'alarm')) {
|
|
623
|
+
_context4.next = 7;
|
|
624
|
+
break;
|
|
625
|
+
}
|
|
626
|
+
|
|
627
|
+
_context4.next = 3;
|
|
628
|
+
return _overview["default"].handleAlarm(params);
|
|
629
|
+
|
|
630
|
+
case 3:
|
|
631
|
+
res = _context4.sent;
|
|
632
|
+
console.log('告警/风险 操作 res', res);
|
|
633
|
+
|
|
634
|
+
_message["default"].success('受理成功');
|
|
635
|
+
|
|
636
|
+
if (isAppTopo) {
|
|
637
|
+
initAppTopo();
|
|
638
|
+
} else {
|
|
639
|
+
getAlarmRiskData();
|
|
640
|
+
}
|
|
641
|
+
|
|
642
|
+
case 7:
|
|
643
|
+
case "end":
|
|
644
|
+
return _context4.stop();
|
|
645
|
+
}
|
|
646
|
+
}
|
|
647
|
+
}, _callee4);
|
|
648
|
+
}));
|
|
649
|
+
return _alarmRiskOperation.apply(this, arguments);
|
|
650
|
+
}
|
|
651
|
+
|
|
513
652
|
return /*#__PURE__*/_react["default"].createElement("div", {
|
|
514
653
|
className: _indexModule["default"]['resource-overview']
|
|
515
654
|
}, /*#__PURE__*/_react["default"].createElement("div", {
|
|
@@ -544,9 +683,9 @@ function ResourceOverview(props) {
|
|
|
544
683
|
hasBorder: false,
|
|
545
684
|
columns: columns,
|
|
546
685
|
dataSource: alarmRiskList,
|
|
547
|
-
emptyContent: /*#__PURE__*/_react["default"].createElement(
|
|
548
|
-
|
|
549
|
-
})
|
|
686
|
+
emptyContent: /*#__PURE__*/_react["default"].createElement("div", {
|
|
687
|
+
className: _indexModule["default"]['no-data']
|
|
688
|
+
}, "\u6682\u65E0\u6570\u636E")
|
|
550
689
|
})))));
|
|
551
690
|
}
|
|
552
691
|
|
package/lib/core/viewer/components/plugins/BaseInfo/components/ResourceOverview/index.module.scss
CHANGED
|
@@ -26,6 +26,17 @@
|
|
|
26
26
|
.item {
|
|
27
27
|
width: 220px;
|
|
28
28
|
margin-right: 25px;
|
|
29
|
+
display: flex;
|
|
30
|
+
.label {
|
|
31
|
+
white-space: nowrap;
|
|
32
|
+
}
|
|
33
|
+
.content {
|
|
34
|
+
flex: 1;
|
|
35
|
+
overflow: hidden;
|
|
36
|
+
text-overflow: ellipsis;
|
|
37
|
+
white-space: nowrap;
|
|
38
|
+
color: #4d6277;
|
|
39
|
+
}
|
|
29
40
|
}
|
|
30
41
|
}
|
|
31
42
|
}
|
|
@@ -75,12 +86,27 @@
|
|
|
75
86
|
font-size: 12px;
|
|
76
87
|
margin-right: 4px;
|
|
77
88
|
}
|
|
89
|
+
.link:hover {
|
|
90
|
+
color: var(--btn-text-primary-color-hover);
|
|
91
|
+
background-color: transparent;
|
|
92
|
+
border-color: transparent;
|
|
93
|
+
}
|
|
94
|
+
.no-data {
|
|
95
|
+
font-size: 14px;
|
|
96
|
+
line-height: 14px;
|
|
97
|
+
text-align: center;
|
|
98
|
+
color: #78849c;
|
|
99
|
+
height: 20px;
|
|
100
|
+
}
|
|
78
101
|
:global {
|
|
79
|
-
.#{$css-prefix}btn-helper{
|
|
102
|
+
.#{$css-prefix}btn-helper {
|
|
80
103
|
vertical-align: baseline;
|
|
81
104
|
}
|
|
82
|
-
.risk-icon{
|
|
83
|
-
color: #
|
|
105
|
+
.risk-icon {
|
|
106
|
+
color: #ff7843;
|
|
107
|
+
}
|
|
108
|
+
.#{$css-prefix}table .#{$css-prefix}table-body tr:last-child td {
|
|
109
|
+
border-bottom: none;
|
|
84
110
|
}
|
|
85
111
|
}
|
|
86
112
|
}
|