@riil-frontend/component-topology 8.0.6 → 8.0.8
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.js +1 -1
- package/es/core/models/TopoApp.js +1 -1
- package/es/core/services/index.js +33 -0
- package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/ResourceOverview.js +187 -139
- package/lib/core/models/TopoApp.js +1 -1
- package/lib/core/services/index.js +34 -0
- package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/ResourceOverview.js +187 -139
- package/package.json +2 -2
@@ -3,6 +3,7 @@
|
|
3
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
4
4
|
|
5
5
|
exports.__esModule = true;
|
6
|
+
exports.commonQueryCiData = commonQueryCiData;
|
6
7
|
exports.queryCisByIds = queryCisByIds;
|
7
8
|
exports.queryModelAsset = queryModelAsset;
|
8
9
|
|
@@ -72,4 +73,37 @@ function _queryModelAsset() {
|
|
72
73
|
}, _callee2);
|
73
74
|
}));
|
74
75
|
return _queryModelAsset.apply(this, arguments);
|
76
|
+
}
|
77
|
+
|
78
|
+
function commonQueryCiData(_x3) {
|
79
|
+
return _commonQueryCiData.apply(this, arguments);
|
80
|
+
}
|
81
|
+
|
82
|
+
function _commonQueryCiData() {
|
83
|
+
_commonQueryCiData = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee3(id) {
|
84
|
+
var result;
|
85
|
+
return _regenerator["default"].wrap(function _callee3$(_context3) {
|
86
|
+
while (1) {
|
87
|
+
switch (_context3.prev = _context3.next) {
|
88
|
+
case 0:
|
89
|
+
_context3.next = 2;
|
90
|
+
return _componentTopologyUtils.request.post('/mdc/v1/api/cmdb/authority/commonQueryCiData', {
|
91
|
+
condition: "type('machine_room') && id('" + id + "')",
|
92
|
+
orders: [],
|
93
|
+
pageIndex: 1,
|
94
|
+
pageSize: 20
|
95
|
+
});
|
96
|
+
|
97
|
+
case 2:
|
98
|
+
result = _context3.sent;
|
99
|
+
return _context3.abrupt("return", result);
|
100
|
+
|
101
|
+
case 4:
|
102
|
+
case "end":
|
103
|
+
return _context3.stop();
|
104
|
+
}
|
105
|
+
}
|
106
|
+
}, _callee3);
|
107
|
+
}));
|
108
|
+
return _commonQueryCiData.apply(this, arguments);
|
75
109
|
}
|
@@ -7,14 +7,14 @@ 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
|
-
|
12
10
|
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
13
11
|
|
14
12
|
var _button = _interopRequireDefault(require("@alifd/next/lib/button"));
|
15
13
|
|
16
14
|
var _icon = _interopRequireDefault(require("@alifd/next/lib/icon"));
|
17
15
|
|
16
|
+
var _message = _interopRequireDefault(require("@alifd/next/lib/message"));
|
17
|
+
|
18
18
|
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
|
19
19
|
|
20
20
|
var _moment = _interopRequireDefault(require("moment"));
|
@@ -190,10 +190,39 @@ function ResourceOverview(props) {
|
|
190
190
|
isAppTopo && resourceOverviewProps.onClose && resourceOverviewProps.onClose();
|
191
191
|
}
|
192
192
|
|
193
|
-
var jump = function
|
194
|
-
|
195
|
-
|
196
|
-
|
193
|
+
var jump = /*#__PURE__*/function () {
|
194
|
+
var _ref = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee(roomLink, id) {
|
195
|
+
var power;
|
196
|
+
return _regenerator["default"].wrap(function _callee$(_context) {
|
197
|
+
while (1) {
|
198
|
+
switch (_context.prev = _context.next) {
|
199
|
+
case 0:
|
200
|
+
onClose();
|
201
|
+
_context.next = 3;
|
202
|
+
return (0, _services.commonQueryCiData)(id);
|
203
|
+
|
204
|
+
case 3:
|
205
|
+
power = _context.sent;
|
206
|
+
console.log(power);
|
207
|
+
|
208
|
+
if (power.data.length) {
|
209
|
+
window.open("" + window.location.origin + roomLink);
|
210
|
+
} else {
|
211
|
+
_message["default"].error('无访问权限,请联系管理员');
|
212
|
+
}
|
213
|
+
|
214
|
+
case 6:
|
215
|
+
case "end":
|
216
|
+
return _context.stop();
|
217
|
+
}
|
218
|
+
}
|
219
|
+
}, _callee);
|
220
|
+
}));
|
221
|
+
|
222
|
+
return function jump(_x, _x2) {
|
223
|
+
return _ref.apply(this, arguments);
|
224
|
+
};
|
225
|
+
}(); // 基本信息可选项
|
197
226
|
|
198
227
|
|
199
228
|
var baseInfoCol = (0, _react.useMemo)(function () {
|
@@ -253,27 +282,27 @@ function ResourceOverview(props) {
|
|
253
282
|
}
|
254
283
|
|
255
284
|
function _getDevice() {
|
256
|
-
_getDevice = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function
|
285
|
+
_getDevice = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee2() {
|
257
286
|
var list;
|
258
|
-
return _regenerator["default"].wrap(function
|
287
|
+
return _regenerator["default"].wrap(function _callee2$(_context2) {
|
259
288
|
while (1) {
|
260
|
-
switch (
|
289
|
+
switch (_context2.prev = _context2.next) {
|
261
290
|
case 0:
|
262
|
-
|
291
|
+
_context2.next = 2;
|
263
292
|
return _overview["default"].getDeviceTypeList();
|
264
293
|
|
265
294
|
case 2:
|
266
|
-
list =
|
295
|
+
list = _context2.sent;
|
267
296
|
setIsDevice(list.some(function (item) {
|
268
297
|
return item.code === ciType;
|
269
298
|
})); // console.log('getDevice', ciType, list);
|
270
299
|
|
271
300
|
case 4:
|
272
301
|
case "end":
|
273
|
-
return
|
302
|
+
return _context2.stop();
|
274
303
|
}
|
275
304
|
}
|
276
|
-
},
|
305
|
+
}, _callee2);
|
277
306
|
}));
|
278
307
|
return _getDevice.apply(this, arguments);
|
279
308
|
}
|
@@ -281,32 +310,32 @@ function ResourceOverview(props) {
|
|
281
310
|
getDevice();
|
282
311
|
}, [ciType]); // 获取地址信息:机房 机柜 起始U-结束U
|
283
312
|
|
284
|
-
function getAddressFormat(
|
313
|
+
function getAddressFormat(_x3) {
|
285
314
|
return _getAddressFormat.apply(this, arguments);
|
286
315
|
} // 告警table列配置
|
287
316
|
|
288
317
|
|
289
318
|
function _getAddressFormat() {
|
290
|
-
_getAddressFormat = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function
|
319
|
+
_getAddressFormat = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee3(_ref2) {
|
291
320
|
var owned_computer_room, owned_cabinet, start_u_location, end_u_location, address, _res$find, _res$find$attributes, _res$find2, _res$find2$attributes, res, u;
|
292
321
|
|
293
|
-
return _regenerator["default"].wrap(function
|
322
|
+
return _regenerator["default"].wrap(function _callee3$(_context3) {
|
294
323
|
while (1) {
|
295
|
-
switch (
|
324
|
+
switch (_context3.prev = _context3.next) {
|
296
325
|
case 0:
|
297
|
-
owned_computer_room =
|
326
|
+
owned_computer_room = _ref2.owned_computer_room, owned_cabinet = _ref2.owned_cabinet, start_u_location = _ref2.start_u_location, end_u_location = _ref2.end_u_location;
|
298
327
|
address = '';
|
299
328
|
|
300
329
|
if (!(owned_computer_room && owned_cabinet)) {
|
301
|
-
|
330
|
+
_context3.next = 7;
|
302
331
|
break;
|
303
332
|
}
|
304
333
|
|
305
|
-
|
334
|
+
_context3.next = 5;
|
306
335
|
return (0, _services.queryCisByIds)([owned_computer_room, owned_cabinet]);
|
307
336
|
|
308
337
|
case 5:
|
309
|
-
res =
|
338
|
+
res = _context3.sent;
|
310
339
|
address = (((_res$find = res.find(function (item) {
|
311
340
|
return item.id === owned_computer_room;
|
312
341
|
})) === null || _res$find === void 0 ? void 0 : (_res$find$attributes = _res$find.attributes) === null || _res$find$attributes === void 0 ? void 0 : _res$find$attributes.display_name) || '') + " " + (((_res$find2 = res.find(function (item) {
|
@@ -320,14 +349,14 @@ function ResourceOverview(props) {
|
|
320
349
|
u = (start_u_location || '') + "-" + (end_u_location || '');
|
321
350
|
}
|
322
351
|
|
323
|
-
return
|
352
|
+
return _context3.abrupt("return", address || u ? "" + (address || '') + (u ? " " + u : '') : '');
|
324
353
|
|
325
354
|
case 10:
|
326
355
|
case "end":
|
327
|
-
return
|
356
|
+
return _context3.stop();
|
328
357
|
}
|
329
358
|
}
|
330
|
-
},
|
359
|
+
}, _callee3);
|
331
360
|
}));
|
332
361
|
return _getAddressFormat.apply(this, arguments);
|
333
362
|
}
|
@@ -385,27 +414,27 @@ function ResourceOverview(props) {
|
|
385
414
|
}
|
386
415
|
}]; // 告警/风险 操作 (受理)
|
387
416
|
|
388
|
-
function alarmRiskOperation(
|
417
|
+
function alarmRiskOperation(_x4, _x5) {
|
389
418
|
return _alarmRiskOperation.apply(this, arguments);
|
390
419
|
}
|
391
420
|
|
392
421
|
function _alarmRiskOperation() {
|
393
|
-
_alarmRiskOperation = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function
|
422
|
+
_alarmRiskOperation = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee4(type, params) {
|
394
423
|
var res;
|
395
|
-
return _regenerator["default"].wrap(function
|
424
|
+
return _regenerator["default"].wrap(function _callee4$(_context4) {
|
396
425
|
while (1) {
|
397
|
-
switch (
|
426
|
+
switch (_context4.prev = _context4.next) {
|
398
427
|
case 0:
|
399
428
|
if (!(type === 'alarm')) {
|
400
|
-
|
429
|
+
_context4.next = 6;
|
401
430
|
break;
|
402
431
|
}
|
403
432
|
|
404
|
-
|
433
|
+
_context4.next = 3;
|
405
434
|
return _overview["default"].handleAlarm(params);
|
406
435
|
|
407
436
|
case 3:
|
408
|
-
res =
|
437
|
+
res = _context4.sent;
|
409
438
|
|
410
439
|
_message["default"].success('受理成功');
|
411
440
|
|
@@ -422,10 +451,10 @@ function ResourceOverview(props) {
|
|
422
451
|
|
423
452
|
case 6:
|
424
453
|
case "end":
|
425
|
-
return
|
454
|
+
return _context4.stop();
|
426
455
|
}
|
427
456
|
}
|
428
|
-
},
|
457
|
+
}, _callee4);
|
429
458
|
}));
|
430
459
|
return _alarmRiskOperation.apply(this, arguments);
|
431
460
|
}
|
@@ -438,37 +467,37 @@ function ResourceOverview(props) {
|
|
438
467
|
name: props.name ? props.name : props.resourceData.attributes.name
|
439
468
|
}; // 基本信息设置改变
|
440
469
|
|
441
|
-
function baseInfoColChange(
|
470
|
+
function baseInfoColChange(_x6) {
|
442
471
|
return _baseInfoColChange.apply(this, arguments);
|
443
472
|
} // 获取属性信息
|
444
473
|
|
445
474
|
|
446
475
|
function _baseInfoColChange() {
|
447
|
-
_baseInfoColChange = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function
|
476
|
+
_baseInfoColChange = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee6(col) {
|
448
477
|
var _col;
|
449
478
|
|
450
|
-
var infoData, attributeMap, _iterator, _step, item, value, contentTitle,
|
479
|
+
var infoData, attributeMap, _iterator, _step, item, value, contentTitle, _data, _ref3, _ref3$, _item, _attributeMap, object, _object, displayName, attr;
|
451
480
|
|
452
|
-
return _regenerator["default"].wrap(function
|
481
|
+
return _regenerator["default"].wrap(function _callee6$(_context6) {
|
453
482
|
while (1) {
|
454
|
-
switch (
|
483
|
+
switch (_context6.prev = _context6.next) {
|
455
484
|
case 0:
|
456
485
|
if ((_col = col) !== null && _col !== void 0 && _col.length) {
|
457
|
-
|
486
|
+
_context6.next = 3;
|
458
487
|
break;
|
459
488
|
}
|
460
489
|
|
461
490
|
setBaseInfo([]);
|
462
|
-
return
|
491
|
+
return _context6.abrupt("return");
|
463
492
|
|
464
493
|
case 3:
|
465
494
|
settBaseInfoInitLoading(true);
|
466
495
|
infoData = [];
|
467
|
-
|
496
|
+
_context6.next = 7;
|
468
497
|
return getAttribute(id);
|
469
498
|
|
470
499
|
case 7:
|
471
|
-
attributeMap =
|
500
|
+
attributeMap = _context6.sent;
|
472
501
|
// console.log('getAttribute', attributeMap);
|
473
502
|
col = col.filter(function (item) {
|
474
503
|
return !item.hidden;
|
@@ -477,73 +506,92 @@ function ResourceOverview(props) {
|
|
477
506
|
|
478
507
|
case 10:
|
479
508
|
if ((_step = _iterator()).done) {
|
480
|
-
|
509
|
+
_context6.next = 26;
|
481
510
|
break;
|
482
511
|
}
|
483
512
|
|
484
513
|
item = _step.value;
|
485
514
|
value = (0, _attributeFormatter.formatMetric)(attributeMap[item.dataIndex], ciTypeMeta.attributeMap[item.dataIndex]);
|
486
515
|
contentTitle = value;
|
487
|
-
|
488
|
-
|
489
|
-
|
490
|
-
|
491
|
-
|
492
|
-
|
493
|
-
|
494
|
-
|
495
|
-
|
496
|
-
|
497
|
-
|
498
|
-
|
499
|
-
|
500
|
-
|
501
|
-
|
502
|
-
|
503
|
-
|
504
|
-
|
505
|
-
|
506
|
-
|
507
|
-
|
508
|
-
|
509
|
-
|
510
|
-
|
511
|
-
|
512
|
-
|
513
|
-
|
514
|
-
|
515
|
-
|
516
|
-
|
517
|
-
|
518
|
-
|
519
|
-
|
520
|
-
|
521
|
-
|
522
|
-
|
523
|
-
|
516
|
+
return _context6.delegateYield( /*#__PURE__*/_regenerator["default"].mark(function _callee5() {
|
517
|
+
var link, address, owned_computer_room, owned_cabinet, roomLink, node;
|
518
|
+
return _regenerator["default"].wrap(function _callee5$(_context5) {
|
519
|
+
while (1) {
|
520
|
+
switch (_context5.prev = _context5.next) {
|
521
|
+
case 0:
|
522
|
+
_context5.t0 = item.dataIndex;
|
523
|
+
_context5.next = _context5.t0 === 'display_name' ? 3 : _context5.t0 === 'ciName' ? 6 : _context5.t0 === 'res_address' ? 9 : _context5.t0 === 'imageName' ? 16 : 20;
|
524
|
+
break;
|
525
|
+
|
526
|
+
case 3:
|
527
|
+
// 无监控模板不能跳转详情。跳转前需判定资源实例数据属性中是否包含support_templates属性。若不包含,则不能跳转
|
528
|
+
if (attributeMap.support_templates) {
|
529
|
+
link = "/default/pagecenter/resDetail/view/" + id + "?resId=" + id + "&domainCode=" + ciTypeMeta.domain + "&title=" + attributeMap.display_name + "&ciCode=" + ciType; // 资源跳转链接
|
530
|
+
|
531
|
+
value = /*#__PURE__*/_react["default"].createElement("span", {
|
532
|
+
onClick: onClose
|
533
|
+
}, /*#__PURE__*/_react["default"].createElement(_Link["default"], {
|
534
|
+
className: _indexModule["default"].link,
|
535
|
+
disabled: true,
|
536
|
+
title: attributeMap.display_name || '',
|
537
|
+
to: formatUrl(link)
|
538
|
+
}, attributeMap.display_name || '-'));
|
539
|
+
} else {
|
540
|
+
value = attributeMap.display_name || '-';
|
541
|
+
}
|
542
|
+
|
543
|
+
contentTitle = attributeMap.display_name || '-';
|
544
|
+
return _context5.abrupt("break", 21);
|
545
|
+
|
546
|
+
case 6:
|
547
|
+
value = ciTypeMeta.displayName;
|
548
|
+
contentTitle = value;
|
549
|
+
return _context5.abrupt("break", 21);
|
550
|
+
|
551
|
+
case 9:
|
552
|
+
_context5.next = 11;
|
553
|
+
return getAddressFormat(attributeMap);
|
554
|
+
|
555
|
+
case 11:
|
556
|
+
address = _context5.sent;
|
557
|
+
owned_computer_room = attributeMap.owned_computer_room, owned_cabinet = attributeMap.owned_cabinet; // 跳转3D机房定位设备
|
558
|
+
|
559
|
+
if (owned_computer_room && owned_cabinet) {
|
560
|
+
// /visual/room/index_runtime.html?type=preview&room_id=00000000383e3381&rack_id=11&device_id=122
|
561
|
+
roomLink = "/visual/room/index_runtime.html?type=preview&room_id=" + owned_computer_room + "&rack_id=" + owned_cabinet + "&device_id=" + id;
|
562
|
+
value = /*#__PURE__*/_react["default"].createElement("span", {
|
563
|
+
onClick: function onClick() {
|
564
|
+
jump(roomLink, owned_computer_room);
|
565
|
+
}
|
566
|
+
}, /*#__PURE__*/_react["default"].createElement("span", {
|
567
|
+
className: _indexModule["default"].link,
|
568
|
+
title: address
|
569
|
+
}, address));
|
570
|
+
} else {
|
571
|
+
value = address;
|
572
|
+
}
|
573
|
+
|
574
|
+
contentTitle = address;
|
575
|
+
return _context5.abrupt("break", 21);
|
576
|
+
|
577
|
+
case 16:
|
578
|
+
node = topo.getDataModel().getDataByTag(id);
|
579
|
+
value = (node === null || node === void 0 ? void 0 : node.a('customName')) || (node === null || node === void 0 ? void 0 : node.a('name')) || '-';
|
580
|
+
contentTitle = value;
|
581
|
+
return _context5.abrupt("break", 21);
|
582
|
+
|
583
|
+
case 20:
|
584
|
+
return _context5.abrupt("break", 21);
|
585
|
+
|
586
|
+
case 21:
|
587
|
+
case "end":
|
588
|
+
return _context5.stop();
|
524
589
|
}
|
525
|
-
}
|
526
|
-
|
527
|
-
|
528
|
-
}, address));
|
529
|
-
})();
|
530
|
-
} else {
|
531
|
-
value = address;
|
532
|
-
}
|
590
|
+
}
|
591
|
+
}, _callee5);
|
592
|
+
})(), "t0", 15);
|
533
593
|
|
534
|
-
|
535
|
-
return _context4.abrupt("break", 36);
|
536
|
-
|
537
|
-
case 31:
|
538
|
-
node = topo.getDataModel().getDataByTag(id);
|
539
|
-
value = (node === null || node === void 0 ? void 0 : node.a('customName')) || (node === null || node === void 0 ? void 0 : node.a('name')) || '-';
|
540
|
-
contentTitle = value;
|
541
|
-
return _context4.abrupt("break", 36);
|
542
|
-
|
543
|
-
case 35:
|
544
|
-
return _context4.abrupt("break", 36);
|
545
|
-
|
546
|
-
case 36:
|
594
|
+
case 15:
|
547
595
|
// 拿翻译字段属性数据
|
548
596
|
if (attributeMap[item.dataIndex] && attributeMap[item.dataIndex + ".name"]) {
|
549
597
|
value = attributeMap[item.dataIndex + ".name"];
|
@@ -551,9 +599,9 @@ function ResourceOverview(props) {
|
|
551
599
|
}
|
552
600
|
|
553
601
|
_data = topo.attributeMetricDisplay.getData() || [];
|
554
|
-
|
602
|
+
_ref3 = [].concat(_data.filter(function (m) {
|
555
603
|
return m.id === id;
|
556
|
-
})),
|
604
|
+
})), _ref3$ = _ref3[0], _item = _ref3$ === void 0 ? {} : _ref3$;
|
557
605
|
_attributeMap = _item.attributeMap || {};
|
558
606
|
object = _attributeMap[item.dataIndex + "_object"] || {};
|
559
607
|
|
@@ -579,68 +627,68 @@ function ResourceOverview(props) {
|
|
579
627
|
contentTitle: contentTitle
|
580
628
|
}));
|
581
629
|
|
582
|
-
case
|
583
|
-
|
630
|
+
case 24:
|
631
|
+
_context6.next = 10;
|
584
632
|
break;
|
585
633
|
|
586
|
-
case
|
634
|
+
case 26:
|
587
635
|
settBaseInfoInitLoading(false);
|
588
636
|
setBaseInfo(infoData);
|
589
637
|
|
590
|
-
case
|
638
|
+
case 28:
|
591
639
|
case "end":
|
592
|
-
return
|
640
|
+
return _context6.stop();
|
593
641
|
}
|
594
642
|
}
|
595
|
-
},
|
643
|
+
}, _callee6);
|
596
644
|
}));
|
597
645
|
return _baseInfoColChange.apply(this, arguments);
|
598
646
|
}
|
599
647
|
|
600
|
-
function getAttribute(
|
648
|
+
function getAttribute(_x7) {
|
601
649
|
return _getAttribute.apply(this, arguments);
|
602
650
|
} // 指标设置改变
|
603
651
|
|
604
652
|
|
605
653
|
function _getAttribute() {
|
606
|
-
_getAttribute = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function
|
607
|
-
var _yield$resourceOvervi, baseInfos, res,
|
654
|
+
_getAttribute = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee7(id) {
|
655
|
+
var _yield$resourceOvervi, baseInfos, res, _ref4, attributes;
|
608
656
|
|
609
|
-
return _regenerator["default"].wrap(function
|
657
|
+
return _regenerator["default"].wrap(function _callee7$(_context7) {
|
610
658
|
while (1) {
|
611
|
-
switch (
|
659
|
+
switch (_context7.prev = _context7.next) {
|
612
660
|
case 0:
|
613
661
|
if (id) {
|
614
|
-
|
662
|
+
_context7.next = 2;
|
615
663
|
break;
|
616
664
|
}
|
617
665
|
|
618
|
-
return
|
666
|
+
return _context7.abrupt("return");
|
619
667
|
|
620
668
|
case 2:
|
621
669
|
if (!(resourceOverviewProps !== null && resourceOverviewProps !== void 0 && resourceOverviewProps.getData)) {
|
622
|
-
|
670
|
+
_context7.next = 9;
|
623
671
|
break;
|
624
672
|
}
|
625
673
|
|
626
|
-
|
674
|
+
_context7.next = 5;
|
627
675
|
return resourceOverviewProps === null || resourceOverviewProps === void 0 ? void 0 : resourceOverviewProps.getData({
|
628
676
|
id: id
|
629
677
|
});
|
630
678
|
|
631
679
|
case 5:
|
632
|
-
_yield$resourceOvervi =
|
680
|
+
_yield$resourceOvervi = _context7.sent;
|
633
681
|
baseInfos = _yield$resourceOvervi.baseInfos;
|
634
682
|
|
635
683
|
if (!baseInfos) {
|
636
|
-
|
684
|
+
_context7.next = 9;
|
637
685
|
break;
|
638
686
|
}
|
639
687
|
|
640
|
-
return
|
688
|
+
return _context7.abrupt("return", baseInfos);
|
641
689
|
|
642
690
|
case 9:
|
643
|
-
|
691
|
+
_context7.next = 11;
|
644
692
|
return _overview["default"].commonQueryCiData({
|
645
693
|
condition: "id('" + id + "')",
|
646
694
|
refAttribute: true,
|
@@ -653,33 +701,33 @@ function ResourceOverview(props) {
|
|
653
701
|
});
|
654
702
|
|
655
703
|
case 11:
|
656
|
-
res =
|
657
|
-
|
658
|
-
return
|
704
|
+
res = _context7.sent;
|
705
|
+
_ref4 = (res === null || res === void 0 ? void 0 : res.data[0]) || {}, attributes = _ref4.attributes;
|
706
|
+
return _context7.abrupt("return", attributes || {});
|
659
707
|
|
660
708
|
case 14:
|
661
709
|
case "end":
|
662
|
-
return
|
710
|
+
return _context7.stop();
|
663
711
|
}
|
664
712
|
}
|
665
|
-
},
|
713
|
+
}, _callee7);
|
666
714
|
}));
|
667
715
|
return _getAttribute.apply(this, arguments);
|
668
716
|
}
|
669
717
|
|
670
|
-
function metricColChange(
|
718
|
+
function metricColChange(_x8) {
|
671
719
|
return _metricColChange.apply(this, arguments);
|
672
720
|
}
|
673
721
|
|
674
722
|
function _metricColChange() {
|
675
|
-
_metricColChange = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function
|
723
|
+
_metricColChange = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee8(col) {
|
676
724
|
var _col2, _col3;
|
677
725
|
|
678
|
-
var codes, endTime, params,
|
726
|
+
var codes, endTime, params, _ref5, times, metricList;
|
679
727
|
|
680
|
-
return _regenerator["default"].wrap(function
|
728
|
+
return _regenerator["default"].wrap(function _callee8$(_context8) {
|
681
729
|
while (1) {
|
682
|
-
switch (
|
730
|
+
switch (_context8.prev = _context8.next) {
|
683
731
|
case 0:
|
684
732
|
// console.log('metricColChange col', col);
|
685
733
|
col = (_col2 = col) === null || _col2 === void 0 ? void 0 : _col2.filter(function (item) {
|
@@ -687,13 +735,13 @@ function ResourceOverview(props) {
|
|
687
735
|
});
|
688
736
|
|
689
737
|
if ((_col3 = col) !== null && _col3 !== void 0 && _col3.length) {
|
690
|
-
|
738
|
+
_context8.next = 4;
|
691
739
|
break;
|
692
740
|
}
|
693
741
|
|
694
742
|
setMetric([]); // Message.error('指标未设置')
|
695
743
|
|
696
|
-
return
|
744
|
+
return _context8.abrupt("return");
|
697
745
|
|
698
746
|
case 4:
|
699
747
|
codes = col.map(function (item) {
|
@@ -709,7 +757,7 @@ function ResourceOverview(props) {
|
|
709
757
|
};
|
710
758
|
|
711
759
|
if (isAppTopo) {
|
712
|
-
|
760
|
+
_ref5 = resourceOverviewProps.metricProps || {}, times = _ref5.times;
|
713
761
|
|
714
762
|
if (times !== null && times !== void 0 && times.length) {
|
715
763
|
params.startTime = times[0];
|
@@ -718,11 +766,11 @@ function ResourceOverview(props) {
|
|
718
766
|
}
|
719
767
|
|
720
768
|
setMetricInitLoading(true);
|
721
|
-
|
769
|
+
_context8.next = 11;
|
722
770
|
return _overview["default"].getMetricList(params);
|
723
771
|
|
724
772
|
case 11:
|
725
|
-
metricList =
|
773
|
+
metricList = _context8.sent;
|
726
774
|
|
727
775
|
_rlog.rlog.debug('metricColChange', metricList, monitorMetricModels);
|
728
776
|
|
@@ -752,10 +800,10 @@ function ResourceOverview(props) {
|
|
752
800
|
|
753
801
|
case 16:
|
754
802
|
case "end":
|
755
|
-
return
|
803
|
+
return _context8.stop();
|
756
804
|
}
|
757
805
|
}
|
758
|
-
},
|
806
|
+
}, _callee8);
|
759
807
|
}));
|
760
808
|
return _metricColChange.apply(this, arguments);
|
761
809
|
}
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@riil-frontend/component-topology",
|
3
|
-
"version": "8.0.
|
3
|
+
"version": "8.0.8",
|
4
4
|
"description": "拓扑",
|
5
5
|
"scripts": {
|
6
6
|
"start": "build-scripts start",
|
@@ -116,6 +116,6 @@
|
|
116
116
|
"access": "public"
|
117
117
|
},
|
118
118
|
"license": "MIT",
|
119
|
-
"homepage": "https://unpkg.com/@riil-frontend/component-topology@8.0.
|
119
|
+
"homepage": "https://unpkg.com/@riil-frontend/component-topology@8.0.8/build/index.html",
|
120
120
|
"gitHead": "2da19ffccbb7ca60a8acf396e39f542c68bb33f5"
|
121
121
|
}
|