@riil-frontend/component-topology 3.1.9 → 3.1.12
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/CHANGELOG.md +6 -1
- package/build/index.js +40 -40
- package/demo/1/345/237/272/346/234/254//345/210/207/346/215/242/345/233/276/346/240/207.md +11 -0
- package/demo-mock/basic/topo/v1/api/attributes/once +95 -0
- package/demo-mock/basic/topo/v1/api/attributes/once.json +96 -1
- package/es/components/BatchAttrMetric/index.js +1 -0
- package/es/core/common/icons/icon.js +20 -6
- package/es/core/components/DisplaySettingDrawer/ResourceDisplay/CommonCheckboxGroup.module.scss +3 -3
- package/es/core/components/ResourceViewAttributeSetting/Setting.js +1 -0
- package/es/core/models/TopoApp.js +1 -1
- package/es/core/viewer/components/plugins/ResourceDetail/ResourceDetail.js +1 -0
- package/es/core/viewer/components/plugins/ResourceDetail/ResourceDetailPlugin.js +6 -0
- package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/ResourceOverview.js +660 -0
- package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/index.js +2 -637
- package/es/models/customIcon.js +16 -11
- package/es/utils/topoData.js +66 -40
- package/lib/components/BatchAttrMetric/index.js +1 -0
- package/lib/core/common/icons/icon.js +25 -6
- package/lib/core/components/DisplaySettingDrawer/ResourceDisplay/CommonCheckboxGroup.module.scss +3 -3
- package/lib/core/components/ResourceViewAttributeSetting/Setting.js +1 -0
- package/lib/core/models/TopoApp.js +1 -1
- package/lib/core/viewer/components/plugins/ResourceDetail/ResourceDetail.js +2 -0
- package/lib/core/viewer/components/plugins/ResourceDetail/ResourceDetailPlugin.js +6 -0
- package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/ResourceOverview.js +691 -0
- package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/index.js +4 -663
- package/lib/models/customIcon.js +16 -11
- package/lib/utils/topoData.js +68 -40
- package/package.json +2 -2
package/es/utils/topoData.js
CHANGED
|
@@ -129,8 +129,7 @@ var tfLink = function tfLink(engine, link, nodes) {
|
|
|
129
129
|
});
|
|
130
130
|
};
|
|
131
131
|
|
|
132
|
-
export function
|
|
133
|
-
var allCi = [].concat(topoData.nodes, topoData.links, topoData.linkGroups);
|
|
132
|
+
export function getCiTypesFromCiElements(allCi) {
|
|
134
133
|
var ciTypes = [];
|
|
135
134
|
allCi.forEach(function (element) {
|
|
136
135
|
if (element.ciType && ciTypes.indexOf(element.ciType) < 0) {
|
|
@@ -139,6 +138,10 @@ export function getCiTypes(topoData) {
|
|
|
139
138
|
});
|
|
140
139
|
return ciTypes;
|
|
141
140
|
}
|
|
141
|
+
export function getCiTypes(topoData) {
|
|
142
|
+
var allCi = [].concat(topoData.nodes, topoData.links, topoData.linkGroups);
|
|
143
|
+
return getCiTypesFromCiElements(allCi);
|
|
144
|
+
}
|
|
142
145
|
export function getAlarmSwitch(topoData) {
|
|
143
146
|
var _topoData$global;
|
|
144
147
|
|
|
@@ -411,6 +414,7 @@ export var combTopoData = function combTopoData(_ref3) {
|
|
|
411
414
|
})
|
|
412
415
|
}, getCiModSet({
|
|
413
416
|
engine: engine,
|
|
417
|
+
data: result,
|
|
414
418
|
allCis: allCis,
|
|
415
419
|
ciTypeMap: ciTypeMap,
|
|
416
420
|
globalConfig: globalConfig
|
|
@@ -423,7 +427,8 @@ export var combTopoData = function combTopoData(_ref3) {
|
|
|
423
427
|
};
|
|
424
428
|
};
|
|
425
429
|
export function getCiModSet(params) {
|
|
426
|
-
var
|
|
430
|
+
var data = params.data,
|
|
431
|
+
engine = params.engine,
|
|
427
432
|
allCis = params.allCis,
|
|
428
433
|
ciTypeMap = params.ciTypeMap,
|
|
429
434
|
globalConfig = params.globalConfig; // 当前拓扑资源字典
|
|
@@ -432,49 +437,70 @@ export function getCiModSet(params) {
|
|
|
432
437
|
var ciTypesDoc = {}; //
|
|
433
438
|
|
|
434
439
|
var bindingCiSet = {};
|
|
435
|
-
var allCiModSet =
|
|
436
|
-
var allLinkModSet =
|
|
437
|
-
Object.keys(ciTypeMap).forEach(function (key) {
|
|
438
|
-
var ciTypeObj = {};
|
|
439
|
-
var linkKeyArr = [{
|
|
440
|
-
code: "phy",
|
|
441
|
-
key: "phy",
|
|
442
|
-
name: "物理链路"
|
|
443
|
-
}, {
|
|
444
|
-
code: "agg",
|
|
445
|
-
key: "agg",
|
|
446
|
-
name: "聚合链路"
|
|
447
|
-
}, {
|
|
448
|
-
code: "export_link",
|
|
449
|
-
key: "exp",
|
|
450
|
-
name: "出口链路"
|
|
451
|
-
}];
|
|
452
|
-
|
|
453
|
-
if (key === "network_link") {
|
|
454
|
-
linkKeyArr.map(function (link, index) {
|
|
455
|
-
ciTypeObj = engine.ciTyeCache.getNetworkLinkCiType(link.key);
|
|
456
|
-
|
|
457
|
-
if (ciTypeObj) {
|
|
458
|
-
allLinkModSet[link.code] = {
|
|
459
|
-
name: link.name,
|
|
460
|
-
code: link.code,
|
|
461
|
-
icon: ciTypeObj.icon,
|
|
462
|
-
list: ciModfilter(ciTypeObj, globalConfig, "link", link.code)
|
|
463
|
-
};
|
|
464
|
-
}
|
|
440
|
+
var allCiModSet = getNodeModSet();
|
|
441
|
+
var allLinkModSet = getLinkModSet();
|
|
465
442
|
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
443
|
+
function getNodeModSet() {
|
|
444
|
+
var ciTypes = getCiTypesFromCiElements(data.nodes);
|
|
445
|
+
return getModSet(ciTypes);
|
|
446
|
+
}
|
|
447
|
+
|
|
448
|
+
function getLinkModSet() {
|
|
449
|
+
var ciTypes = getCiTypesFromCiElements([].concat(data.links, data.linkGroups));
|
|
450
|
+
return getModSet(ciTypes);
|
|
451
|
+
}
|
|
452
|
+
/**
|
|
453
|
+
*
|
|
454
|
+
* @param {array} ciTypeCodes
|
|
455
|
+
* @returns
|
|
456
|
+
*/
|
|
457
|
+
|
|
458
|
+
|
|
459
|
+
function getModSet(ciTypeCodes) {
|
|
460
|
+
var modSet = {};
|
|
461
|
+
Object.keys(ciTypeMap).filter(function (item) {
|
|
462
|
+
return ciTypeCodes.includes(item);
|
|
463
|
+
}).forEach(function (key) {
|
|
464
|
+
var ciTypeObj = ciTypeMap[key];
|
|
465
|
+
modSet[key] = {
|
|
471
466
|
name: ciTypeObj.displayName,
|
|
472
467
|
code: ciTypeObj.code,
|
|
473
468
|
icon: ciTypeObj.icon,
|
|
474
469
|
list: ciModfilter(ciTypeObj, globalConfig, "node", ciTypeObj.code)
|
|
475
470
|
};
|
|
476
|
-
|
|
477
|
-
|
|
471
|
+
|
|
472
|
+
if (key === "network_link") {
|
|
473
|
+
var linkKeyArr = [{
|
|
474
|
+
code: "phy",
|
|
475
|
+
key: "phy",
|
|
476
|
+
name: "物理链路"
|
|
477
|
+
}, {
|
|
478
|
+
code: "agg",
|
|
479
|
+
key: "agg",
|
|
480
|
+
name: "聚合链路"
|
|
481
|
+
}, {
|
|
482
|
+
code: "exit",
|
|
483
|
+
key: "exit",
|
|
484
|
+
name: "出口链路"
|
|
485
|
+
}];
|
|
486
|
+
linkKeyArr.map(function (link, index) {
|
|
487
|
+
ciTypeObj = engine.ciTyeCache.getNetworkLinkCiType(link.key);
|
|
488
|
+
|
|
489
|
+
if (ciTypeObj) {
|
|
490
|
+
modSet[link.code] = {
|
|
491
|
+
name: link.name,
|
|
492
|
+
code: link.code,
|
|
493
|
+
icon: ciTypeObj.icon,
|
|
494
|
+
list: ciModfilter(ciTypeObj, globalConfig, "link", link.code)
|
|
495
|
+
};
|
|
496
|
+
}
|
|
497
|
+
|
|
498
|
+
return link.code;
|
|
499
|
+
});
|
|
500
|
+
}
|
|
501
|
+
});
|
|
502
|
+
return modSet;
|
|
503
|
+
}
|
|
478
504
|
|
|
479
505
|
if (allCis.length > 0) {
|
|
480
506
|
allCis.forEach(function (element, index) {
|
|
@@ -93,6 +93,7 @@ var BatchAttrMetricDrawer = /*#__PURE__*/(0, _react.forwardRef)(function (_ref,
|
|
|
93
93
|
}
|
|
94
94
|
})));
|
|
95
95
|
});
|
|
96
|
+
BatchAttrMetricDrawer.displayName = 'BatchAttrMetricDrawer';
|
|
96
97
|
BatchAttrMetricDrawer.propTypes = {
|
|
97
98
|
// 数据项
|
|
98
99
|
allCiSet: _propTypes["default"].any.isRequired,
|
|
@@ -8,8 +8,10 @@ exports.getCustomIconIdFromHtId = getCustomIconIdFromHtId;
|
|
|
8
8
|
exports.getEditorIcons = getEditorIcons;
|
|
9
9
|
exports.getGroupDefaultIcons = getGroupDefaultIcons;
|
|
10
10
|
exports.getGroupIconGroups = getGroupIconGroups;
|
|
11
|
+
exports.getIconLibs = getIconLibs;
|
|
11
12
|
exports.getNodeDefaultIcons = getNodeDefaultIcons;
|
|
12
13
|
exports.getNodeIconGroups = getNodeIconGroups;
|
|
14
|
+
exports.getSystemIcons = getSystemIcons;
|
|
13
15
|
exports.getUserCustomIcons = getUserCustomIcons;
|
|
14
16
|
exports.transformCustomIcon2HtIcon = transformCustomIcon2HtIcon;
|
|
15
17
|
exports.transformCustomIcons2HtIcons = transformCustomIcons2HtIcons;
|
|
@@ -25,19 +27,36 @@ var groupDefaultIcons = [{
|
|
|
25
27
|
name: '区域',
|
|
26
28
|
url: '/img/topo/citype-icons/区域_平面.svg'
|
|
27
29
|
}];
|
|
30
|
+
|
|
31
|
+
function getSystemIcons() {
|
|
32
|
+
var networkTopoCiTypeIcons = (0, _networkTopoCiTypeIcons["default"])().filter(function (icon) {
|
|
33
|
+
return !_defaultIcons.DEFAULT_NODE_ICONS.filter(function (defaultIcon) {
|
|
34
|
+
return defaultIcon.id === icon.id;
|
|
35
|
+
}).length;
|
|
36
|
+
});
|
|
37
|
+
return [].concat(_defaultIcons.DEFAULT_NODE_ICONS, networkTopoCiTypeIcons);
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
function getIconLibs() {
|
|
41
|
+
return [{
|
|
42
|
+
id: '1',
|
|
43
|
+
name: '默认图标库1',
|
|
44
|
+
icons: getSystemIcons()
|
|
45
|
+
}, {
|
|
46
|
+
id: '2',
|
|
47
|
+
name: '默认图标库2',
|
|
48
|
+
icons: getSystemIcons()
|
|
49
|
+
}];
|
|
50
|
+
}
|
|
28
51
|
/**
|
|
29
52
|
* 获取默认图标
|
|
30
53
|
* @param {*} topo
|
|
31
54
|
* @returns
|
|
32
55
|
*/
|
|
33
56
|
|
|
57
|
+
|
|
34
58
|
function getNodeDefaultIcons(topo) {
|
|
35
|
-
|
|
36
|
-
return !_defaultIcons.DEFAULT_NODE_ICONS.filter(function (defaultIcon) {
|
|
37
|
-
return defaultIcon.id === icon.id;
|
|
38
|
-
}).length;
|
|
39
|
-
});
|
|
40
|
-
return [].concat(_defaultIcons.DEFAULT_NODE_ICONS, networkTopoCiTypeIcons, topo.options.icons || []);
|
|
59
|
+
return [].concat(getSystemIcons(), topo.options.icons || []);
|
|
41
60
|
}
|
|
42
61
|
|
|
43
62
|
function getGroupDefaultIcons(topo) {
|
package/lib/core/components/DisplaySettingDrawer/ResourceDisplay/CommonCheckboxGroup.module.scss
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
@import "@alifd/next/variables";
|
|
2
2
|
|
|
3
3
|
.contaienr {
|
|
4
4
|
padding: 16px 12px;
|
|
@@ -9,11 +9,11 @@
|
|
|
9
9
|
margin: -8px;
|
|
10
10
|
|
|
11
11
|
:global {
|
|
12
|
-
|
|
12
|
+
.#{$css-prefix}checkbox-group.next-checkbox-group-hoz {
|
|
13
13
|
display: flex;
|
|
14
14
|
flex-flow: row wrap;
|
|
15
15
|
|
|
16
|
-
|
|
16
|
+
.#{$css-prefix}checkbox-wrapper {
|
|
17
17
|
margin-left: 8px;
|
|
18
18
|
margin-right: 8px;
|
|
19
19
|
}
|
|
@@ -135,5 +135,6 @@ var ResourceDiplayInfoSetting = /*#__PURE__*/(0, _react.forwardRef)(function (pr
|
|
|
135
135
|
saveCb: saveMarkSetting
|
|
136
136
|
}));
|
|
137
137
|
});
|
|
138
|
+
ResourceDiplayInfoSetting.displayName = 'ResourceDiplayInfoSetting';
|
|
138
139
|
var _default = ResourceDiplayInfoSetting;
|
|
139
140
|
exports["default"] = _default;
|
|
@@ -48,7 +48,7 @@ var _PluginManager = _interopRequireDefault(require("./PluginManager"));
|
|
|
48
48
|
var _topoFactory = _interopRequireDefault(require("./topoFactory"));
|
|
49
49
|
|
|
50
50
|
// eslint-disable-next-line no-undef
|
|
51
|
-
var version = typeof "3.1.
|
|
51
|
+
var version = typeof "3.1.12" === 'string' ? "3.1.12" : null;
|
|
52
52
|
console.info("\u62D3\u6251\u7248\u672C: " + version);
|
|
53
53
|
/**
|
|
54
54
|
* 拓扑显示和编辑
|
|
@@ -33,6 +33,8 @@ var _ResourceOverview = _interopRequireDefault(require("./components/ResourceOve
|
|
|
33
33
|
|
|
34
34
|
var _indexModule = _interopRequireDefault(require("./index.module.scss"));
|
|
35
35
|
|
|
36
|
+
var _rlog = _interopRequireDefault(require("@riil-frontend/component-topology-utils/es/rlog"));
|
|
37
|
+
|
|
36
38
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
37
39
|
|
|
38
40
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
@@ -14,6 +14,12 @@ var _ResourceDetail = _interopRequireDefault(require("./ResourceDetail"));
|
|
|
14
14
|
function ResourceDetailPlugin(props) {
|
|
15
15
|
var viewerProps = props.viewerProps;
|
|
16
16
|
var resourceDetailProps = viewerProps === null || viewerProps === void 0 ? void 0 : viewerProps.resourceDetailProps;
|
|
17
|
+
var hideResourceDetailDrawer = (viewerProps === null || viewerProps === void 0 ? void 0 : viewerProps.hideResourceDetailDrawer) === true;
|
|
18
|
+
|
|
19
|
+
if (hideResourceDetailDrawer) {
|
|
20
|
+
return null;
|
|
21
|
+
}
|
|
22
|
+
|
|
17
23
|
return /*#__PURE__*/_react["default"].createElement(_ResourceDetail["default"], (0, _extends2["default"])({}, props, resourceDetailProps));
|
|
18
24
|
}
|
|
19
25
|
|