@riil-frontend/component-topology 11.0.22 → 11.0.24
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/components/DisplaySettingDrawer/DisplaySettingDrawer.js +1 -1
- package/es/core/hooks/useCiAttributeChange.js +1 -2
- package/es/core/hooks/usePolling.js +53 -27
- package/es/core/models/TopoApp.js +9 -36
- package/es/core/models/attributeFormatter/formatter/commonTransform.js +5 -0
- package/es/core/models/cache/CiTypeCache.js +8 -8
- package/es/core/models/utils/linkUtils.js +1 -1
- package/es/core/store/models/topoConfig.js +1 -1
- package/es/core/store/models/topoMod.js +14 -20
- package/es/core/viewer/components/plugins/ResourceDetail/components/ClusterMemberTable.js +1 -1
- package/es/networkTopo/utils/exitLinkUtil.js +4 -1
- package/lib/core/components/DisplaySettingDrawer/DisplaySettingDrawer.js +1 -1
- package/lib/core/hooks/useCiAttributeChange.js +1 -3
- package/lib/core/hooks/usePolling.js +52 -25
- package/lib/core/models/TopoApp.js +9 -36
- package/lib/core/models/attributeFormatter/formatter/commonTransform.js +5 -0
- package/lib/core/models/cache/CiTypeCache.js +8 -8
- package/lib/core/models/utils/linkUtils.js +1 -1
- package/lib/core/store/models/topoConfig.js +1 -1
- package/lib/core/store/models/topoMod.js +14 -20
- package/lib/core/viewer/components/plugins/ResourceDetail/components/ClusterMemberTable.js +1 -1
- package/lib/networkTopo/utils/exitLinkUtil.js +4 -1
- package/package.json +2 -2
@@ -56,7 +56,7 @@ var _SelectionModel = _interopRequireDefault(require("./SelectionModel"));
|
|
56
56
|
var _CiCache = _interopRequireDefault(require("./cache/CiCache"));
|
57
57
|
|
58
58
|
// eslint-disable-next-line no-undef
|
59
|
-
var version = typeof "11.0.
|
59
|
+
var version = typeof "11.0.24" === 'string' ? "11.0.24" : null;
|
60
60
|
console.info("\u62D3\u6251\u7248\u672C: " + version);
|
61
61
|
/**
|
62
62
|
* 拓扑显示和编辑
|
@@ -762,17 +762,10 @@ var Topo = /*#__PURE__*/function () {
|
|
762
762
|
this.alarm.updateState({
|
763
763
|
alarmList: alarmList
|
764
764
|
});
|
765
|
-
}
|
766
|
-
/**
|
767
|
-
* TODO 待定
|
768
|
-
* @param {*} data
|
769
|
-
*/
|
770
|
-
;
|
765
|
+
};
|
771
766
|
|
772
|
-
_proto.
|
773
|
-
|
774
|
-
function () {
|
775
|
-
var _loadAttrsAndMetrics = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee17(data) {
|
767
|
+
_proto.switchToViewMode = /*#__PURE__*/function () {
|
768
|
+
var _switchToViewMode = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee17() {
|
776
769
|
return _regenerator["default"].wrap(function _callee17$(_context17) {
|
777
770
|
while (1) {
|
778
771
|
switch (_context17.prev = _context17.next) {
|
@@ -784,26 +777,6 @@ var Topo = /*#__PURE__*/function () {
|
|
784
777
|
}, _callee17);
|
785
778
|
}));
|
786
779
|
|
787
|
-
function loadAttrsAndMetrics(_x11) {
|
788
|
-
return _loadAttrsAndMetrics.apply(this, arguments);
|
789
|
-
}
|
790
|
-
|
791
|
-
return loadAttrsAndMetrics;
|
792
|
-
}();
|
793
|
-
|
794
|
-
_proto.switchToViewMode = /*#__PURE__*/function () {
|
795
|
-
var _switchToViewMode = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee18() {
|
796
|
-
return _regenerator["default"].wrap(function _callee18$(_context18) {
|
797
|
-
while (1) {
|
798
|
-
switch (_context18.prev = _context18.next) {
|
799
|
-
case 0:
|
800
|
-
case "end":
|
801
|
-
return _context18.stop();
|
802
|
-
}
|
803
|
-
}
|
804
|
-
}, _callee18);
|
805
|
-
}));
|
806
|
-
|
807
780
|
function switchToViewMode() {
|
808
781
|
return _switchToViewMode.apply(this, arguments);
|
809
782
|
}
|
@@ -812,16 +785,16 @@ var Topo = /*#__PURE__*/function () {
|
|
812
785
|
}();
|
813
786
|
|
814
787
|
_proto.switchToEditMode = /*#__PURE__*/function () {
|
815
|
-
var _switchToEditMode = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function
|
816
|
-
return _regenerator["default"].wrap(function
|
788
|
+
var _switchToEditMode = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee18() {
|
789
|
+
return _regenerator["default"].wrap(function _callee18$(_context18) {
|
817
790
|
while (1) {
|
818
|
-
switch (
|
791
|
+
switch (_context18.prev = _context18.next) {
|
819
792
|
case 0:
|
820
793
|
case "end":
|
821
|
-
return
|
794
|
+
return _context18.stop();
|
822
795
|
}
|
823
796
|
}
|
824
|
-
},
|
797
|
+
}, _callee18);
|
825
798
|
}));
|
826
799
|
|
827
800
|
function switchToEditMode() {
|
@@ -19,6 +19,11 @@ function commonTransform(options) {
|
|
19
19
|
if (ciData[attrType + "Map"][fieldCode + "_object"]) {
|
20
20
|
fieldValue = ciData[attrType + "Map"][fieldCode + "_object"].displayName;
|
21
21
|
}
|
22
|
+
} // 分级字典特殊处理
|
23
|
+
|
24
|
+
|
25
|
+
if (fieldMeta.dict) {
|
26
|
+
fieldValue = fieldMeta.dict[fieldValue];
|
22
27
|
}
|
23
28
|
|
24
29
|
return {
|
@@ -24,7 +24,7 @@ var _keyBy = _interopRequireDefault(require("lodash/keyBy"));
|
|
24
24
|
*/
|
25
25
|
var CiTypeCache = /*#__PURE__*/function () {
|
26
26
|
function CiTypeCache() {
|
27
|
-
this.
|
27
|
+
this.ciTypeMap = {};
|
28
28
|
}
|
29
29
|
|
30
30
|
var _proto = CiTypeCache.prototype;
|
@@ -50,7 +50,7 @@ var CiTypeCache = /*#__PURE__*/function () {
|
|
50
50
|
_rlog["default"].error('查询Ci模型异常', _context.t0);
|
51
51
|
|
52
52
|
case 8:
|
53
|
-
return _context.abrupt("return", this.
|
53
|
+
return _context.abrupt("return", this.ciTypeMap);
|
54
54
|
|
55
55
|
case 9:
|
56
56
|
case "end":
|
@@ -77,7 +77,7 @@ var CiTypeCache = /*#__PURE__*/function () {
|
|
77
77
|
switch (_context2.prev = _context2.next) {
|
78
78
|
case 0:
|
79
79
|
unLoadCiTypeIds = ciTypeIds.filter(function (id) {
|
80
|
-
return !_this.
|
80
|
+
return !_this.ciTypeMap[id];
|
81
81
|
});
|
82
82
|
_context2.next = 3;
|
83
83
|
return _topo["default"].ciInfo.batchQueryCiTypeInfo(unLoadCiTypeIds);
|
@@ -85,7 +85,7 @@ var CiTypeCache = /*#__PURE__*/function () {
|
|
85
85
|
case 3:
|
86
86
|
ciTypeMetas = _context2.sent;
|
87
87
|
this.addCiTypes(ciTypeMetas);
|
88
|
-
return _context2.abrupt("return", this.
|
88
|
+
return _context2.abrupt("return", this.ciTypeMap);
|
89
89
|
|
90
90
|
case 6:
|
91
91
|
case "end":
|
@@ -111,7 +111,7 @@ var CiTypeCache = /*#__PURE__*/function () {
|
|
111
111
|
};
|
112
112
|
|
113
113
|
_proto.addCiType = function addCiType(ciTypeMeta) {
|
114
|
-
var cache = (0, _extends2["default"])({}, this.
|
114
|
+
var cache = (0, _extends2["default"])({}, this.ciTypeMap);
|
115
115
|
var attributes = adapterNetworkLinkAttributes(ciTypeMeta, ciTypeMeta.attributes || []);
|
116
116
|
var metrics = ciTypeMeta.metrics || [];
|
117
117
|
cache[ciTypeMeta.code] = (0, _extends2["default"])({}, ciTypeMeta, {
|
@@ -120,11 +120,11 @@ var CiTypeCache = /*#__PURE__*/function () {
|
|
120
120
|
metrics: metrics,
|
121
121
|
metricMap: (0, _keyBy["default"])(metrics, 'code')
|
122
122
|
});
|
123
|
-
this.
|
123
|
+
this.ciTypeMap = cache;
|
124
124
|
};
|
125
125
|
|
126
126
|
_proto.getCiType = function getCiType(typeCode) {
|
127
|
-
return this.
|
127
|
+
return this.ciTypeMap[typeCode];
|
128
128
|
};
|
129
129
|
|
130
130
|
_proto.getCiTypeByCi = function getCiTypeByCi(ci) {
|
@@ -144,7 +144,7 @@ var CiTypeCache = /*#__PURE__*/function () {
|
|
144
144
|
(0, _createClass2["default"])(CiTypeCache, [{
|
145
145
|
key: "ciTypes",
|
146
146
|
get: function get() {
|
147
|
-
return this.
|
147
|
+
return this.ciTypeMap;
|
148
148
|
}
|
149
149
|
}]);
|
150
150
|
return CiTypeCache;
|
@@ -138,7 +138,7 @@ function _getLinksDetail() {
|
|
138
138
|
case 7:
|
139
139
|
interfaceCiMap = _context.sent;
|
140
140
|
_context.next = 10;
|
141
|
-
return _CiTypeCache["default"].
|
141
|
+
return _CiTypeCache["default"].load(interfaceTypes);
|
142
142
|
|
143
143
|
case 10:
|
144
144
|
interfaceDoc = _context.sent;
|
@@ -367,7 +367,7 @@ function _default(topoApp) {
|
|
367
367
|
case 11:
|
368
368
|
data = _context4.sent;
|
369
369
|
_context4.next = 14;
|
370
|
-
return Promise.all([(0, _getTopoData.addLinkData)(data), topoApp.ciTyeCache.
|
370
|
+
return Promise.all([(0, _getTopoData.addLinkData)(data), topoApp.ciTyeCache.load((0, _topoData.getCiTypes)(data)), dispatch.customIcon.loadCustomIcons()]);
|
371
371
|
|
372
372
|
case 14:
|
373
373
|
_yield$Promise$all = _context4.sent;
|
@@ -325,7 +325,7 @@ function _default(topoApp) {
|
|
325
325
|
return (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee6() {
|
326
326
|
var _result$config;
|
327
327
|
|
328
|
-
var startTime, topoId, data, linkToData, refresh, clear, linkTo, startState, permission, result, graphConfig, topoConfig,
|
328
|
+
var startTime, topoId, data, linkToData, refresh, clear, linkTo, startState, permission, result, graphConfig, topoConfig, extraConfig, _combTopoData, topoData, resAndMetrics, _yield$Promise$all, newData, endTime;
|
329
329
|
|
330
330
|
return _regenerator["default"].wrap(function _callee6$(_context6) {
|
331
331
|
while (1) {
|
@@ -454,23 +454,17 @@ function _default(topoApp) {
|
|
454
454
|
_rlog["default"].debug('topoMod.initTopoData 查询数据完成', topoId, linkTo, result);
|
455
455
|
|
456
456
|
_context6.next = 41;
|
457
|
-
return
|
458
|
-
dispatch.customIcon.loadCustomIcons() // topoApp.elementTagTipConfig.init(result), // 暂停新配置开发
|
459
|
-
]);
|
457
|
+
return dispatch.customIcon.loadCustomIcons();
|
460
458
|
|
461
459
|
case 41:
|
462
|
-
_yield$Promise$all = _context6.sent;
|
463
|
-
ciTypeMap = _yield$Promise$all[0];
|
464
|
-
customIcons = _yield$Promise$all[1];
|
465
|
-
xxx = _yield$Promise$all[2];
|
466
460
|
extraConfig = result.global.extraConfig;
|
467
|
-
_context6.next =
|
461
|
+
_context6.next = 44;
|
468
462
|
return dispatch.displayConfig.setConfig((0, _extends2["default"])({}, extraConfig, {
|
469
463
|
alarmSwitch: result.global.alarmSwitch,
|
470
464
|
alarmListDefaultOpen: result.global.alarmListDefaultOpen
|
471
465
|
}));
|
472
466
|
|
473
|
-
case
|
467
|
+
case 44:
|
474
468
|
_combTopoData = (0, _topoData.combTopoData)({
|
475
469
|
engine: topoApp,
|
476
470
|
data: result,
|
@@ -478,7 +472,7 @@ function _default(topoApp) {
|
|
478
472
|
globalConfig: extraConfig
|
479
473
|
}), topoData = _combTopoData.topoData, resAndMetrics = _combTopoData.resAndMetrics; // rlog.debug("topoMod.initTopoData combTopoData", { topoData, resAndMetrics, });
|
480
474
|
|
481
|
-
_context6.next =
|
475
|
+
_context6.next = 47;
|
482
476
|
return _this5.update({
|
483
477
|
currentTopo: topoData.config,
|
484
478
|
data: result,
|
@@ -488,25 +482,25 @@ function _default(topoApp) {
|
|
488
482
|
resAndMetrics: resAndMetrics
|
489
483
|
});
|
490
484
|
|
491
|
-
case
|
485
|
+
case 47:
|
492
486
|
dispatch.topoBizMod.combBatchCiInfo(resAndMetrics);
|
493
487
|
dispatch.background.init(extraConfig); // TODO 优化打开拓扑图显示告警速度:打开拓扑图立即请求告警
|
494
488
|
|
495
489
|
topoApp.alarm.open(); // 加载标注悬浮框数据
|
496
490
|
|
497
|
-
_context6.next =
|
498
|
-
return Promise.all([(0, _getTopoData.addLinkData)(result), topoApp.ciTyeCache.
|
491
|
+
_context6.next = 52;
|
492
|
+
return Promise.all([(0, _getTopoData.addLinkData)(result), topoApp.ciTyeCache.load((0, _topoData.getCiTypes)(result)), topoApp.elementTagTipConfig.init(result) // 暂停新配置开发
|
499
493
|
]);
|
500
494
|
|
501
|
-
case
|
502
|
-
_yield$Promise$
|
503
|
-
newData = _yield$Promise$
|
504
|
-
_context6.next =
|
495
|
+
case 52:
|
496
|
+
_yield$Promise$all = _context6.sent;
|
497
|
+
newData = _yield$Promise$all[0];
|
498
|
+
_context6.next = 56;
|
505
499
|
return _this5.update({
|
506
500
|
data: newData
|
507
501
|
});
|
508
502
|
|
509
|
-
case
|
503
|
+
case 56:
|
510
504
|
dispatch.topoBizMod.update({
|
511
505
|
pollingSwitch: true
|
512
506
|
});
|
@@ -521,7 +515,7 @@ function _default(topoApp) {
|
|
521
515
|
loading: false
|
522
516
|
});
|
523
517
|
|
524
|
-
case
|
518
|
+
case 62:
|
525
519
|
case "end":
|
526
520
|
return _context6.stop();
|
527
521
|
}
|
@@ -150,7 +150,7 @@ function ClusterMemberTableContainer(props) {
|
|
150
150
|
ciDataResult = _yield$Promise$all[0];
|
151
151
|
memberRoleMetrics = _yield$Promise$all[1];
|
152
152
|
_context.next = 10;
|
153
|
-
return topo.ciTyeCache.
|
153
|
+
return topo.ciTyeCache.load(ciDataResult.data.map(function (item) {
|
154
154
|
return item.typeCode;
|
155
155
|
}));
|
156
156
|
|
@@ -178,8 +178,11 @@ function processExitLink(topoData) {
|
|
178
178
|
}
|
179
179
|
|
180
180
|
function findElementSerializeById(serialize, id) {
|
181
|
+
// 背景图没有a
|
181
182
|
return serialize.d.find(function (item) {
|
182
|
-
|
183
|
+
var _item$a;
|
184
|
+
|
185
|
+
return ((_item$a = item.a) === null || _item$a === void 0 ? void 0 : _item$a.id) === id;
|
183
186
|
});
|
184
187
|
}
|
185
188
|
/**
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@riil-frontend/component-topology",
|
3
|
-
"version": "11.0.
|
3
|
+
"version": "11.0.24",
|
4
4
|
"description": "拓扑",
|
5
5
|
"scripts": {
|
6
6
|
"start": "build-scripts start",
|
@@ -118,6 +118,6 @@
|
|
118
118
|
"access": "public"
|
119
119
|
},
|
120
120
|
"license": "MIT",
|
121
|
-
"homepage": "https://unpkg.com/@riil-frontend/component-topology@11.0.
|
121
|
+
"homepage": "https://unpkg.com/@riil-frontend/component-topology@11.0.24/build/index.html",
|
122
122
|
"gitHead": "2da19ffccbb7ca60a8acf396e39f542c68bb33f5"
|
123
123
|
}
|