@riil-frontend/component-topology 11.0.34 → 11.0.36
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 +4 -2
- package/build/index.js +49 -34
- package/es/components/MultiResourceDrawer/index.js +16 -18
- package/es/components/ResourceList/ResourceSelect.js +48 -50
- package/es/components/ResourceSelectDrawer/ResourceSelectDrawer.js +24 -26
- package/es/components/SingleResourceDrawer/SelectDrawer.js +18 -20
- package/es/core/components/DisplaySettingDrawer/DisplaySettingDrawer.js +23 -25
- package/es/core/components/DisplaySettingDrawer/hooks/useDisplaySetting.js +78 -84
- package/es/core/components/titlebar/widgets/TitleWidget.js +5 -3
- package/es/core/editor/components/BackgroundView/UploadDialog/index.js +17 -18
- package/es/core/editor/components/BackgroundView/index.js +119 -129
- package/es/core/editor/components/CustomIconPlugin/RenameDialog.js +20 -22
- package/es/core/editor/components/CustomIconPlugin/UploadIconDialog.js +33 -34
- package/es/core/editor/components/CustomIconPlugin/utils/svgToShape.js +15 -17
- package/es/core/editor/components/GroupAddResourceDrawerPlugin/GroupAddResourceDrawer.js +7 -9
- package/es/core/editor/components/Sidebar/views/CanvasPanel/hooks/useCanvasThemeConfig.js +37 -41
- package/es/core/editor/components/Toolbar/widgets/BoxBackgroundButton/BoxBackgroundSetting.js +50 -54
- package/es/core/editor/components/Toolbar/widgets/FontColorButton.js +50 -54
- package/es/core/editor/components/settings/propertyViews/layer/DataTab/DefaultLayerAddResourceDrawer.js +11 -13
- package/es/core/editor/components/settings/propertyViews/node/data/BindResourceDrawer.js +21 -23
- package/es/core/editor/components/settings/propertyViews/node/data/Data.js +15 -17
- package/es/core/editor/components/settings/propertyViews/view/BackgroundSize.js +10 -12
- package/es/core/editor/components/titlebar/TopoEditorTitleBar.js +21 -27
- package/es/core/editor/hooks/useKeyboardShortcut.js +2 -2
- package/es/core/editor/hooks/useNewElementTheme.js +2 -2
- package/es/core/editor/store/background.js +8 -10
- package/es/core/editor/store/topoEdit.js +4 -6
- package/es/core/editor/utils/edgeTypeStyleUtil.js +2 -4
- package/es/core/hooks/usePolling.js +117 -121
- package/es/core/hooks/useResourceConfig.js +58 -66
- package/es/core/hooks/useTopoEdit.js +473 -503
- package/es/core/models/Alarm.js +281 -298
- package/es/core/models/AttributeMetricDisplay.js +101 -107
- package/es/core/models/PluginManager.js +4 -3
- package/es/core/models/SelectionModel.js +4 -5
- package/es/core/models/TopoApp.js +205 -240
- package/es/core/models/TopoGraphView.js +18 -21
- package/es/core/models/cache/CiCache.js +28 -27
- package/es/core/models/cache/CiTypeCache.js +37 -41
- package/es/core/models/cache/DictCache.js +33 -35
- package/es/core/models/graph/Background.js +15 -17
- package/es/core/models/plugins/resourceWebControllUrl.js +76 -82
- package/es/core/models/tagstips/ElementTagTipConfig.js +34 -38
- package/es/core/models/topoData.js +68 -70
- package/es/core/models/utils/linkUtils.js +41 -43
- package/es/core/models/utils/nodeNameVisibleUtil.js +4 -4
- package/es/core/services/alarm.js +14 -16
- package/es/core/services/background.js +59 -67
- package/es/core/services/cmdb/metric.js +9 -11
- package/es/core/services/cmdb.js +18 -20
- package/es/core/services/index.js +39 -45
- package/es/core/services/overview.js +131 -151
- package/es/core/services/topo/basic.js +37 -41
- package/es/core/services/topo/tagtip.js +10 -12
- package/es/core/store/models/ciModel.js +58 -62
- package/es/core/store/models/customIcon.js +120 -134
- package/es/core/store/models/displayConfig.js +15 -19
- package/es/core/store/models/selection.js +4 -6
- package/es/core/store/models/topoAlarm.js +162 -145
- package/es/core/store/models/topoBaseInfoOverview.js +4 -6
- package/es/core/store/models/topoBizMod.js +9 -11
- package/es/core/store/models/topoConfig.js +215 -231
- package/es/core/store/models/topoGraphView.js +4 -6
- package/es/core/store/models/topoMod.js +373 -395
- package/es/core/utils/edgeUtil.js +2 -1
- package/es/core/utils/imageUtil.js +18 -20
- package/es/core/utils/saveSerialize.js +9 -11
- package/es/core/viewer/components/plugins/ResourceDetail/components/ClusterMemberTable.js +56 -58
- package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/EventsCard.js +15 -17
- package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/ResourceOverview.js +343 -357
- package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/components/Configurator/index.js +86 -92
- package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/components/LinkTopo/LinkTopoCard.js +39 -41
- package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/components/LinkTopo/services/index.js +189 -205
- package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/hooks/useAlarmAndRiskData.js +107 -109
- package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/hooks/useMetricModels.js +57 -59
- package/es/core/viewer/components/plugins/ResourceDetail/components/WebConsole/WebConsoleForm/hooks/useWebConsole.js +33 -37
- package/es/core/viewer/components/plugins/ResourceDetail/getCiDisplayMetricModels.js +25 -29
- package/es/core/viewer/components/plugins/ResourceDetail/hooks/useUserId.js +32 -36
- package/es/core/viewer/components/plugins/ResourceWebControllUrlSettingDialog.js +17 -19
- package/es/networkTopo/components/Link/hook.js +73 -77
- package/es/networkTopo/components/Link/index.js +86 -94
- package/es/networkTopo/components/Link/setting.js +42 -44
- package/es/networkTopo/getTopoData.js +63 -69
- package/es/networkTopo/hooks/viewer/useRelateTopo.js +30 -32
- package/es/networkTopo/models/LinkDynamicStyleExecutor.js +2 -2
- package/es/networkTopo/models/TopoCenter.js +18 -22
- package/es/networkTopo/services/alert.js +18 -22
- package/es/networkTopo/services/authorization.js +45 -55
- package/es/networkTopo/services/cmdb.js +422 -470
- package/es/networkTopo/services/funcAuth.js +22 -24
- package/es/networkTopo/services/link.js +107 -117
- package/es/networkTopo/services/mdc.js +18 -24
- package/es/networkTopo/services/metric.js +23 -27
- package/es/networkTopo/services/model.js +445 -509
- package/es/networkTopo/services/risk.js +9 -11
- package/es/networkTopo/services/topo/auth.js +27 -33
- package/es/networkTopo/services/topo/basic.js +251 -289
- package/es/networkTopo/services/topo/blacklist.js +20 -24
- package/es/networkTopo/services/topo/ciInfo.js +27 -31
- package/es/networkTopo/services/topo/icon.js +49 -59
- package/es/networkTopo/services/topo/networkLink.js +32 -36
- package/es/networkTopo/services/topo/relation.js +9 -11
- package/es/networkTopo/services/topo/resourceWebUrl.js +36 -42
- package/es/networkTopo/store/functionAuth.js +31 -37
- package/es/networkTopo/store/topoCenter.js +142 -152
- package/es/networkTopo/store/topoLinkMod.js +4 -6
- package/es/networkTopo/store/topoTreeMod.js +170 -182
- package/es/networkTopo/utils/exportData.js +52 -54
- package/lib/components/MultiResourceDrawer/index.js +16 -18
- package/lib/components/ResourceList/ResourceSelect.js +48 -50
- package/lib/components/ResourceSelectDrawer/ResourceSelectDrawer.js +27 -29
- package/lib/components/SingleResourceDrawer/SelectDrawer.js +18 -20
- package/lib/core/components/DisplaySettingDrawer/DisplaySettingDrawer.js +30 -32
- package/lib/core/components/DisplaySettingDrawer/hooks/useDisplaySetting.js +78 -84
- package/lib/core/components/titlebar/widgets/TitleWidget.js +5 -3
- package/lib/core/editor/components/BackgroundView/UploadDialog/index.js +18 -18
- package/lib/core/editor/components/BackgroundView/index.js +118 -128
- package/lib/core/editor/components/CustomIconPlugin/RenameDialog.js +22 -24
- package/lib/core/editor/components/CustomIconPlugin/UploadIconDialog.js +34 -34
- package/lib/core/editor/components/CustomIconPlugin/utils/svgToShape.js +19 -21
- package/lib/core/editor/components/GroupAddResourceDrawerPlugin/GroupAddResourceDrawer.js +8 -10
- package/lib/core/editor/components/Sidebar/views/CanvasPanel/hooks/useCanvasThemeConfig.js +37 -41
- package/lib/core/editor/components/Toolbar/widgets/BoxBackgroundButton/BoxBackgroundSetting.js +50 -54
- package/lib/core/editor/components/Toolbar/widgets/FontColorButton.js +50 -54
- package/lib/core/editor/components/settings/propertyViews/layer/DataTab/DefaultLayerAddResourceDrawer.js +12 -14
- package/lib/core/editor/components/settings/propertyViews/node/data/BindResourceDrawer.js +26 -28
- package/lib/core/editor/components/settings/propertyViews/node/data/Data.js +15 -17
- package/lib/core/editor/components/settings/propertyViews/view/BackgroundSize.js +12 -14
- package/lib/core/editor/components/titlebar/TopoEditorTitleBar.js +25 -31
- package/lib/core/editor/hooks/useKeyboardShortcut.js +2 -2
- package/lib/core/editor/hooks/useNewElementTheme.js +2 -2
- package/lib/core/editor/store/background.js +8 -10
- package/lib/core/editor/store/topoEdit.js +4 -6
- package/lib/core/editor/utils/edgeTypeStyleUtil.js +2 -4
- package/lib/core/hooks/usePolling.js +116 -120
- package/lib/core/hooks/useResourceConfig.js +58 -66
- package/lib/core/hooks/useTopoEdit.js +465 -495
- package/lib/core/models/Alarm.js +275 -292
- package/lib/core/models/AttributeMetricDisplay.js +104 -110
- package/lib/core/models/PluginManager.js +4 -3
- package/lib/core/models/SelectionModel.js +4 -5
- package/lib/core/models/TopoApp.js +205 -240
- package/lib/core/models/TopoGraphView.js +18 -21
- package/lib/core/models/cache/CiCache.js +33 -32
- package/lib/core/models/cache/CiTypeCache.js +38 -42
- package/lib/core/models/cache/DictCache.js +33 -35
- package/lib/core/models/graph/Background.js +16 -18
- package/lib/core/models/plugins/resourceWebControllUrl.js +74 -80
- package/lib/core/models/tagstips/ElementTagTipConfig.js +34 -38
- package/lib/core/models/topoData.js +69 -71
- package/lib/core/models/utils/linkUtils.js +41 -43
- package/lib/core/models/utils/nodeNameVisibleUtil.js +4 -4
- package/lib/core/services/alarm.js +18 -20
- package/lib/core/services/background.js +70 -78
- package/lib/core/services/cmdb/metric.js +10 -12
- package/lib/core/services/cmdb.js +20 -22
- package/lib/core/services/index.js +45 -51
- package/lib/core/services/overview.js +131 -151
- package/lib/core/services/topo/basic.js +37 -41
- package/lib/core/services/topo/tagtip.js +12 -14
- package/lib/core/store/models/ciModel.js +66 -70
- package/lib/core/store/models/customIcon.js +120 -134
- package/lib/core/store/models/displayConfig.js +15 -19
- package/lib/core/store/models/selection.js +4 -6
- package/lib/core/store/models/topoAlarm.js +163 -145
- package/lib/core/store/models/topoBaseInfoOverview.js +4 -6
- package/lib/core/store/models/topoBizMod.js +9 -11
- package/lib/core/store/models/topoConfig.js +222 -238
- package/lib/core/store/models/topoGraphView.js +4 -6
- package/lib/core/store/models/topoMod.js +375 -397
- package/lib/core/utils/edgeUtil.js +2 -1
- package/lib/core/utils/imageUtil.js +22 -24
- package/lib/core/utils/saveSerialize.js +9 -11
- package/lib/core/viewer/components/plugins/ResourceDetail/components/ClusterMemberTable.js +56 -58
- package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/EventsCard.js +15 -17
- package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/ResourceOverview.js +344 -358
- package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/components/Configurator/index.js +86 -92
- package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/components/LinkTopo/LinkTopoCard.js +39 -41
- package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/components/LinkTopo/services/index.js +190 -206
- package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/hooks/useAlarmAndRiskData.js +107 -109
- package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/hooks/useMetricModels.js +57 -59
- package/lib/core/viewer/components/plugins/ResourceDetail/components/WebConsole/WebConsoleForm/hooks/useWebConsole.js +29 -33
- package/lib/core/viewer/components/plugins/ResourceDetail/getCiDisplayMetricModels.js +25 -29
- package/lib/core/viewer/components/plugins/ResourceDetail/hooks/useUserId.js +32 -36
- package/lib/core/viewer/components/plugins/ResourceWebControllUrlSettingDialog.js +18 -20
- package/lib/networkTopo/components/Link/hook.js +73 -77
- package/lib/networkTopo/components/Link/index.js +87 -95
- package/lib/networkTopo/components/Link/setting.js +42 -44
- package/lib/networkTopo/getTopoData.js +63 -69
- package/lib/networkTopo/hooks/viewer/useRelateTopo.js +31 -33
- package/lib/networkTopo/models/LinkDynamicStyleExecutor.js +2 -2
- package/lib/networkTopo/models/TopoCenter.js +18 -22
- package/lib/networkTopo/services/alert.js +18 -22
- package/lib/networkTopo/services/authorization.js +55 -65
- package/lib/networkTopo/services/cmdb.js +422 -470
- package/lib/networkTopo/services/funcAuth.js +24 -26
- package/lib/networkTopo/services/link.js +108 -118
- package/lib/networkTopo/services/mdc.js +21 -27
- package/lib/networkTopo/services/metric.js +27 -31
- package/lib/networkTopo/services/model.js +445 -509
- package/lib/networkTopo/services/risk.js +11 -13
- package/lib/networkTopo/services/topo/auth.js +27 -33
- package/lib/networkTopo/services/topo/basic.js +252 -290
- package/lib/networkTopo/services/topo/blacklist.js +20 -24
- package/lib/networkTopo/services/topo/ciInfo.js +34 -38
- package/lib/networkTopo/services/topo/icon.js +59 -69
- package/lib/networkTopo/services/topo/networkLink.js +32 -36
- package/lib/networkTopo/services/topo/relation.js +11 -13
- package/lib/networkTopo/services/topo/resourceWebUrl.js +44 -50
- package/lib/networkTopo/store/functionAuth.js +31 -37
- package/lib/networkTopo/store/topoCenter.js +142 -152
- package/lib/networkTopo/store/topoLinkMod.js +4 -6
- package/lib/networkTopo/store/topoTreeMod.js +166 -178
- package/lib/networkTopo/utils/exportData.js +59 -61
- package/lib/utils/htElementDataUtil.js +4 -2
- package/package.json +4 -3
@@ -34,20 +34,18 @@ function _queryAssetModel() {
|
|
34
34
|
_queryAssetModel = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee(code) {
|
35
35
|
var result;
|
36
36
|
return _regenerator["default"].wrap(function _callee$(_context) {
|
37
|
-
while (1) {
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
return _context.stop();
|
50
|
-
}
|
37
|
+
while (1) switch (_context.prev = _context.next) {
|
38
|
+
case 0:
|
39
|
+
_context.next = 2;
|
40
|
+
return _componentTopologyUtils.request.get("/mdc/v1/api/model-asset/" + code);
|
41
|
+
|
42
|
+
case 2:
|
43
|
+
result = _context.sent;
|
44
|
+
return _context.abrupt("return", result);
|
45
|
+
|
46
|
+
case 4:
|
47
|
+
case "end":
|
48
|
+
return _context.stop();
|
51
49
|
}
|
52
50
|
}, _callee);
|
53
51
|
}));
|
@@ -69,15 +67,13 @@ function queryLatestMetrics(_x2) {
|
|
69
67
|
function _queryLatestMetrics() {
|
70
68
|
_queryLatestMetrics = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee2(params) {
|
71
69
|
return _regenerator["default"].wrap(function _callee2$(_context2) {
|
72
|
-
while (1) {
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
return _context2.stop();
|
80
|
-
}
|
70
|
+
while (1) switch (_context2.prev = _context2.next) {
|
71
|
+
case 0:
|
72
|
+
return _context2.abrupt("return", _componentTopologyUtils.request.post('/mdc/v1/api/cmdb/metric/queryLatestMetrics', params));
|
73
|
+
|
74
|
+
case 1:
|
75
|
+
case "end":
|
76
|
+
return _context2.stop();
|
81
77
|
}
|
82
78
|
}, _callee2);
|
83
79
|
}));
|
@@ -94,59 +90,57 @@ function _queryLinkLatestMetrics() {
|
|
94
90
|
|
95
91
|
var linkMetrics, resultData;
|
96
92
|
return _regenerator["default"].wrap(function _callee3$(_context3) {
|
97
|
-
while (1) {
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
93
|
+
while (1) switch (_context3.prev = _context3.next) {
|
94
|
+
case 0:
|
95
|
+
_rlog["default"].debug('链路拓扑指标轮询 queryLinkLatestMetrics', linkCi, linkMetricCodes);
|
96
|
+
|
97
|
+
if (linkMetricCodes.length) {
|
98
|
+
_context3.next = 3;
|
99
|
+
break;
|
100
|
+
}
|
101
|
+
|
102
|
+
return _context3.abrupt("return", {
|
103
|
+
linkMetrics: [],
|
104
|
+
linkMetricsTs: undefined
|
105
|
+
});
|
106
|
+
|
107
|
+
case 3:
|
108
|
+
_context3.next = 5;
|
109
|
+
return queryLatestMetrics({
|
110
|
+
ciId: [linkCi.id],
|
111
|
+
'metricCode': linkMetricCodes
|
112
|
+
});
|
113
|
+
|
114
|
+
case 5:
|
115
|
+
linkMetrics = _context3.sent;
|
116
|
+
_context3.next = 8;
|
117
|
+
return _CiTypeCache["default"].load([linkCi.ciType || linkCi.typeCode]);
|
118
|
+
|
119
|
+
case 8:
|
120
|
+
// format
|
121
|
+
resultData = linkMetricCodes.map(function (code) {
|
122
|
+
var metric = linkMetrics.find(function (m) {
|
123
|
+
return m.metricCode === code;
|
117
124
|
});
|
125
|
+
var value = metric === null || metric === void 0 ? void 0 : metric.metricValue;
|
118
126
|
|
119
|
-
|
120
|
-
linkMetrics = _context3.sent;
|
121
|
-
_context3.next = 8;
|
122
|
-
return _CiTypeCache["default"].load([linkCi.ciType || linkCi.typeCode]);
|
123
|
-
|
124
|
-
case 8:
|
125
|
-
// format
|
126
|
-
resultData = linkMetricCodes.map(function (code) {
|
127
|
-
var metric = linkMetrics.find(function (m) {
|
128
|
-
return m.metricCode === code;
|
129
|
-
});
|
130
|
-
var value = metric === null || metric === void 0 ? void 0 : metric.metricValue;
|
131
|
-
|
132
|
-
var metricDef = _CiTypeCache["default"].getMetric(linkCi.ciType || linkCi.typeCode, code);
|
133
|
-
|
134
|
-
return {
|
135
|
-
code: code,
|
136
|
-
name: metricDef.name,
|
137
|
-
value: (0, _metricUtil.formatMetric)(value, metricDef) || '',
|
138
|
-
ts: metric === null || metric === void 0 ? void 0 : metric.ts
|
139
|
-
};
|
140
|
-
});
|
141
|
-
return _context3.abrupt("return", {
|
142
|
-
linkMetrics: resultData,
|
143
|
-
linkMetricsTs: (_linkMetrics$ = linkMetrics[0]) === null || _linkMetrics$ === void 0 ? void 0 : _linkMetrics$.ts
|
144
|
-
});
|
127
|
+
var metricDef = _CiTypeCache["default"].getMetric(linkCi.ciType || linkCi.typeCode, code);
|
145
128
|
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
129
|
+
return {
|
130
|
+
code: code,
|
131
|
+
name: metricDef.name,
|
132
|
+
value: (0, _metricUtil.formatMetric)(value, metricDef) || '',
|
133
|
+
ts: metric === null || metric === void 0 ? void 0 : metric.ts
|
134
|
+
};
|
135
|
+
});
|
136
|
+
return _context3.abrupt("return", {
|
137
|
+
linkMetrics: resultData,
|
138
|
+
linkMetricsTs: (_linkMetrics$ = linkMetrics[0]) === null || _linkMetrics$ === void 0 ? void 0 : _linkMetrics$.ts
|
139
|
+
});
|
140
|
+
|
141
|
+
case 10:
|
142
|
+
case "end":
|
143
|
+
return _context3.stop();
|
150
144
|
}
|
151
145
|
}, _callee3);
|
152
146
|
}));
|
@@ -167,77 +161,75 @@ function _queryLinkInterfacesLatestMetrics() {
|
|
167
161
|
var _linkCi$attributes, sourceType, sourceId, destinationId, destinationType, typeCodes, queryInterfaceMetricsParam, interfaceMetrics, resultData, findMetricsBySubCiId, parseInterfaceMetrics;
|
168
162
|
|
169
163
|
return _regenerator["default"].wrap(function _callee4$(_context4) {
|
170
|
-
while (1) {
|
171
|
-
|
172
|
-
|
173
|
-
|
174
|
-
|
175
|
-
|
176
|
-
|
177
|
-
|
178
|
-
|
179
|
-
|
180
|
-
})) === null || _metrics$find === void 0 ? void 0 : _metrics$find.metricValue;
|
181
|
-
|
182
|
-
var metricDef = _CiTypeCache["default"].getMetric(linkCi.ciType || linkCi.typeCode, code);
|
183
|
-
|
184
|
-
var formatValue = (0, _metricUtil.formatMetric)(value, metricDef);
|
185
|
-
res[code] = formatValue === 'undefined' ? '-' : formatValue;
|
186
|
-
return res;
|
187
|
-
}, {});
|
188
|
-
};
|
189
|
-
|
190
|
-
findMetricsBySubCiId = function _findMetricsBySubCiId(subCiId) {
|
191
|
-
var metrics = interfaceMetrics.filter(function (metric) {
|
192
|
-
return metric.subCiId === subCiId;
|
193
|
-
});
|
194
|
-
return metrics;
|
195
|
-
};
|
196
|
-
|
197
|
-
_linkCi$attributes = linkCi.attributes, sourceType = _linkCi$attributes.source_type, sourceId = _linkCi$attributes.source_id, destinationId = _linkCi$attributes.destination_id, destinationType = _linkCi$attributes.destination_type;
|
198
|
-
|
199
|
-
_rlog["default"].debug('查询链路接口指标', linkCi); // 查询指标模型
|
164
|
+
while (1) switch (_context4.prev = _context4.next) {
|
165
|
+
case 0:
|
166
|
+
parseInterfaceMetrics = function _parseInterfaceMetric(subCiId) {
|
167
|
+
var metrics = findMetricsBySubCiId(subCiId);
|
168
|
+
return _constants.INTERFACE_METRIC_CODES.reduce(function (res, code) {
|
169
|
+
var _metrics$find;
|
170
|
+
|
171
|
+
var value = (_metrics$find = metrics.find(function (m) {
|
172
|
+
return m.metricCode === code;
|
173
|
+
})) === null || _metrics$find === void 0 ? void 0 : _metrics$find.metricValue;
|
200
174
|
|
175
|
+
var metricDef = _CiTypeCache["default"].getMetric(linkCi.ciType || linkCi.typeCode, code);
|
201
176
|
|
202
|
-
|
203
|
-
|
204
|
-
|
205
|
-
|
206
|
-
|
177
|
+
var formatValue = (0, _metricUtil.formatMetric)(value, metricDef);
|
178
|
+
res[code] = formatValue === 'undefined' ? '-' : formatValue;
|
179
|
+
return res;
|
180
|
+
}, {});
|
181
|
+
};
|
207
182
|
|
208
|
-
|
209
|
-
|
210
|
-
|
183
|
+
findMetricsBySubCiId = function _findMetricsBySubCiId(subCiId) {
|
184
|
+
var metrics = interfaceMetrics.filter(function (metric) {
|
185
|
+
return metric.subCiId === subCiId;
|
186
|
+
});
|
187
|
+
return metrics;
|
188
|
+
};
|
189
|
+
|
190
|
+
_linkCi$attributes = linkCi.attributes, sourceType = _linkCi$attributes.source_type, sourceId = _linkCi$attributes.source_id, destinationId = _linkCi$attributes.destination_id, destinationType = _linkCi$attributes.destination_type;
|
191
|
+
|
192
|
+
_rlog["default"].debug('查询链路接口指标', linkCi); // 查询指标模型
|
193
|
+
|
194
|
+
|
195
|
+
typeCodes = [sourceType];
|
196
|
+
queryInterfaceMetricsParam = {
|
197
|
+
'subCiId': [sourceId],
|
198
|
+
'metricCode': [].concat(_constants.INTERFACE_METRIC_CODES)
|
199
|
+
};
|
200
|
+
|
201
|
+
if (destinationId) {
|
202
|
+
queryInterfaceMetricsParam.subCiId.push(destinationId);
|
203
|
+
typeCodes.push(destinationType);
|
204
|
+
}
|
205
|
+
|
206
|
+
_context4.next = 9;
|
207
|
+
return _CiTypeCache["default"].load(typeCodes);
|
208
|
+
|
209
|
+
case 9:
|
210
|
+
_context4.next = 11;
|
211
|
+
return queryLatestMetrics(queryInterfaceMetricsParam);
|
212
|
+
|
213
|
+
case 11:
|
214
|
+
interfaceMetrics = _context4.sent;
|
215
|
+
// format
|
216
|
+
resultData = {
|
217
|
+
sourceMetrics: parseInterfaceMetrics(sourceId),
|
218
|
+
destinationMetrics: destinationId ? parseInterfaceMetrics(destinationId) : null,
|
219
|
+
// 源目的接口指标原始数据。支持关键链路详情过滤最近一小时指标
|
220
|
+
originMetricData: {
|
221
|
+
source: findMetricsBySubCiId(sourceId),
|
222
|
+
destination: destinationId ? findMetricsBySubCiId(destinationId) : []
|
211
223
|
}
|
224
|
+
};
|
212
225
|
|
213
|
-
|
214
|
-
return _CiTypeCache["default"].load(typeCodes);
|
215
|
-
|
216
|
-
case 9:
|
217
|
-
_context4.next = 11;
|
218
|
-
return queryLatestMetrics(queryInterfaceMetricsParam);
|
219
|
-
|
220
|
-
case 11:
|
221
|
-
interfaceMetrics = _context4.sent;
|
222
|
-
// format
|
223
|
-
resultData = {
|
224
|
-
sourceMetrics: parseInterfaceMetrics(sourceId),
|
225
|
-
destinationMetrics: destinationId ? parseInterfaceMetrics(destinationId) : null,
|
226
|
-
// 源目的接口指标原始数据。支持关键链路详情过滤最近一小时指标
|
227
|
-
originMetricData: {
|
228
|
-
source: findMetricsBySubCiId(sourceId),
|
229
|
-
destination: destinationId ? findMetricsBySubCiId(destinationId) : []
|
230
|
-
}
|
231
|
-
};
|
226
|
+
_rlog["default"].debug('查询链路接口指标 结果', linkCi);
|
232
227
|
|
233
|
-
|
228
|
+
return _context4.abrupt("return", resultData);
|
234
229
|
|
235
|
-
|
236
|
-
|
237
|
-
|
238
|
-
case "end":
|
239
|
-
return _context4.stop();
|
240
|
-
}
|
230
|
+
case 15:
|
231
|
+
case "end":
|
232
|
+
return _context4.stop();
|
241
233
|
}
|
242
234
|
}, _callee4);
|
243
235
|
}));
|
@@ -256,17 +248,15 @@ function checkMenu() {
|
|
256
248
|
function _checkMenu() {
|
257
249
|
_checkMenu = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee5() {
|
258
250
|
return _regenerator["default"].wrap(function _callee5$(_context5) {
|
259
|
-
while (1) {
|
260
|
-
|
261
|
-
|
262
|
-
|
263
|
-
|
264
|
-
|
265
|
-
|
266
|
-
|
267
|
-
|
268
|
-
return _context5.stop();
|
269
|
-
}
|
251
|
+
while (1) switch (_context5.prev = _context5.next) {
|
252
|
+
case 0:
|
253
|
+
return _context5.abrupt("return", _componentTopologyUtils.request.post('/authorization/v1/api/authority/check/checkMenuAuthentication', [{
|
254
|
+
"url": "/default/trafficControl"
|
255
|
+
}]));
|
256
|
+
|
257
|
+
case 1:
|
258
|
+
case "end":
|
259
|
+
return _context5.stop();
|
270
260
|
}
|
271
261
|
}, _callee5);
|
272
262
|
}));
|
@@ -285,15 +275,13 @@ function isOpenFlow(_x6) {
|
|
285
275
|
function _isOpenFlow() {
|
286
276
|
_isOpenFlow = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee6(params) {
|
287
277
|
return _regenerator["default"].wrap(function _callee6$(_context6) {
|
288
|
-
while (1) {
|
289
|
-
|
290
|
-
|
291
|
-
|
292
|
-
|
293
|
-
|
294
|
-
|
295
|
-
return _context6.stop();
|
296
|
-
}
|
278
|
+
while (1) switch (_context6.prev = _context6.next) {
|
279
|
+
case 0:
|
280
|
+
return _context6.abrupt("return", _componentTopologyUtils.request.post('/flow/v1/api/link/isOpenFlowMonitorByName', params));
|
281
|
+
|
282
|
+
case 1:
|
283
|
+
case "end":
|
284
|
+
return _context6.stop();
|
297
285
|
}
|
298
286
|
}, _callee6);
|
299
287
|
}));
|
@@ -307,15 +295,13 @@ function queryLastestValue(_x7) {
|
|
307
295
|
function _queryLastestValue() {
|
308
296
|
_queryLastestValue = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee7(params) {
|
309
297
|
return _regenerator["default"].wrap(function _callee7$(_context7) {
|
310
|
-
while (1) {
|
311
|
-
|
312
|
-
|
313
|
-
|
314
|
-
|
315
|
-
|
316
|
-
|
317
|
-
return _context7.stop();
|
318
|
-
}
|
298
|
+
while (1) switch (_context7.prev = _context7.next) {
|
299
|
+
case 0:
|
300
|
+
return _context7.abrupt("return", _componentTopologyUtils.request.post('/flow/v1/api/LinkAnalyse/queryLastestValue', params));
|
301
|
+
|
302
|
+
case 1:
|
303
|
+
case "end":
|
304
|
+
return _context7.stop();
|
319
305
|
}
|
320
306
|
}, _callee7);
|
321
307
|
}));
|
@@ -330,48 +316,46 @@ function _queryRetansRatioNetDelayRatio() {
|
|
330
316
|
_queryRetansRatioNetDelayRatio = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee8(params, retansRatioNetDelayRatioCodes) {
|
331
317
|
var result, linkOther;
|
332
318
|
return _regenerator["default"].wrap(function _callee8$(_context8) {
|
333
|
-
while (1) {
|
334
|
-
|
335
|
-
|
336
|
-
|
337
|
-
|
338
|
-
|
339
|
-
|
340
|
-
|
341
|
-
|
342
|
-
|
343
|
-
|
344
|
-
|
345
|
-
|
346
|
-
|
347
|
-
|
348
|
-
|
349
|
-
|
350
|
-
|
351
|
-
|
352
|
-
|
353
|
-
|
354
|
-
|
355
|
-
|
356
|
-
|
357
|
-
|
358
|
-
|
359
|
-
|
360
|
-
|
361
|
-
|
362
|
-
|
363
|
-
|
364
|
-
|
365
|
-
|
366
|
-
|
367
|
-
}
|
319
|
+
while (1) switch (_context8.prev = _context8.next) {
|
320
|
+
case 0:
|
321
|
+
if (retansRatioNetDelayRatioCodes.length) {
|
322
|
+
_context8.next = 2;
|
323
|
+
break;
|
324
|
+
}
|
325
|
+
|
326
|
+
return _context8.abrupt("return", []);
|
327
|
+
|
328
|
+
case 2:
|
329
|
+
_context8.next = 4;
|
330
|
+
return queryLastestValue(params);
|
331
|
+
|
332
|
+
case 4:
|
333
|
+
result = _context8.sent;
|
334
|
+
linkOther = [];
|
335
|
+
|
336
|
+
if (retansRatioNetDelayRatioCodes.includes('netDelayRatio')) {
|
337
|
+
linkOther.push({
|
338
|
+
'code': 'netDelayRatio',
|
339
|
+
'name': 'RTT时延',
|
340
|
+
'ts': result.time,
|
341
|
+
'value': (result.upNetDelayRatio * 1).toFixed(2) + ' ms' + '|' + (result.downNetDelayRatio * 1).toFixed(2) + ' ms'
|
342
|
+
});
|
343
|
+
}
|
344
|
+
|
345
|
+
if (retansRatioNetDelayRatioCodes.includes('retansRatio')) {
|
346
|
+
linkOther.push({
|
347
|
+
'code': 'retansRatio',
|
348
|
+
'name': '重传率',
|
349
|
+
'ts': result.time,
|
350
|
+
'value': result.upRetransRatio + ' %' + '|' + result.downRetansRatio + ' %'
|
351
|
+
});
|
352
|
+
}
|
368
353
|
|
369
|
-
|
354
|
+
return _context8.abrupt("return", linkOther);
|
370
355
|
|
371
|
-
|
372
|
-
|
373
|
-
|
374
|
-
}
|
356
|
+
case 9:
|
357
|
+
case "end":
|
358
|
+
return _context8.stop();
|
375
359
|
}
|
376
360
|
}, _callee8);
|
377
361
|
}));
|