@riil-frontend/component-topology 9.0.0-a.2 → 9.0.0-a.4

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.
@@ -319,26 +319,26 @@ function ResourceOverview(props) {
319
319
 
320
320
 
321
321
  function _getAddressFormat() {
322
- _getAddressFormat = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee3(_ref2) {
322
+ _getAddressFormat = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee4(_ref2) {
323
323
  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;
324
324
 
325
- return _regenerator["default"].wrap(function _callee3$(_context3) {
325
+ return _regenerator["default"].wrap(function _callee4$(_context4) {
326
326
  while (1) {
327
- switch (_context3.prev = _context3.next) {
327
+ switch (_context4.prev = _context4.next) {
328
328
  case 0:
329
329
  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;
330
330
  address = '';
331
331
 
332
332
  if (!(owned_computer_room && owned_cabinet)) {
333
- _context3.next = 7;
333
+ _context4.next = 7;
334
334
  break;
335
335
  }
336
336
 
337
- _context3.next = 5;
337
+ _context4.next = 5;
338
338
  return (0, _services.queryCisByIds)([owned_computer_room, owned_cabinet]);
339
339
 
340
340
  case 5:
341
- res = _context3.sent;
341
+ res = _context4.sent;
342
342
  address = (((_res$find = res.find(function (item) {
343
343
  return item.id === owned_computer_room;
344
344
  })) === 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) {
@@ -352,14 +352,14 @@ function ResourceOverview(props) {
352
352
  u = (start_u_location || '') + "-" + (end_u_location || '');
353
353
  }
354
354
 
355
- return _context3.abrupt("return", address || u ? "" + (address || '') + (u ? " " + u : '') : '');
355
+ return _context4.abrupt("return", address || u ? "" + (address || '') + (u ? " " + u : '') : '');
356
356
 
357
357
  case 10:
358
358
  case "end":
359
- return _context3.stop();
359
+ return _context4.stop();
360
360
  }
361
361
  }
362
- }, _callee3);
362
+ }, _callee4);
363
363
  }));
364
364
  return _getAddressFormat.apply(this, arguments);
365
365
  }
@@ -422,22 +422,22 @@ function ResourceOverview(props) {
422
422
  }
423
423
 
424
424
  function _alarmRiskOperation() {
425
- _alarmRiskOperation = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee4(type, params) {
425
+ _alarmRiskOperation = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee5(type, params) {
426
426
  var res;
427
- return _regenerator["default"].wrap(function _callee4$(_context4) {
427
+ return _regenerator["default"].wrap(function _callee5$(_context5) {
428
428
  while (1) {
429
- switch (_context4.prev = _context4.next) {
429
+ switch (_context5.prev = _context5.next) {
430
430
  case 0:
431
431
  if (!(type === 'alarm')) {
432
- _context4.next = 6;
432
+ _context5.next = 6;
433
433
  break;
434
434
  }
435
435
 
436
- _context4.next = 3;
436
+ _context5.next = 3;
437
437
  return _overview["default"].handleAlarm(params);
438
438
 
439
439
  case 3:
440
- res = _context4.sent;
440
+ res = _context5.sent;
441
441
 
442
442
  _message["default"].success('受理成功');
443
443
 
@@ -454,10 +454,10 @@ function ResourceOverview(props) {
454
454
 
455
455
  case 6:
456
456
  case "end":
457
- return _context4.stop();
457
+ return _context5.stop();
458
458
  }
459
459
  }
460
- }, _callee4);
460
+ }, _callee5);
461
461
  }));
462
462
  return _alarmRiskOperation.apply(this, arguments);
463
463
  }
@@ -476,31 +476,31 @@ function ResourceOverview(props) {
476
476
 
477
477
 
478
478
  function _baseInfoColChange() {
479
- _baseInfoColChange = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee6(col) {
479
+ _baseInfoColChange = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee7(col) {
480
480
  var _col;
481
481
 
482
- var infoData, attributeMap, _iterator, _step, item, value, contentTitle, _data, _ref3, _ref3$, _item, _attributeMap, object, _object, displayName, attr;
482
+ var infoData, attributeMap, _iterator, _step, item, value, contentTitle, _data, _ref4, _ref4$, _item, _attributeMap, object, _object, displayName, attr;
483
483
 
484
- return _regenerator["default"].wrap(function _callee6$(_context6) {
484
+ return _regenerator["default"].wrap(function _callee7$(_context7) {
485
485
  while (1) {
486
- switch (_context6.prev = _context6.next) {
486
+ switch (_context7.prev = _context7.next) {
487
487
  case 0:
488
488
  if ((_col = col) !== null && _col !== void 0 && _col.length) {
489
- _context6.next = 3;
489
+ _context7.next = 3;
490
490
  break;
491
491
  }
492
492
 
493
493
  setBaseInfo([]);
494
- return _context6.abrupt("return");
494
+ return _context7.abrupt("return");
495
495
 
496
496
  case 3:
497
497
  settBaseInfoInitLoading(true);
498
498
  infoData = [];
499
- _context6.next = 7;
499
+ _context7.next = 7;
500
500
  return getAttribute(id);
501
501
 
502
502
  case 7:
503
- attributeMap = _context6.sent;
503
+ attributeMap = _context7.sent;
504
504
  // console.log('getAttribute', attributeMap);
505
505
  col = col.filter(function (item) {
506
506
  return !item.hidden;
@@ -509,21 +509,21 @@ function ResourceOverview(props) {
509
509
 
510
510
  case 10:
511
511
  if ((_step = _iterator()).done) {
512
- _context6.next = 26;
512
+ _context7.next = 26;
513
513
  break;
514
514
  }
515
515
 
516
516
  item = _step.value;
517
517
  value = (0, _attributeFormatter.formatMetric)(attributeMap[item.dataIndex], ciTypeMeta.attributeMap[item.dataIndex]);
518
518
  contentTitle = value;
519
- return _context6.delegateYield( /*#__PURE__*/_regenerator["default"].mark(function _callee5() {
519
+ return _context7.delegateYield( /*#__PURE__*/_regenerator["default"].mark(function _callee6() {
520
520
  var link, address, owned_computer_room, owned_cabinet, roomLink, node;
521
- return _regenerator["default"].wrap(function _callee5$(_context5) {
521
+ return _regenerator["default"].wrap(function _callee6$(_context6) {
522
522
  while (1) {
523
- switch (_context5.prev = _context5.next) {
523
+ switch (_context6.prev = _context6.next) {
524
524
  case 0:
525
- _context5.t0 = item.dataIndex;
526
- _context5.next = _context5.t0 === 'display_name' ? 3 : _context5.t0 === 'ciName' ? 6 : _context5.t0 === 'res_address' ? 9 : _context5.t0 === 'imageName' ? 16 : 20;
525
+ _context6.t0 = item.dataIndex;
526
+ _context6.next = _context6.t0 === 'display_name' ? 3 : _context6.t0 === 'ciName' ? 6 : _context6.t0 === 'res_address' ? 9 : _context6.t0 === 'imageName' ? 16 : 20;
527
527
  break;
528
528
 
529
529
  case 3:
@@ -544,19 +544,19 @@ function ResourceOverview(props) {
544
544
  }
545
545
 
546
546
  contentTitle = attributeMap.display_name || '-';
547
- return _context5.abrupt("break", 21);
547
+ return _context6.abrupt("break", 21);
548
548
 
549
549
  case 6:
550
550
  value = ciTypeMeta.displayName;
551
551
  contentTitle = value;
552
- return _context5.abrupt("break", 21);
552
+ return _context6.abrupt("break", 21);
553
553
 
554
554
  case 9:
555
- _context5.next = 11;
555
+ _context6.next = 11;
556
556
  return getAddressFormat(attributeMap);
557
557
 
558
558
  case 11:
559
- address = _context5.sent;
559
+ address = _context6.sent;
560
560
  owned_computer_room = attributeMap.owned_computer_room, owned_cabinet = attributeMap.owned_cabinet; // 跳转3D机房定位设备
561
561
 
562
562
  if (owned_computer_room && owned_cabinet) {
@@ -575,23 +575,23 @@ function ResourceOverview(props) {
575
575
  }
576
576
 
577
577
  contentTitle = address;
578
- return _context5.abrupt("break", 21);
578
+ return _context6.abrupt("break", 21);
579
579
 
580
580
  case 16:
581
581
  node = topo.getDataModel().getDataByTag(id);
582
582
  value = (node === null || node === void 0 ? void 0 : node.a('customName')) || (node === null || node === void 0 ? void 0 : node.a('name')) || '-';
583
583
  contentTitle = value;
584
- return _context5.abrupt("break", 21);
584
+ return _context6.abrupt("break", 21);
585
585
 
586
586
  case 20:
587
- return _context5.abrupt("break", 21);
587
+ return _context6.abrupt("break", 21);
588
588
 
589
589
  case 21:
590
590
  case "end":
591
- return _context5.stop();
591
+ return _context6.stop();
592
592
  }
593
593
  }
594
- }, _callee5);
594
+ }, _callee6);
595
595
  })(), "t0", 15);
596
596
 
597
597
  case 15:
@@ -602,9 +602,9 @@ function ResourceOverview(props) {
602
602
  }
603
603
 
604
604
  _data = topo.attributeMetricDisplay.getData() || [];
605
- _ref3 = [].concat(_data.filter(function (m) {
605
+ _ref4 = [].concat(_data.filter(function (m) {
606
606
  return m.id === id;
607
- })), _ref3$ = _ref3[0], _item = _ref3$ === void 0 ? {} : _ref3$;
607
+ })), _ref4$ = _ref4[0], _item = _ref4$ === void 0 ? {} : _ref4$;
608
608
  _attributeMap = _item.attributeMap || {};
609
609
  object = _attributeMap[item.dataIndex + "_object"] || {};
610
610
 
@@ -631,7 +631,7 @@ function ResourceOverview(props) {
631
631
  }));
632
632
 
633
633
  case 24:
634
- _context6.next = 10;
634
+ _context7.next = 10;
635
635
  break;
636
636
 
637
637
  case 26:
@@ -640,10 +640,10 @@ function ResourceOverview(props) {
640
640
 
641
641
  case 28:
642
642
  case "end":
643
- return _context6.stop();
643
+ return _context7.stop();
644
644
  }
645
645
  }
646
- }, _callee6);
646
+ }, _callee7);
647
647
  }));
648
648
  return _baseInfoColChange.apply(this, arguments);
649
649
  }
@@ -654,44 +654,44 @@ function ResourceOverview(props) {
654
654
 
655
655
 
656
656
  function _getAttribute() {
657
- _getAttribute = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee7(id) {
658
- var _yield$resourceOvervi, baseInfos, res, _ref4, attributes;
657
+ _getAttribute = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee8(id) {
658
+ var _yield$resourceOvervi, baseInfos, res, _ref5, attributes;
659
659
 
660
- return _regenerator["default"].wrap(function _callee7$(_context7) {
660
+ return _regenerator["default"].wrap(function _callee8$(_context8) {
661
661
  while (1) {
662
- switch (_context7.prev = _context7.next) {
662
+ switch (_context8.prev = _context8.next) {
663
663
  case 0:
664
664
  if (id) {
665
- _context7.next = 2;
665
+ _context8.next = 2;
666
666
  break;
667
667
  }
668
668
 
669
- return _context7.abrupt("return");
669
+ return _context8.abrupt("return");
670
670
 
671
671
  case 2:
672
672
  if (!(resourceOverviewProps !== null && resourceOverviewProps !== void 0 && resourceOverviewProps.getData)) {
673
- _context7.next = 9;
673
+ _context8.next = 9;
674
674
  break;
675
675
  }
676
676
 
677
- _context7.next = 5;
677
+ _context8.next = 5;
678
678
  return resourceOverviewProps === null || resourceOverviewProps === void 0 ? void 0 : resourceOverviewProps.getData({
679
679
  id: id
680
680
  });
681
681
 
682
682
  case 5:
683
- _yield$resourceOvervi = _context7.sent;
683
+ _yield$resourceOvervi = _context8.sent;
684
684
  baseInfos = _yield$resourceOvervi.baseInfos;
685
685
 
686
686
  if (!baseInfos) {
687
- _context7.next = 9;
687
+ _context8.next = 9;
688
688
  break;
689
689
  }
690
690
 
691
- return _context7.abrupt("return", baseInfos);
691
+ return _context8.abrupt("return", baseInfos);
692
692
 
693
693
  case 9:
694
- _context7.next = 11;
694
+ _context8.next = 11;
695
695
  return _overview["default"].commonQueryCiData({
696
696
  condition: "id('" + id + "')",
697
697
  refAttribute: true,
@@ -704,16 +704,16 @@ function ResourceOverview(props) {
704
704
  });
705
705
 
706
706
  case 11:
707
- res = _context7.sent;
708
- _ref4 = (res === null || res === void 0 ? void 0 : res.data[0]) || {}, attributes = _ref4.attributes;
709
- return _context7.abrupt("return", attributes || {});
707
+ res = _context8.sent;
708
+ _ref5 = (res === null || res === void 0 ? void 0 : res.data[0]) || {}, attributes = _ref5.attributes;
709
+ return _context8.abrupt("return", attributes || {});
710
710
 
711
711
  case 14:
712
712
  case "end":
713
- return _context7.stop();
713
+ return _context8.stop();
714
714
  }
715
715
  }
716
- }, _callee7);
716
+ }, _callee8);
717
717
  }));
718
718
  return _getAttribute.apply(this, arguments);
719
719
  }
@@ -723,14 +723,14 @@ function ResourceOverview(props) {
723
723
  }
724
724
 
725
725
  function _metricColChange() {
726
- _metricColChange = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee8(col) {
726
+ _metricColChange = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee9(col) {
727
727
  var _col2, _col3;
728
728
 
729
- var codes, endTime, params, _ref5, times, metricList, newMetricList, metricLists;
729
+ var codes, endTime, params, _ref6, times, metricList, newMetricList, metricLists;
730
730
 
731
- return _regenerator["default"].wrap(function _callee8$(_context8) {
731
+ return _regenerator["default"].wrap(function _callee9$(_context9) {
732
732
  while (1) {
733
- switch (_context8.prev = _context8.next) {
733
+ switch (_context9.prev = _context9.next) {
734
734
  case 0:
735
735
  // console.log('metricColChange col', col);
736
736
  col = (_col2 = col) === null || _col2 === void 0 ? void 0 : _col2.filter(function (item) {
@@ -738,13 +738,13 @@ function ResourceOverview(props) {
738
738
  });
739
739
 
740
740
  if ((_col3 = col) !== null && _col3 !== void 0 && _col3.length) {
741
- _context8.next = 4;
741
+ _context9.next = 4;
742
742
  break;
743
743
  }
744
744
 
745
745
  setMetric([]); // Message.error('指标未设置')
746
746
 
747
- return _context8.abrupt("return");
747
+ return _context9.abrupt("return");
748
748
 
749
749
  case 4:
750
750
  codes = col.map(function (item) {
@@ -760,7 +760,7 @@ function ResourceOverview(props) {
760
760
  };
761
761
 
762
762
  if (isAppTopo) {
763
- _ref5 = resourceOverviewProps.metricProps || {}, times = _ref5.times;
763
+ _ref6 = resourceOverviewProps.metricProps || {}, times = _ref6.times;
764
764
 
765
765
  if (times !== null && times !== void 0 && times.length) {
766
766
  params.startTime = times[0];
@@ -769,18 +769,16 @@ function ResourceOverview(props) {
769
769
  }
770
770
 
771
771
  setMetricInitLoading(true);
772
- _context8.next = 11;
772
+ _context9.next = 11;
773
773
  return _overview["default"].getMetricList(params);
774
774
 
775
775
  case 11:
776
- metricList = _context8.sent;
777
- _context8.next = 14;
778
- return (0, _services2.queryLastestValue)({
776
+ metricList = _context9.sent;
777
+ newMetricList = queryMetricList({
778
+ 'name': data.attributes.display_name
779
+ }, {
779
780
  'id': data.attributes.name
780
781
  });
781
-
782
- case 14:
783
- newMetricList = _context8.sent;
784
782
  metricLists = metricList.concat(getNewMetricList(newMetricList));
785
783
 
786
784
  _rlog.rlog.debug('metricColChange', metricLists, monitorMetricModels);
@@ -809,16 +807,75 @@ function ResourceOverview(props) {
809
807
  }, 60000);
810
808
  }
811
809
 
812
- case 20:
810
+ case 18:
813
811
  case "end":
814
- return _context8.stop();
812
+ return _context9.stop();
815
813
  }
816
814
  }
817
- }, _callee8);
815
+ }, _callee9);
818
816
  }));
819
817
  return _metricColChange.apply(this, arguments);
820
818
  }
821
819
 
820
+ var queryMetricList = /*#__PURE__*/function () {
821
+ var _ref3 = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee3(data, param) {
822
+ var checkMenus, isOpen;
823
+ return _regenerator["default"].wrap(function _callee3$(_context3) {
824
+ while (1) {
825
+ switch (_context3.prev = _context3.next) {
826
+ case 0:
827
+ if (!(ciType !== 'network_link')) {
828
+ _context3.next = 2;
829
+ break;
830
+ }
831
+
832
+ return _context3.abrupt("return", []);
833
+
834
+ case 2:
835
+ _context3.next = 4;
836
+ return (0, _services2.checkMenu)();
837
+
838
+ case 4:
839
+ checkMenus = _context3.sent;
840
+
841
+ if (!(checkMenus[0].passed == 'PASS')) {
842
+ _context3.next = 13;
843
+ break;
844
+ }
845
+
846
+ _context3.next = 8;
847
+ return (0, _services2.isOpenFlow)(data);
848
+
849
+ case 8:
850
+ isOpen = _context3.sent;
851
+
852
+ if (!isOpen) {
853
+ _context3.next = 13;
854
+ break;
855
+ }
856
+
857
+ _context3.next = 12;
858
+ return (0, _services2.queryLastestValue)(param);
859
+
860
+ case 12:
861
+ return _context3.abrupt("return", _context3.sent);
862
+
863
+ case 13:
864
+ return _context3.abrupt("return", []);
865
+
866
+ case 14:
867
+ case "end":
868
+ return _context3.stop();
869
+ }
870
+ }
871
+ }, _callee3);
872
+ }));
873
+
874
+ return function queryMetricList(_x9, _x10) {
875
+ return _ref3.apply(this, arguments);
876
+ };
877
+ }();
878
+
822
879
  var getNewMetricList = function getNewMetricList(data) {
823
880
  return [{
824
881
  errorMsg: null,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@riil-frontend/component-topology",
3
- "version": "9.0.0-a.2",
3
+ "version": "9.0.0-a.4",
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@9.0.0-a.2/build/index.html",
119
+ "homepage": "https://unpkg.com/@riil-frontend/component-topology@9.0.0-a.4/build/index.html",
120
120
  "gitHead": "2da19ffccbb7ca60a8acf396e39f542c68bb33f5"
121
121
  }