@riil-frontend/component-topology 4.0.0-beta.9 → 4.0.2
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/1.js +2 -2
- package/build/2.js +1 -1
- package/build/index.css +1 -1
- package/build/index.js +32 -32
- package/es/components/BatchAttrMetric/setting.js +47 -7
- package/es/components/Drawer/Drawer.js +60 -0
- package/es/components/Drawer/index.js +1 -59
- package/es/constants/ResourceInfoDisplay.js +1 -4
- package/es/core/components/AlarmListPanel/components/AlarmListItem.js +31 -1
- package/es/core/components/AlarmListPanel/hooks/useAlarmList.js +34 -0
- package/es/core/components/AlarmListPanel/index.js +27 -24
- package/es/core/components/AlarmListPanel/index.module.scss +46 -16
- package/es/core/components/DisplaySettingDrawer/EdgeFlow.js +4 -6
- package/es/core/components/DisplaySettingDrawer/EdgeFlowDirection.js +4 -6
- package/es/core/components/DisplaySettingDrawer/NodeTag.js +3 -5
- package/es/core/components/DisplaySettingDrawer/NodeTip.js +4 -5
- package/es/core/components/DisplaySettingDrawer/ResourceDisplay/BasicConfig.js +3 -1
- package/es/core/components/DisplaySettingDrawer/tagtip/CustomSettingDrawer/CustomSetting.js +25 -0
- package/es/core/components/DisplaySettingDrawer/tagtip/CustomSettingDrawer/CustomSettingDrawer.js +8 -0
- package/es/core/components/TopoView/topoView.js +25 -1
- package/es/core/editor/components/settings/propertyViews/group/DataTab/GroupNodeList.js +4 -2
- package/es/core/editor/components/settings/propertyViews/group/DataTab/RelateData.js +0 -7
- package/es/core/editor/components/settings/propertyViews/group/DataTab/hoooks/useGroupRelateResource.js +13 -12
- package/es/core/editor/components/settings/propertyViews/group/GroupPropertyView.js +4 -1
- package/es/core/editor/components/settings/propertyViews/group/{DataTab/ClusterGroupRelateData → cluster}/ClusterGroupRelateData.js +22 -9
- package/es/core/editor/components/settings/propertyViews/layer/DataTab/NodeList.js +2 -5
- package/es/core/editor/components/settings/propertyViews/multipleElements/BatchSetNodeIcon.js +21 -0
- package/es/core/editor/components/settings/propertyViews/multipleElements/MultipleElementPropertyView.js +5 -0
- package/es/core/editor/components/settings/propertyViews/node/NodePropertyView.js +3 -1
- package/es/core/editor/components/settings/propertyViews/node/Setting/NameInput.js +36 -0
- package/es/core/editor/components/settings/propertyViews/node/Setting/Setting.js +2 -2
- package/es/core/editor/components/settings/propertyViews/node/data/Data.js +3 -5
- package/es/core/editor/components/settings/propertyViews/node/data/NodeRelateResourceButton.js +4 -2
- package/es/core/hooks/ht/useHtDataPropertyChangeListener.js +28 -0
- package/es/core/models/AttributeMetricDisplay.js +28 -10
- package/es/core/models/TopoApp.js +12 -7
- package/es/core/models/TopoGraphView.js +3 -1
- package/es/core/models/attributeFormatter/index.js +2 -26
- package/es/core/models/cache/{CiTyeCache.js → CiTypeCache.js} +3 -1
- package/es/core/models/tagstips/ElementTagTipConfig.js +132 -0
- package/es/core/models/tagstips/utils.js +44 -0
- package/es/core/models/utils/linkUtils.js +3 -1
- package/es/core/services/topo.js +30 -0
- package/es/core/utils/edgeUtil.js +8 -0
- package/es/core/utils/graphLinkUtil.js +22 -0
- package/es/core/viewer/components/plugins/ResourceDetail/ResourceDetail.js +1 -1
- package/es/core/viewer/components/plugins/ResourceDetail/components/ClusterMemberTable.js +24 -2
- package/es/core/viewer/components/plugins/ResourceDetail/components/ClusterMemberTable.module.scss +1 -1
- package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/BaseInfo.js +7 -101
- package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/BaseInfoBlock.js +13 -3
- package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/ResourceOverview.js +166 -89
- package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/ResourceOverviewMetric.js +7 -14
- package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/components/Configurator/index.js +38 -13
- package/es/core/viewer/components/titlebar/BasicTools.js +5 -2
- package/es/core/viewer/components/titlebar/widgets/NodesDragSwitch.js +4 -2
- package/es/hooks/useAlarm.js +59 -0
- package/es/hooks/useEventData.js +20 -0
- package/es/hooks/useGraphAlarmDisplay.js +68 -18
- package/es/hooks/useManageStatus.js +0 -34
- package/es/hooks/useResourceConfig.js +6 -13
- package/es/hooks/useSelection.js +2 -4
- package/es/hooks/useTopoEdit.js +90 -37
- package/es/models/topoAlarm.js +8 -9
- package/es/models/topoMod.js +16 -8
- package/es/style.js +1 -0
- package/es/topoCenter/components/TopoView.js +6 -1
- package/es/topoCenter/components/Topology.js +7 -1
- package/es/topoCenter/components/editor/propertyViews/LayerRelatedResourceList.js +2 -2
- package/es/topoCenter/components/editor/propertyViews/edge/addLinkDrawer/AddLinkDrawer.js +35 -15
- package/es/topoCenter/components/editor/propertyViews/edge/addLinkDrawer/components/editLinkInfo.js +11 -2
- package/es/topoCenter/components/viewer/displaySetting/LinkTagCommonRidioGroup.js +24 -0
- package/es/topoCenter/components/viewer/displaySetting/LinkTagCommonRidioGroup.module.scss +23 -0
- package/es/topoCenter/components/viewer/displaySetting/LinkTagV2.js +87 -0
- package/es/topoCenter/getTopoData.js +18 -6
- package/es/topoCenter/hooks/editor/useGroupSortResources.js +16 -0
- package/es/topoCenter/hooks/useEdgeExpand.js +25 -0
- package/es/topoCenter/hooks/useLinkDynamicStyle.js +1 -1
- package/es/topoCenter/hooks/useTopoEdit.js +3 -0
- package/es/topoCenter/models/LinkDynamicStyleExecutor.js +38 -10
- package/es/topoCenter/models/TopoCenter.js +3 -11
- package/es/topoCenter/store/functionAuth.js +2 -0
- package/es/topoCenter/utils/SortResourcesUtil.js +3 -3
- package/es/topoCenter/utils/exportData.js +13 -7
- package/es/topoCenter/utils/linkUtil.js +8 -0
- package/es/utils/ResourceConfigUtil.js +4 -5
- package/es/utils/clusterUtil.js +27 -2
- package/es/utils/htElementDataUtil.js +22 -1
- package/es/utils/htElementUtils.js +22 -9
- package/es/utils/showGraphManageStatusUtil.js +67 -0
- package/es/utils/topoData.js +57 -32
- package/lib/components/BatchAttrMetric/setting.js +47 -6
- package/lib/components/Drawer/Drawer.js +73 -0
- package/lib/components/Drawer/index.js +2 -64
- package/lib/constants/ResourceInfoDisplay.js +1 -4
- package/lib/core/components/AlarmListPanel/components/AlarmListItem.js +31 -1
- package/lib/core/components/AlarmListPanel/hooks/useAlarmList.js +40 -0
- package/lib/core/components/AlarmListPanel/index.js +30 -24
- package/lib/core/components/AlarmListPanel/index.module.scss +46 -16
- package/lib/core/components/DisplaySettingDrawer/EdgeFlow.js +4 -6
- package/lib/core/components/DisplaySettingDrawer/EdgeFlowDirection.js +4 -6
- package/lib/core/components/DisplaySettingDrawer/NodeTag.js +3 -6
- package/lib/core/components/DisplaySettingDrawer/NodeTip.js +4 -6
- package/lib/core/components/DisplaySettingDrawer/ResourceDisplay/BasicConfig.js +3 -1
- package/lib/core/components/DisplaySettingDrawer/tagtip/CustomSettingDrawer/CustomSetting.js +39 -0
- package/lib/core/components/DisplaySettingDrawer/tagtip/CustomSettingDrawer/CustomSettingDrawer.js +17 -0
- package/lib/core/components/TopoView/topoView.js +28 -1
- package/lib/core/editor/components/settings/propertyViews/group/DataTab/GroupNodeList.js +4 -2
- package/lib/core/editor/components/settings/propertyViews/group/DataTab/RelateData.js +0 -8
- package/lib/core/editor/components/settings/propertyViews/group/DataTab/hoooks/useGroupRelateResource.js +13 -13
- package/lib/core/editor/components/settings/propertyViews/group/GroupPropertyView.js +5 -1
- package/lib/core/editor/components/settings/propertyViews/group/{DataTab/ClusterGroupRelateData → cluster}/ClusterGroupRelateData.js +23 -9
- package/lib/core/editor/components/settings/propertyViews/layer/DataTab/NodeList.js +2 -5
- package/lib/core/editor/components/settings/propertyViews/multipleElements/BatchSetNodeIcon.js +31 -0
- package/lib/core/editor/components/settings/propertyViews/multipleElements/MultipleElementPropertyView.js +6 -0
- package/lib/core/editor/components/settings/propertyViews/node/NodePropertyView.js +3 -1
- package/lib/core/editor/components/settings/propertyViews/node/Setting/NameInput.js +52 -0
- package/lib/core/editor/components/settings/propertyViews/node/Setting/Setting.js +3 -3
- package/lib/core/editor/components/settings/propertyViews/node/data/Data.js +3 -5
- package/lib/core/editor/components/settings/propertyViews/node/data/NodeRelateResourceButton.js +5 -2
- package/lib/core/hooks/ht/useHtDataPropertyChangeListener.js +37 -0
- package/lib/core/models/AttributeMetricDisplay.js +28 -10
- package/lib/core/models/TopoApp.js +10 -5
- package/lib/core/models/TopoGraphView.js +3 -1
- package/lib/core/models/attributeFormatter/index.js +2 -26
- package/lib/core/models/cache/{CiTyeCache.js → CiTypeCache.js} +3 -1
- package/lib/core/models/tagstips/ElementTagTipConfig.js +142 -0
- package/lib/core/models/tagstips/utils.js +59 -0
- package/lib/core/models/utils/linkUtils.js +3 -1
- package/lib/core/services/topo.js +40 -0
- package/lib/core/utils/edgeUtil.js +12 -0
- package/lib/core/utils/graphLinkUtil.js +27 -0
- package/lib/core/viewer/components/plugins/ResourceDetail/ResourceDetail.js +1 -1
- package/lib/core/viewer/components/plugins/ResourceDetail/components/ClusterMemberTable.js +25 -2
- package/lib/core/viewer/components/plugins/ResourceDetail/components/ClusterMemberTable.module.scss +1 -1
- package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/BaseInfo.js +7 -101
- package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/BaseInfoBlock.js +13 -3
- package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/ResourceOverview.js +166 -89
- package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/ResourceOverviewMetric.js +7 -14
- package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/components/Configurator/index.js +38 -13
- package/lib/core/viewer/components/titlebar/BasicTools.js +6 -2
- package/lib/core/viewer/components/titlebar/widgets/NodesDragSwitch.js +4 -2
- package/lib/hooks/useAlarm.js +61 -0
- package/lib/hooks/useEventData.js +28 -0
- package/lib/hooks/useGraphAlarmDisplay.js +69 -18
- package/lib/hooks/useManageStatus.js +0 -34
- package/lib/hooks/useResourceConfig.js +6 -12
- package/lib/hooks/useSelection.js +1 -5
- package/lib/hooks/useTopoEdit.js +94 -36
- package/lib/models/topoAlarm.js +8 -9
- package/lib/models/topoMod.js +15 -8
- package/lib/style.js +1 -0
- package/lib/topoCenter/components/TopoView.js +8 -1
- package/lib/topoCenter/components/Topology.js +8 -1
- package/lib/topoCenter/components/editor/propertyViews/LayerRelatedResourceList.js +1 -1
- package/lib/topoCenter/components/editor/propertyViews/edge/addLinkDrawer/AddLinkDrawer.js +35 -14
- package/lib/topoCenter/components/editor/propertyViews/edge/addLinkDrawer/components/editLinkInfo.js +11 -2
- package/lib/topoCenter/components/viewer/displaySetting/LinkTagCommonRidioGroup.js +35 -0
- package/lib/topoCenter/components/viewer/displaySetting/LinkTagCommonRidioGroup.module.scss +23 -0
- package/lib/topoCenter/components/viewer/displaySetting/LinkTagV2.js +102 -0
- package/lib/topoCenter/getTopoData.js +19 -6
- package/lib/topoCenter/hooks/editor/useGroupSortResources.js +21 -0
- package/lib/topoCenter/hooks/useEdgeExpand.js +33 -0
- package/lib/topoCenter/hooks/useLinkDynamicStyle.js +1 -1
- package/lib/topoCenter/hooks/useTopoEdit.js +3 -0
- package/lib/topoCenter/models/LinkDynamicStyleExecutor.js +38 -9
- package/lib/topoCenter/models/TopoCenter.js +3 -12
- package/lib/topoCenter/store/functionAuth.js +2 -0
- package/lib/topoCenter/utils/SortResourcesUtil.js +3 -3
- package/lib/topoCenter/utils/exportData.js +14 -7
- package/lib/topoCenter/utils/linkUtil.js +15 -0
- package/lib/utils/ResourceConfigUtil.js +4 -4
- package/lib/utils/clusterUtil.js +34 -2
- package/lib/utils/htElementDataUtil.js +38 -1
- package/lib/utils/htElementUtils.js +24 -9
- package/lib/utils/showGraphManageStatusUtil.js +78 -0
- package/lib/utils/topoData.js +59 -32
- package/package.json +5 -5
|
@@ -37,7 +37,9 @@ var TopoGraphView = /*#__PURE__*/function () {
|
|
|
37
37
|
};
|
|
38
38
|
|
|
39
39
|
_proto.getHtDataModel = function getHtDataModel() {
|
|
40
|
-
|
|
40
|
+
var _this$topoClient;
|
|
41
|
+
|
|
42
|
+
return (_this$topoClient = this.topoClient) === null || _this$topoClient === void 0 ? void 0 : _this$topoClient.getDataModel();
|
|
41
43
|
}
|
|
42
44
|
/**
|
|
43
45
|
* 缩放平移整个拓扑以展示所有的图元
|
|
@@ -6,8 +6,6 @@ exports.__esModule = true;
|
|
|
6
6
|
exports["default"] = void 0;
|
|
7
7
|
exports.formatMetric = formatMetric;
|
|
8
8
|
|
|
9
|
-
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
10
|
-
|
|
11
9
|
var _rlog = _interopRequireDefault(require("@riil-frontend/component-topology-utils/es/rlog"));
|
|
12
10
|
|
|
13
11
|
var _utils = require("@riil-frontend/utils");
|
|
@@ -37,28 +35,6 @@ function formatMetric(val, metricInfo) {
|
|
|
37
35
|
return "" + val;
|
|
38
36
|
}
|
|
39
37
|
}
|
|
40
|
-
|
|
41
|
-
function addLinkMetricUnderlineArrow(metricCode) {
|
|
42
|
-
var map = {
|
|
43
|
-
// 总流速和总带宽利用率:双向箭头
|
|
44
|
-
'interface_totalbps': 'both',
|
|
45
|
-
'bandwidth_utilization': 'both',
|
|
46
|
-
// 发送速率和发送带宽利用率:背向取值端口的箭头 指向目的
|
|
47
|
-
'out_rate': 'to',
|
|
48
|
-
'out_bandwidth_utilization': 'to',
|
|
49
|
-
// 接收速率和接收带宽利用率:指向取值端口的箭头 指向源
|
|
50
|
-
'in_rate': 'from',
|
|
51
|
-
'in_bandwidth_utilization': 'from'
|
|
52
|
-
};
|
|
53
|
-
|
|
54
|
-
if (map[metricCode]) {
|
|
55
|
-
return {
|
|
56
|
-
underlineArrow: map[metricCode]
|
|
57
|
-
};
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
return {};
|
|
61
|
-
}
|
|
62
38
|
/**
|
|
63
39
|
* 标注值格式化
|
|
64
40
|
*/
|
|
@@ -100,7 +76,7 @@ var AttributeFormatter = /*#__PURE__*/function () {
|
|
|
100
76
|
fieldValue = ciData[attrType + "Map"][fieldCode + "_object"].displayName;
|
|
101
77
|
}
|
|
102
78
|
|
|
103
|
-
return
|
|
79
|
+
return {
|
|
104
80
|
type: item.type,
|
|
105
81
|
code: item.code,
|
|
106
82
|
// 属性code
|
|
@@ -109,7 +85,7 @@ var AttributeFormatter = /*#__PURE__*/function () {
|
|
|
109
85
|
value: formatMetric(fieldValue, fieldMeta),
|
|
110
86
|
// 属性值
|
|
111
87
|
originValue: fieldValue
|
|
112
|
-
}
|
|
88
|
+
};
|
|
113
89
|
};
|
|
114
90
|
|
|
115
91
|
_proto.attributeTransform = function attributeTransform(item, ciData) {
|
|
@@ -94,8 +94,10 @@ var CiTyeCache = /*#__PURE__*/function () {
|
|
|
94
94
|
source_id: '源端口',
|
|
95
95
|
destination_id: '目的端口'
|
|
96
96
|
}[attr.code] || attr.name;
|
|
97
|
+
var userVisible = ['source_id', 'destination_id'].indexOf(attr.code) !== -1 ? true : attr.userVisible;
|
|
97
98
|
return (0, _extends2["default"])({}, attr, {
|
|
98
|
-
name: name
|
|
99
|
+
name: name,
|
|
100
|
+
userVisible: userVisible
|
|
99
101
|
});
|
|
100
102
|
});
|
|
101
103
|
var metrics = ciTypeMeta.metrics || [];
|
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
|
|
5
|
+
exports.__esModule = true;
|
|
6
|
+
exports["default"] = void 0;
|
|
7
|
+
|
|
8
|
+
var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
|
|
9
|
+
|
|
10
|
+
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
|
|
11
|
+
|
|
12
|
+
var _utils = require("./utils");
|
|
13
|
+
|
|
14
|
+
var _topo = require("../../services/topo");
|
|
15
|
+
|
|
16
|
+
var ElementTagTipConfig = /*#__PURE__*/function () {
|
|
17
|
+
function ElementTagTipConfig(topo) {
|
|
18
|
+
this.topoData = void 0;
|
|
19
|
+
this.mtCodes = void 0;
|
|
20
|
+
this.mtMetricsMap = void 0;
|
|
21
|
+
this.mtCiTypeMap = void 0;
|
|
22
|
+
this.topo = topo;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
var _proto = ElementTagTipConfig.prototype;
|
|
26
|
+
|
|
27
|
+
_proto.init = /*#__PURE__*/function () {
|
|
28
|
+
var _init = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee(topoData) {
|
|
29
|
+
return _regenerator["default"].wrap(function _callee$(_context) {
|
|
30
|
+
while (1) {
|
|
31
|
+
switch (_context.prev = _context.next) {
|
|
32
|
+
case 0:
|
|
33
|
+
this.topoData = topoData;
|
|
34
|
+
this.mtCodes = (0, _utils.getMonitorTemplateCodesFromTopoData)(topoData);
|
|
35
|
+
_context.next = 4;
|
|
36
|
+
return (0, _topo.getMetricsByMonitorTemplateCodes)(this.mtCodes);
|
|
37
|
+
|
|
38
|
+
case 4:
|
|
39
|
+
this.mtMetricsMap = _context.sent;
|
|
40
|
+
this.mtCiTypeMap = (0, _utils.getMtCodeCiTypeMap)(topoData);
|
|
41
|
+
|
|
42
|
+
case 6:
|
|
43
|
+
case "end":
|
|
44
|
+
return _context.stop();
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
}, _callee, this);
|
|
48
|
+
}));
|
|
49
|
+
|
|
50
|
+
function init(_x) {
|
|
51
|
+
return _init.apply(this, arguments);
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
return init;
|
|
55
|
+
}()
|
|
56
|
+
/**
|
|
57
|
+
* 获得节点字段配置项map
|
|
58
|
+
*/
|
|
59
|
+
;
|
|
60
|
+
|
|
61
|
+
_proto.getNodeFiedldMap = function getNodeFiedldMap() {
|
|
62
|
+
var mtCodes = (0, _utils.getNodeMtCodes)(this.topoData);
|
|
63
|
+
return this.getFiedldMapByType(mtCodes, 'node');
|
|
64
|
+
}
|
|
65
|
+
/**
|
|
66
|
+
* 获得节点字段配置项map
|
|
67
|
+
*/
|
|
68
|
+
;
|
|
69
|
+
|
|
70
|
+
_proto.getLinkFidldMap = function getLinkFidldMap() {
|
|
71
|
+
var mtCodes = (0, _utils.getLinkMtCodes)(this.topoData);
|
|
72
|
+
return this.getFiedldMapByType(mtCodes, 'link');
|
|
73
|
+
};
|
|
74
|
+
|
|
75
|
+
_proto.getFiedldMapByType = function getFiedldMapByType(mtCodes, type) {
|
|
76
|
+
var _this = this;
|
|
77
|
+
|
|
78
|
+
var map = {};
|
|
79
|
+
mtCodes.forEach(function (mtCode) {
|
|
80
|
+
var ciType = _this.mtCiTypeMap[mtCode];
|
|
81
|
+
|
|
82
|
+
var attributes = _this.topo.ciTyeCache.getCiType(ciType).attributes.filter(function (attr) {
|
|
83
|
+
return !!attr.userVisible;
|
|
84
|
+
});
|
|
85
|
+
|
|
86
|
+
var metrics = _this.getMtMetricModels(mtCode);
|
|
87
|
+
|
|
88
|
+
var extItems = type === 'node' ? [{
|
|
89
|
+
lavel: '图片名称',
|
|
90
|
+
value: 'graph:name'
|
|
91
|
+
}, {
|
|
92
|
+
lavel: '资源类型',
|
|
93
|
+
value: 'ciType:name'
|
|
94
|
+
}] : [];
|
|
95
|
+
map[mtCode] = [].concat(extItems, attributes.map(function (item) {
|
|
96
|
+
return {
|
|
97
|
+
type: 'attribute',
|
|
98
|
+
label: item.name,
|
|
99
|
+
value: "attribute:" + item.code,
|
|
100
|
+
data: item
|
|
101
|
+
};
|
|
102
|
+
}), metrics.map(function (item) {
|
|
103
|
+
return {
|
|
104
|
+
type: 'metric',
|
|
105
|
+
label: item.name,
|
|
106
|
+
value: "metric:" + item.code,
|
|
107
|
+
data: item
|
|
108
|
+
};
|
|
109
|
+
}));
|
|
110
|
+
});
|
|
111
|
+
return map;
|
|
112
|
+
};
|
|
113
|
+
|
|
114
|
+
_proto.getMtMetricModels = function getMtMetricModels(mtCode) {
|
|
115
|
+
var _this2 = this;
|
|
116
|
+
|
|
117
|
+
var ciType = this.mtCiTypeMap[mtCode];
|
|
118
|
+
var ciTypeModel = this.topo.ciTyeCache.getCiType(ciType);
|
|
119
|
+
var metrics = ciTypeModel.metrics.filter(function (m) {
|
|
120
|
+
return !!_this2.mtMetricsMap[mtCode][m.code];
|
|
121
|
+
});
|
|
122
|
+
return metrics;
|
|
123
|
+
};
|
|
124
|
+
|
|
125
|
+
_proto.getMtMetricModelMap = function getMtMetricModelMap(mtCode) {
|
|
126
|
+
var metricModels = this.getMtMetricModelMap(mtCode);
|
|
127
|
+
var map = {};
|
|
128
|
+
metricModels.forEach(function (item) {
|
|
129
|
+
map[item.code] = item;
|
|
130
|
+
});
|
|
131
|
+
return map;
|
|
132
|
+
};
|
|
133
|
+
|
|
134
|
+
_proto.getMetricModel = function getMetricModel(mtCode, metricCode) {
|
|
135
|
+
return this.getMtMetricModelMap(mtCode)[metricCode];
|
|
136
|
+
};
|
|
137
|
+
|
|
138
|
+
return ElementTagTipConfig;
|
|
139
|
+
}();
|
|
140
|
+
|
|
141
|
+
exports["default"] = ElementTagTipConfig;
|
|
142
|
+
;
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
exports.__esModule = true;
|
|
4
|
+
exports.getLinkMtCodes = getLinkMtCodes;
|
|
5
|
+
exports.getMonitorTemplateCodeFromCiData = getMonitorTemplateCodeFromCiData;
|
|
6
|
+
exports.getMonitorTemplateCodesFromTopoData = getMonitorTemplateCodesFromTopoData;
|
|
7
|
+
exports.getMtCodeCiTypeMap = getMtCodeCiTypeMap;
|
|
8
|
+
exports.getMtCodes = getMtCodes;
|
|
9
|
+
exports.getNodeMtCodes = getNodeMtCodes;
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* 获得监控模板code
|
|
13
|
+
* @param {*} data
|
|
14
|
+
* @returns
|
|
15
|
+
*/
|
|
16
|
+
function getMonitorTemplateCodeFromCiData(data) {
|
|
17
|
+
var _data$attributes;
|
|
18
|
+
|
|
19
|
+
// eslint-disable-next-line camelcase
|
|
20
|
+
return (_data$attributes = data.attributes) === null || _data$attributes === void 0 ? void 0 : _data$attributes.support_templates;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
function getMtCodes(cis) {
|
|
24
|
+
var codes = [];
|
|
25
|
+
cis.forEach(function (ci) {
|
|
26
|
+
var code = getMonitorTemplateCodeFromCiData(ci);
|
|
27
|
+
|
|
28
|
+
if (code && codes.indexOf(code) === -1) {
|
|
29
|
+
codes.push(code);
|
|
30
|
+
}
|
|
31
|
+
});
|
|
32
|
+
return codes;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
function getNodeMtCodes(data) {
|
|
36
|
+
var nodes = data.nodes;
|
|
37
|
+
return getMtCodes(nodes);
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
function getLinkMtCodes(data) {
|
|
41
|
+
var links = data.links;
|
|
42
|
+
return getMtCodes(links);
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
function getMonitorTemplateCodesFromTopoData(data) {
|
|
46
|
+
return [].concat(getNodeMtCodes(data), getLinkMtCodes(data));
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
function getMtCodeCiTypeMap(data) {
|
|
50
|
+
var nodes = data.nodes,
|
|
51
|
+
links = data.links;
|
|
52
|
+
var map = {};
|
|
53
|
+
var cis = [].concat(nodes, links);
|
|
54
|
+
cis.forEach(function (ci) {
|
|
55
|
+
var mtCode = getMonitorTemplateCodeFromCiData(ci);
|
|
56
|
+
map[mtCode] = ci.ciType;
|
|
57
|
+
});
|
|
58
|
+
return map;
|
|
59
|
+
}
|
|
@@ -157,7 +157,9 @@ function _getLinksDetail() {
|
|
|
157
157
|
case 10:
|
|
158
158
|
interfaceCis = _context2.sent;
|
|
159
159
|
_context2.next = 13;
|
|
160
|
-
return getInterfaceObject(interfaceTypes)
|
|
160
|
+
return getInterfaceObject(interfaceTypes.filter(function (item) {
|
|
161
|
+
return item !== 'ip';
|
|
162
|
+
}));
|
|
161
163
|
|
|
162
164
|
case 13:
|
|
163
165
|
interfaceDoc = _context2.sent;
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
|
|
5
|
+
exports.__esModule = true;
|
|
6
|
+
exports.getMetricsByMonitorTemplateCodes = getMetricsByMonitorTemplateCodes;
|
|
7
|
+
|
|
8
|
+
var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
|
|
9
|
+
|
|
10
|
+
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
|
|
11
|
+
|
|
12
|
+
var _componentTopologyUtils = require("@riil-frontend/component-topology-utils");
|
|
13
|
+
|
|
14
|
+
function getMetricsByMonitorTemplateCodes(_x) {
|
|
15
|
+
return _getMetricsByMonitorTemplateCodes.apply(this, arguments);
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
function _getMetricsByMonitorTemplateCodes() {
|
|
19
|
+
_getMetricsByMonitorTemplateCodes = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee(mtCodes) {
|
|
20
|
+
var result;
|
|
21
|
+
return _regenerator["default"].wrap(function _callee$(_context) {
|
|
22
|
+
while (1) {
|
|
23
|
+
switch (_context.prev = _context.next) {
|
|
24
|
+
case 0:
|
|
25
|
+
_context.next = 2;
|
|
26
|
+
return _componentTopologyUtils.request.post('/topo/v1/api/attributes/metricByTemplateCode', mtCodes);
|
|
27
|
+
|
|
28
|
+
case 2:
|
|
29
|
+
result = _context.sent;
|
|
30
|
+
return _context.abrupt("return", result);
|
|
31
|
+
|
|
32
|
+
case 4:
|
|
33
|
+
case "end":
|
|
34
|
+
return _context.stop();
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
}, _callee);
|
|
38
|
+
}));
|
|
39
|
+
return _getMetricsByMonitorTemplateCodes.apply(this, arguments);
|
|
40
|
+
}
|
|
@@ -1,8 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
|
|
3
5
|
exports.__esModule = true;
|
|
4
6
|
exports.updateEdgeExpanded = void 0;
|
|
5
7
|
|
|
8
|
+
var _rlog = _interopRequireDefault(require("@riil-frontend/component-topology-utils/es/rlog"));
|
|
9
|
+
|
|
6
10
|
/**
|
|
7
11
|
* 根据配置更新连线展开折叠状态
|
|
8
12
|
*
|
|
@@ -20,8 +24,16 @@ var updateEdgeExpanded = function updateEdgeExpanded(topo) {
|
|
|
20
24
|
|
|
21
25
|
if (expandAllEdges === false) {
|
|
22
26
|
htTopo.collapseAllEdgeGroups();
|
|
27
|
+
|
|
28
|
+
_rlog["default"].debug('updateEdgeExpanded 折叠');
|
|
23
29
|
} else {
|
|
24
30
|
htTopo.expandAllEdgeGroups();
|
|
31
|
+
|
|
32
|
+
_rlog["default"].debug('updateEdgeExpanded 展开');
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
if (topo.linkDynamicStyleExecutor) {
|
|
36
|
+
topo.linkDynamicStyleExecutor.execute();
|
|
25
37
|
}
|
|
26
38
|
};
|
|
27
39
|
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
exports.__esModule = true;
|
|
4
|
+
exports.fixLink = fixLink;
|
|
5
|
+
|
|
6
|
+
var _htElementUtils = require("../../utils/htElementUtils");
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* 链路另一端变更后更新另一端,另一端不存在删除线
|
|
10
|
+
* @param {*} topo
|
|
11
|
+
*/
|
|
12
|
+
function fixLink(topo) {
|
|
13
|
+
var linkDatas = topo.dataModel.getEdges();
|
|
14
|
+
var dm = topo.getHtTopo().getGraphView().dm();
|
|
15
|
+
var edges = (0, _htElementUtils.getEdges)(dm);
|
|
16
|
+
edges.forEach(function (edge) {
|
|
17
|
+
var source = edge.getSource();
|
|
18
|
+
var linkData = linkDatas.find(function (data) {
|
|
19
|
+
return data.id === edge.getTag();
|
|
20
|
+
});
|
|
21
|
+
|
|
22
|
+
if (linkData && source.getTag() !== linkData.source) {
|
|
23
|
+
var node = dm.getDataByTag(linkData.source);
|
|
24
|
+
edge.setSource(node);
|
|
25
|
+
}
|
|
26
|
+
});
|
|
27
|
+
}
|
|
@@ -228,7 +228,7 @@ function ResourceDetail(props) {
|
|
|
228
228
|
return tabBodys.length === 1 ? /*#__PURE__*/_react["default"].createElement(_ResourceOverview["default"], (0, _extends2["default"])({}, props, activeData, {
|
|
229
229
|
userId: userId,
|
|
230
230
|
style: {
|
|
231
|
-
|
|
231
|
+
overflowY: 'auto',
|
|
232
232
|
height: '100%'
|
|
233
233
|
}
|
|
234
234
|
})) : /*#__PURE__*/_react["default"].createElement(_FullheightTab["default"], {
|
|
@@ -29,6 +29,8 @@ var _metric = require("../../../../../services/cmdb/metric");
|
|
|
29
29
|
|
|
30
30
|
var _ClusterMemberTableModule = _interopRequireDefault(require("./ClusterMemberTable.module.scss"));
|
|
31
31
|
|
|
32
|
+
var _Link = _interopRequireDefault(require("../../../../../../components/Link"));
|
|
33
|
+
|
|
32
34
|
function ClusterChildrenTable(props) {
|
|
33
35
|
var data = props.data,
|
|
34
36
|
topo = props.topo;
|
|
@@ -109,7 +111,20 @@ function ClusterChildrenTable(props) {
|
|
|
109
111
|
plugins: plugins
|
|
110
112
|
}),
|
|
111
113
|
tableProps = _useNextTable.tableProps,
|
|
112
|
-
paginationProps = _useNextTable.paginationProps;
|
|
114
|
+
paginationProps = _useNextTable.paginationProps; // url 处理,UICBB 的地址需截取前缀
|
|
115
|
+
|
|
116
|
+
|
|
117
|
+
function formatUrl(url) {
|
|
118
|
+
var _window, _window$location;
|
|
119
|
+
|
|
120
|
+
var prefix = '/default/pagecenter';
|
|
121
|
+
|
|
122
|
+
if (((_window = window) === null || _window === void 0 ? void 0 : (_window$location = _window.location) === null || _window$location === void 0 ? void 0 : _window$location.pathname.indexOf(prefix)) === 0 && (url === null || url === void 0 ? void 0 : url.indexOf(prefix)) === 0) {
|
|
123
|
+
return url.split(prefix)[1];
|
|
124
|
+
} else {
|
|
125
|
+
return url;
|
|
126
|
+
}
|
|
127
|
+
}
|
|
113
128
|
/**
|
|
114
129
|
* Table列数据
|
|
115
130
|
*/
|
|
@@ -121,7 +136,15 @@ function ClusterChildrenTable(props) {
|
|
|
121
136
|
dataIndex: 'attributes.display_name',
|
|
122
137
|
// sortable: true,
|
|
123
138
|
lock: true,
|
|
124
|
-
width: 160
|
|
139
|
+
width: 160,
|
|
140
|
+
cell: function cell(vallue, index, item) {
|
|
141
|
+
var link = "/default/pagecenter/resDetail/view/" + item.id + "?resId=" + item.id + "&domainCode=" + item.typeObject.domain + "&title=" + vallue + "&ciCode=" + item.typeCode; // 资源跳转链接
|
|
142
|
+
|
|
143
|
+
return /*#__PURE__*/_react["default"].createElement(_Link["default"], {
|
|
144
|
+
title: vallue || "",
|
|
145
|
+
to: formatUrl(link)
|
|
146
|
+
}, vallue || "-");
|
|
147
|
+
}
|
|
125
148
|
}, {
|
|
126
149
|
id: '2',
|
|
127
150
|
title: 'IP地址',
|
package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/BaseInfo.js
CHANGED
|
@@ -25,14 +25,12 @@ function formatUrl(url) {
|
|
|
25
25
|
|
|
26
26
|
function AttributeItem(props) {
|
|
27
27
|
var style = props.style,
|
|
28
|
-
key = props.key,
|
|
29
28
|
label = props.label,
|
|
30
29
|
contentTitle = props.contentTitle,
|
|
31
30
|
children = props.children;
|
|
32
31
|
return /*#__PURE__*/_react["default"].createElement("div", {
|
|
33
32
|
className: _indexModule["default"].item,
|
|
34
|
-
style: style || {}
|
|
35
|
-
key: key
|
|
33
|
+
style: style || {}
|
|
36
34
|
}, /*#__PURE__*/_react["default"].createElement("span", {
|
|
37
35
|
className: _indexModule["default"].label
|
|
38
36
|
}, label + ':'), /*#__PURE__*/_react["default"].createElement("span", {
|
|
@@ -44,109 +42,17 @@ function AttributeItem(props) {
|
|
|
44
42
|
function BaseInfoContent(props) {
|
|
45
43
|
var topo = props.topo,
|
|
46
44
|
type = props.type,
|
|
47
|
-
data = props.data;
|
|
48
|
-
// node: [
|
|
49
|
-
// {
|
|
50
|
-
// label: "资源名称:",
|
|
51
|
-
// objKey: "resource",
|
|
52
|
-
// render(valueData, key) {
|
|
53
|
-
// const { display_name, link } = valueData;
|
|
54
|
-
// return (
|
|
55
|
-
// <AttributeItem
|
|
56
|
-
// key={key}
|
|
57
|
-
// label="资源名称:"
|
|
58
|
-
// contentTitle={display_name}
|
|
59
|
-
// >
|
|
60
|
-
// {valueData ? (
|
|
61
|
-
// <Link className={styles.link} to={formatUrl(link)}>
|
|
62
|
-
// {display_name || "-"}
|
|
63
|
-
// </Link>
|
|
64
|
-
// ) : (
|
|
65
|
-
// "-"
|
|
66
|
-
// )}
|
|
67
|
-
// </AttributeItem>
|
|
68
|
-
// );
|
|
69
|
-
// },
|
|
70
|
-
// },
|
|
71
|
-
// {
|
|
72
|
-
// label: "IP地址:",
|
|
73
|
-
// objKey: "ipv4_address",
|
|
74
|
-
// },
|
|
75
|
-
// {
|
|
76
|
-
// label: "资产编号:",
|
|
77
|
-
// objKey: "asset_number",
|
|
78
|
-
// },
|
|
79
|
-
// {
|
|
80
|
-
// label: "资源类型:",
|
|
81
|
-
// objKey: "ciName",
|
|
82
|
-
// },
|
|
83
|
-
// {
|
|
84
|
-
// label: "资源位置:",
|
|
85
|
-
// objKey: "res_address",
|
|
86
|
-
// },
|
|
87
|
-
// // {
|
|
88
|
-
// // label: '负责人:',
|
|
89
|
-
// // objKey: 'principal'
|
|
90
|
-
// // },
|
|
91
|
-
// ],
|
|
92
|
-
// link: [
|
|
93
|
-
// {
|
|
94
|
-
// label: "链路带宽:",
|
|
95
|
-
// objKey: "rated_bandwidth",
|
|
96
|
-
// style: { width: "100%" },
|
|
97
|
-
// },
|
|
98
|
-
// {
|
|
99
|
-
// label: "源IP地址:",
|
|
100
|
-
// objKey: "source_ipv4",
|
|
101
|
-
// },
|
|
102
|
-
// {
|
|
103
|
-
// label: "目的IP地址:",
|
|
104
|
-
// objKey: "destination_ipv4",
|
|
105
|
-
// },
|
|
106
|
-
// {
|
|
107
|
-
// label: "源端口:",
|
|
108
|
-
// objKey: "source_Interface",
|
|
109
|
-
// },
|
|
110
|
-
// {
|
|
111
|
-
// label: "目的端口:",
|
|
112
|
-
// objKey: "destination_Interface",
|
|
113
|
-
// },
|
|
114
|
-
// {
|
|
115
|
-
// label: "连接方式:",
|
|
116
|
-
// objKey: "network_link.connect_type",
|
|
117
|
-
// },
|
|
118
|
-
// ],
|
|
119
|
-
// };
|
|
120
|
-
// return (
|
|
121
|
-
// <>
|
|
122
|
-
// {itemCols[type]?.map(({ label, objKey, style, render }, key) => {
|
|
123
|
-
// return data[objKey] === false ? (
|
|
124
|
-
// ""
|
|
125
|
-
// ) : render ? (
|
|
126
|
-
// render(data[objKey], key)
|
|
127
|
-
// ) : (
|
|
128
|
-
// <AttributeItem
|
|
129
|
-
// key={key}
|
|
130
|
-
// label={label}
|
|
131
|
-
// style={style || {}}
|
|
132
|
-
// contentTitle={data[objKey]}
|
|
133
|
-
// >
|
|
134
|
-
// {data[objKey] || "-"}
|
|
135
|
-
// </AttributeItem>
|
|
136
|
-
// );
|
|
137
|
-
// })}
|
|
138
|
-
// </>
|
|
139
|
-
// );
|
|
140
|
-
|
|
45
|
+
data = props.data;
|
|
141
46
|
return data.map(function (_ref) {
|
|
142
47
|
var dataIndex = _ref.dataIndex,
|
|
143
48
|
title = _ref.title,
|
|
144
|
-
value = _ref.value
|
|
49
|
+
value = _ref.value,
|
|
50
|
+
contentTitle = _ref.contentTitle;
|
|
145
51
|
return /*#__PURE__*/_react["default"].createElement(AttributeItem, {
|
|
146
52
|
key: dataIndex,
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
53
|
+
dataIndex: dataIndex,
|
|
54
|
+
label: title,
|
|
55
|
+
contentTitle: contentTitle
|
|
150
56
|
}, value || "-");
|
|
151
57
|
});
|
|
152
58
|
} // 基本信息
|
|
@@ -22,18 +22,28 @@ function BaseInfoBlock(props) {
|
|
|
22
22
|
ciTypeMeta = props.ciTypeMeta,
|
|
23
23
|
headerExtra = props.headerExtra,
|
|
24
24
|
renderContent = props.renderContent,
|
|
25
|
-
baseInfo = props.baseInfo
|
|
25
|
+
baseInfo = props.baseInfo,
|
|
26
|
+
isAppTopo = props.isAppTopo;
|
|
26
27
|
var id = data.id,
|
|
27
28
|
ciType = data.ciType,
|
|
28
29
|
type = data.type,
|
|
29
30
|
name = data.name;
|
|
31
|
+
console.log('111 data', data);
|
|
30
32
|
return /*#__PURE__*/_react["default"].createElement(_BlockBox["default"], {
|
|
31
33
|
headerTitle: "\u57FA\u672C\u4FE1\u606F",
|
|
32
|
-
headerExtra:
|
|
34
|
+
headerExtra: /*#__PURE__*/_react["default"].createElement("div", {
|
|
35
|
+
style: {
|
|
36
|
+
display: 'flex'
|
|
37
|
+
}
|
|
38
|
+
}, !isAppTopo && ciType === 'network_link' ? /*#__PURE__*/_react["default"].createElement("div", {
|
|
39
|
+
style: {
|
|
40
|
+
lineHeight: '28px'
|
|
41
|
+
}
|
|
42
|
+
}, /*#__PURE__*/_react["default"].createElement(_SingleResourceStrategyLink["default"], {
|
|
33
43
|
id: id,
|
|
34
44
|
ciType: ciType,
|
|
35
45
|
name: name
|
|
36
|
-
})
|
|
46
|
+
})) : '', headerExtra ? headerExtra(props) : '')
|
|
37
47
|
}, loading ? /*#__PURE__*/_react["default"].createElement(_loading["default"], {
|
|
38
48
|
style: {
|
|
39
49
|
width: '100%',
|