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