@riil-frontend/component-topology 10.0.57 → 10.0.59
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/IndexSettingDrawer/index.js +6 -5
- 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/ResourceDisplay/useElementTagTipConfig.js +78 -100
- package/es/core/components/DisplaySettingDrawer/hooks/useDisplaySetting.js +92 -108
- package/es/core/components/titlebar/widgets/TitleWidget.js +5 -4
- 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/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/useCanvasTheme.js +1 -1
- package/es/core/hooks/usePolling.js +110 -122
- package/es/core/hooks/useResourceConfig.js +76 -100
- package/es/core/hooks/useTopoEdit.js +539 -638
- package/es/core/models/Alarm.js +311 -394
- 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 +287 -454
- package/es/core/models/TopoGraphView.js +28 -41
- package/es/core/models/cache/CiCache.js +34 -39
- package/es/core/models/cache/CiTypeCache.js +70 -84
- 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 +34 -40
- package/es/core/models/topoData.js +73 -77
- package/es/core/models/utils/linkUtils.js +46 -51
- 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 +11 -13
- 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 +28 -32
- package/es/core/store/models/topoConfig.js +217 -233
- package/es/core/store/models/topoGraphView.js +4 -6
- package/es/core/store/models/topoMod.js +379 -401
- 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 copy.js +104 -126
- 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 +274 -314
- 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/linkDynamicStyle.js +102 -108
- package/es/networkTopo/store/linkDynamicStyleConfig.js +42 -44
- package/es/networkTopo/store/linkManager.js +4 -6
- 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/IndexSettingDrawer/index.js +6 -5
- 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/ResourceDisplay/useElementTagTipConfig.js +82 -104
- package/lib/core/components/DisplaySettingDrawer/hooks/useDisplaySetting.js +92 -108
- package/lib/core/components/titlebar/widgets/TitleWidget.js +5 -4
- 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/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/useCanvasTheme.js +1 -1
- package/lib/core/hooks/usePolling.js +108 -120
- package/lib/core/hooks/useResourceConfig.js +76 -100
- package/lib/core/hooks/useTopoEdit.js +530 -629
- package/lib/core/models/Alarm.js +308 -391
- 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 +287 -454
- package/lib/core/models/TopoGraphView.js +28 -41
- package/lib/core/models/cache/CiCache.js +39 -44
- package/lib/core/models/cache/CiTypeCache.js +71 -85
- 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 +34 -40
- package/lib/core/models/topoData.js +73 -78
- package/lib/core/models/utils/linkUtils.js +45 -51
- 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 +13 -15
- 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 +34 -38
- package/lib/core/store/models/topoConfig.js +224 -240
- package/lib/core/store/models/topoGraphView.js +4 -6
- package/lib/core/store/models/topoMod.js +381 -403
- 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 copy.js +105 -127
- 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 +277 -317
- 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/linkDynamicStyle.js +103 -109
- package/lib/networkTopo/store/linkDynamicStyleConfig.js +42 -44
- package/lib/networkTopo/store/linkManager.js +4 -6
- 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 +3 -3
@@ -63,7 +63,7 @@ function _createForOfIteratorHelperLoose(o, allowArrayLike) { var it = typeof Sy
|
|
63
63
|
|
64
64
|
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
65
65
|
|
66
|
-
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++)
|
66
|
+
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
67
67
|
|
68
68
|
// url 处理,UICBB 的地址需截取前缀
|
69
69
|
function formatUrl(url) {
|
@@ -83,7 +83,7 @@ function formatUrl(url) {
|
|
83
83
|
|
84
84
|
|
85
85
|
function ResourceOverview(props) {
|
86
|
-
var _viewerProps$resource, _data$attributes;
|
86
|
+
var _viewerProps$resource, _data$attributes, _ref, _getAddressFormat, _alarmRiskOperation, _baseInfoColChange, _getAttribute, _metricColChange;
|
87
87
|
|
88
88
|
var topo = props.topo,
|
89
89
|
id = props.id,
|
@@ -193,39 +193,33 @@ function ResourceOverview(props) {
|
|
193
193
|
isAppTopo && resourceOverviewProps.onClose && resourceOverviewProps.onClose();
|
194
194
|
}
|
195
195
|
|
196
|
-
var jump =
|
197
|
-
|
196
|
+
var jump = function jump(_x, _x2) {
|
197
|
+
return (_ref = _ref || (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee(roomLink, id) {
|
198
198
|
var power;
|
199
199
|
return _regenerator["default"].wrap(function _callee$(_context) {
|
200
|
-
while (1) {
|
201
|
-
|
202
|
-
|
203
|
-
|
204
|
-
|
205
|
-
|
206
|
-
|
207
|
-
|
208
|
-
|
209
|
-
|
210
|
-
|
211
|
-
|
212
|
-
|
213
|
-
|
214
|
-
|
215
|
-
}
|
200
|
+
while (1) switch (_context.prev = _context.next) {
|
201
|
+
case 0:
|
202
|
+
onClose();
|
203
|
+
_context.next = 3;
|
204
|
+
return (0, _services.commonQueryCiData)(id);
|
205
|
+
|
206
|
+
case 3:
|
207
|
+
power = _context.sent;
|
208
|
+
|
209
|
+
// console.log(power)
|
210
|
+
if (power.data.length) {
|
211
|
+
window.open("" + window.location.origin + roomLink);
|
212
|
+
} else {
|
213
|
+
_message["default"].error('无访问权限,请联系管理员');
|
214
|
+
}
|
216
215
|
|
217
|
-
|
218
|
-
|
219
|
-
|
220
|
-
}
|
216
|
+
case 5:
|
217
|
+
case "end":
|
218
|
+
return _context.stop();
|
221
219
|
}
|
222
220
|
}, _callee);
|
223
|
-
}));
|
224
|
-
|
225
|
-
return function jump(_x, _x2) {
|
226
|
-
return _ref.apply(this, arguments);
|
227
|
-
};
|
228
|
-
}(); // 基本信息可选项
|
221
|
+
}))).apply(this, arguments);
|
222
|
+
}; // 基本信息可选项
|
229
223
|
|
230
224
|
|
231
225
|
var baseInfoCol = (0, _react.useMemo)(function () {
|
@@ -279,90 +273,78 @@ function ResourceOverview(props) {
|
|
279
273
|
})) || [];
|
280
274
|
}, [id, monitorMetricModels, initFlag]);
|
281
275
|
(0, _react.useEffect)(function () {
|
276
|
+
var _getDevice;
|
277
|
+
|
282
278
|
// 获取上架设备类型,判断资源是否是上架设备
|
283
279
|
function getDevice() {
|
284
|
-
return _getDevice
|
285
|
-
}
|
286
|
-
|
287
|
-
function _getDevice() {
|
288
|
-
_getDevice = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee2() {
|
280
|
+
return (_getDevice = _getDevice || (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee2() {
|
289
281
|
var list;
|
290
282
|
return _regenerator["default"].wrap(function _callee2$(_context2) {
|
291
|
-
while (1) {
|
292
|
-
|
293
|
-
|
294
|
-
|
295
|
-
|
296
|
-
|
297
|
-
|
298
|
-
|
299
|
-
|
300
|
-
|
301
|
-
|
302
|
-
|
303
|
-
|
304
|
-
|
305
|
-
return _context2.stop();
|
306
|
-
}
|
283
|
+
while (1) switch (_context2.prev = _context2.next) {
|
284
|
+
case 0:
|
285
|
+
_context2.next = 2;
|
286
|
+
return _overview["default"].getDeviceTypeList();
|
287
|
+
|
288
|
+
case 2:
|
289
|
+
list = _context2.sent;
|
290
|
+
setIsDevice(list.some(function (item) {
|
291
|
+
return item.code === ciType;
|
292
|
+
})); // console.log('getDevice', ciType, list);
|
293
|
+
|
294
|
+
case 4:
|
295
|
+
case "end":
|
296
|
+
return _context2.stop();
|
307
297
|
}
|
308
298
|
}, _callee2);
|
309
|
-
}));
|
310
|
-
return _getDevice.apply(this, arguments);
|
299
|
+
}))).apply(this, arguments);
|
311
300
|
}
|
312
301
|
|
313
302
|
getDevice();
|
314
303
|
}, [ciType]); // 获取地址信息:机房 机柜 起始U-结束U
|
315
304
|
|
316
305
|
function getAddressFormat(_x3) {
|
317
|
-
return _getAddressFormat
|
318
|
-
} // 告警table列配置
|
319
|
-
|
320
|
-
|
321
|
-
function _getAddressFormat() {
|
322
|
-
_getAddressFormat = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee3(_ref2) {
|
306
|
+
return (_getAddressFormat = _getAddressFormat || (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee3(_ref2) {
|
323
307
|
var owned_computer_room, owned_cabinet, start_u_location, end_u_location, address, _res$find, _res$find$attributes, _res$find2, _res$find2$attributes, res, u;
|
324
308
|
|
325
309
|
return _regenerator["default"].wrap(function _callee3$(_context3) {
|
326
|
-
while (1) {
|
327
|
-
|
328
|
-
|
329
|
-
|
330
|
-
address = '';
|
310
|
+
while (1) switch (_context3.prev = _context3.next) {
|
311
|
+
case 0:
|
312
|
+
owned_computer_room = _ref2.owned_computer_room, owned_cabinet = _ref2.owned_cabinet, start_u_location = _ref2.start_u_location, end_u_location = _ref2.end_u_location;
|
313
|
+
address = '';
|
331
314
|
|
332
|
-
|
333
|
-
|
334
|
-
|
335
|
-
|
315
|
+
if (!(owned_computer_room && owned_cabinet)) {
|
316
|
+
_context3.next = 7;
|
317
|
+
break;
|
318
|
+
}
|
336
319
|
|
337
|
-
|
338
|
-
|
320
|
+
_context3.next = 5;
|
321
|
+
return (0, _services.queryCisByIds)([owned_computer_room, owned_cabinet]);
|
339
322
|
|
340
|
-
|
341
|
-
|
342
|
-
|
343
|
-
|
344
|
-
|
345
|
-
|
346
|
-
|
323
|
+
case 5:
|
324
|
+
res = _context3.sent;
|
325
|
+
address = (((_res$find = res.find(function (item) {
|
326
|
+
return item.id === owned_computer_room;
|
327
|
+
})) === null || _res$find === void 0 ? void 0 : (_res$find$attributes = _res$find.attributes) === null || _res$find$attributes === void 0 ? void 0 : _res$find$attributes.display_name) || '') + " " + (((_res$find2 = res.find(function (item) {
|
328
|
+
return item.id === owned_cabinet;
|
329
|
+
})) === null || _res$find2 === void 0 ? void 0 : (_res$find2$attributes = _res$find2.attributes) === null || _res$find2$attributes === void 0 ? void 0 : _res$find2$attributes.display_name) || '');
|
347
330
|
|
348
|
-
|
349
|
-
|
331
|
+
case 7:
|
332
|
+
u = '';
|
350
333
|
|
351
|
-
|
352
|
-
|
353
|
-
|
334
|
+
if (start_u_location || end_u_location) {
|
335
|
+
u = (start_u_location || '') + "-" + (end_u_location || '');
|
336
|
+
}
|
354
337
|
|
355
|
-
|
338
|
+
return _context3.abrupt("return", address || u ? "" + (address || '') + (u ? " " + u : '') : '');
|
356
339
|
|
357
|
-
|
358
|
-
|
359
|
-
|
360
|
-
}
|
340
|
+
case 10:
|
341
|
+
case "end":
|
342
|
+
return _context3.stop();
|
361
343
|
}
|
362
344
|
}, _callee3);
|
363
|
-
}));
|
364
|
-
|
365
|
-
|
345
|
+
}))).apply(this, arguments);
|
346
|
+
} // 告警table列配置
|
347
|
+
|
366
348
|
|
367
349
|
var columns = [{
|
368
350
|
title: '描述',
|
@@ -418,48 +400,41 @@ function ResourceOverview(props) {
|
|
418
400
|
}]; // 告警/风险 操作 (受理)
|
419
401
|
|
420
402
|
function alarmRiskOperation(_x4, _x5) {
|
421
|
-
return _alarmRiskOperation.
|
422
|
-
}
|
423
|
-
|
424
|
-
function _alarmRiskOperation() {
|
425
|
-
_alarmRiskOperation = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee4(type, params) {
|
403
|
+
return (_alarmRiskOperation = _alarmRiskOperation || (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee4(type, params) {
|
426
404
|
var res;
|
427
405
|
return _regenerator["default"].wrap(function _callee4$(_context4) {
|
428
|
-
while (1) {
|
429
|
-
|
430
|
-
|
431
|
-
|
432
|
-
|
433
|
-
|
434
|
-
}
|
406
|
+
while (1) switch (_context4.prev = _context4.next) {
|
407
|
+
case 0:
|
408
|
+
if (!(type === 'alarm')) {
|
409
|
+
_context4.next = 6;
|
410
|
+
break;
|
411
|
+
}
|
435
412
|
|
436
|
-
|
437
|
-
|
413
|
+
_context4.next = 3;
|
414
|
+
return _overview["default"].handleAlarm(params);
|
438
415
|
|
439
|
-
|
440
|
-
|
416
|
+
case 3:
|
417
|
+
res = _context4.sent;
|
441
418
|
|
442
|
-
|
419
|
+
_message["default"].success('受理成功');
|
443
420
|
|
444
|
-
|
445
|
-
|
446
|
-
|
447
|
-
|
448
|
-
|
449
|
-
|
450
|
-
|
451
|
-
|
452
|
-
|
453
|
-
|
421
|
+
refreshAlarmData(id); // if (isAppTopo) {
|
422
|
+
// const {
|
423
|
+
// displayName: ciName,
|
424
|
+
// attributeMap: modelAttributeMap,
|
425
|
+
// domain,
|
426
|
+
// } = topo.ciTyeCache.getCiType(ciType);
|
427
|
+
// initAppTopo(monitorMetricModels, modelAttributeMap, ciName, domain);
|
428
|
+
// } else {
|
429
|
+
// getAlarmRiskData(id);
|
430
|
+
// }
|
454
431
|
|
455
|
-
|
456
|
-
|
457
|
-
|
458
|
-
}
|
432
|
+
case 6:
|
433
|
+
case "end":
|
434
|
+
return _context4.stop();
|
459
435
|
}
|
460
436
|
}, _callee4);
|
461
|
-
}));
|
462
|
-
return _alarmRiskOperation.apply(this, arguments);
|
437
|
+
}))).apply(this, arguments);
|
463
438
|
}
|
464
439
|
|
465
440
|
var elementData = {
|
@@ -471,345 +446,324 @@ function ResourceOverview(props) {
|
|
471
446
|
}; // 基本信息设置改变
|
472
447
|
|
473
448
|
function baseInfoColChange(_x6) {
|
474
|
-
return _baseInfoColChange
|
475
|
-
|
449
|
+
return (_baseInfoColChange = _baseInfoColChange || (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee5(col) {
|
450
|
+
var _col;
|
476
451
|
|
452
|
+
var infoData, attributeMap, _loop, _iterator, _step;
|
477
453
|
|
478
|
-
|
479
|
-
|
480
|
-
|
454
|
+
return _regenerator["default"].wrap(function _callee5$(_context6) {
|
455
|
+
while (1) switch (_context6.prev = _context6.next) {
|
456
|
+
case 0:
|
457
|
+
if ((_col = col) !== null && _col !== void 0 && _col.length) {
|
458
|
+
_context6.next = 3;
|
459
|
+
break;
|
460
|
+
}
|
481
461
|
|
482
|
-
|
462
|
+
setBaseInfo([]);
|
463
|
+
return _context6.abrupt("return");
|
483
464
|
|
484
|
-
|
485
|
-
|
486
|
-
|
487
|
-
|
488
|
-
|
489
|
-
_context6.next = 3;
|
490
|
-
break;
|
491
|
-
}
|
465
|
+
case 3:
|
466
|
+
settBaseInfoInitLoading(true);
|
467
|
+
infoData = [];
|
468
|
+
_context6.next = 7;
|
469
|
+
return getAttribute(id);
|
492
470
|
|
493
|
-
|
494
|
-
|
471
|
+
case 7:
|
472
|
+
attributeMap = _context6.sent;
|
473
|
+
// console.log('getAttribute', attributeMap);
|
474
|
+
col = col.filter(function (item) {
|
475
|
+
return !item.hidden;
|
476
|
+
});
|
477
|
+
_loop = /*#__PURE__*/_regenerator["default"].mark(function _loop() {
|
478
|
+
var item, value, contentTitle, link, address, owned_computer_room, owned_cabinet, roomLink, node, data, _ref3, _ref3$, _item, _attributeMap, object, _object2, displayName, attr;
|
479
|
+
|
480
|
+
return _regenerator["default"].wrap(function _loop$(_context5) {
|
481
|
+
while (1) switch (_context5.prev = _context5.next) {
|
482
|
+
case 0:
|
483
|
+
item = _step.value;
|
484
|
+
value = (0, _attributeFormatter.formatMetric)(attributeMap[item.dataIndex], ciTypeMeta.attributeMap[item.dataIndex]);
|
485
|
+
contentTitle = value;
|
486
|
+
_context5.t0 = item.dataIndex;
|
487
|
+
_context5.next = _context5.t0 === 'display_name' ? 6 : _context5.t0 === 'ciName' ? 9 : _context5.t0 === 'res_address' ? 12 : _context5.t0 === 'imageName' ? 19 : 23;
|
488
|
+
break;
|
489
|
+
|
490
|
+
case 6:
|
491
|
+
// 无监控模板不能跳转详情。跳转前需判定资源实例数据属性中是否包含support_templates属性。若不包含,则不能跳转
|
492
|
+
if (attributeMap.support_templates) {
|
493
|
+
link = "/default/pagecenter/resDetail/view/" + id + "?resId=" + id + "&domainCode=" + ciTypeMeta.domain + "&title=" + attributeMap.display_name + "&ciCode=" + ciType; // 资源跳转链接
|
494
|
+
|
495
|
+
value = /*#__PURE__*/_react["default"].createElement("span", {
|
496
|
+
onClick: onClose
|
497
|
+
}, /*#__PURE__*/_react["default"].createElement(_Link["default"], {
|
498
|
+
className: _indexModule["default"].link,
|
499
|
+
disabled: true,
|
500
|
+
title: attributeMap.display_name || '',
|
501
|
+
to: formatUrl(link)
|
502
|
+
}, attributeMap.display_name || '-'));
|
503
|
+
} else {
|
504
|
+
value = attributeMap.display_name || '-';
|
505
|
+
}
|
495
506
|
|
496
|
-
|
497
|
-
|
498
|
-
infoData = [];
|
499
|
-
_context6.next = 7;
|
500
|
-
return getAttribute(id);
|
507
|
+
contentTitle = attributeMap.display_name || '-';
|
508
|
+
return _context5.abrupt("break", 24);
|
501
509
|
|
502
|
-
|
503
|
-
|
504
|
-
|
505
|
-
|
506
|
-
return !item.hidden;
|
507
|
-
});
|
508
|
-
_iterator = _createForOfIteratorHelperLoose(col);
|
510
|
+
case 9:
|
511
|
+
value = ciTypeMeta.displayName;
|
512
|
+
contentTitle = value;
|
513
|
+
return _context5.abrupt("break", 24);
|
509
514
|
|
510
|
-
|
511
|
-
|
512
|
-
|
513
|
-
break;
|
514
|
-
}
|
515
|
+
case 12:
|
516
|
+
_context5.next = 14;
|
517
|
+
return getAddressFormat(attributeMap);
|
515
518
|
|
516
|
-
|
517
|
-
|
518
|
-
|
519
|
-
return _context6.delegateYield( /*#__PURE__*/_regenerator["default"].mark(function _callee5() {
|
520
|
-
var link, address, owned_computer_room, owned_cabinet, roomLink, node;
|
521
|
-
return _regenerator["default"].wrap(function _callee5$(_context5) {
|
522
|
-
while (1) {
|
523
|
-
switch (_context5.prev = _context5.next) {
|
524
|
-
case 0:
|
525
|
-
_context5.t0 = item.dataIndex;
|
526
|
-
_context5.next = _context5.t0 === 'display_name' ? 3 : _context5.t0 === 'ciName' ? 6 : _context5.t0 === 'res_address' ? 9 : _context5.t0 === 'imageName' ? 16 : 20;
|
527
|
-
break;
|
528
|
-
|
529
|
-
case 3:
|
530
|
-
// 无监控模板不能跳转详情。跳转前需判定资源实例数据属性中是否包含support_templates属性。若不包含,则不能跳转
|
531
|
-
if (attributeMap.support_templates) {
|
532
|
-
link = "/default/pagecenter/resDetail/view/" + id + "?resId=" + id + "&domainCode=" + ciTypeMeta.domain + "&title=" + attributeMap.display_name + "&ciCode=" + ciType; // 资源跳转链接
|
533
|
-
|
534
|
-
value = /*#__PURE__*/_react["default"].createElement("span", {
|
535
|
-
onClick: onClose
|
536
|
-
}, /*#__PURE__*/_react["default"].createElement(_Link["default"], {
|
537
|
-
className: _indexModule["default"].link,
|
538
|
-
disabled: true,
|
539
|
-
title: attributeMap.display_name || '',
|
540
|
-
to: formatUrl(link)
|
541
|
-
}, attributeMap.display_name || '-'));
|
542
|
-
} else {
|
543
|
-
value = attributeMap.display_name || '-';
|
544
|
-
}
|
519
|
+
case 14:
|
520
|
+
address = _context5.sent;
|
521
|
+
owned_computer_room = attributeMap.owned_computer_room, owned_cabinet = attributeMap.owned_cabinet; // 跳转3D机房定位设备
|
545
522
|
|
546
|
-
|
547
|
-
|
548
|
-
|
549
|
-
|
550
|
-
|
551
|
-
|
552
|
-
return _context5.abrupt("break", 21);
|
553
|
-
|
554
|
-
case 9:
|
555
|
-
_context5.next = 11;
|
556
|
-
return getAddressFormat(attributeMap);
|
557
|
-
|
558
|
-
case 11:
|
559
|
-
address = _context5.sent;
|
560
|
-
owned_computer_room = attributeMap.owned_computer_room, owned_cabinet = attributeMap.owned_cabinet; // 跳转3D机房定位设备
|
561
|
-
|
562
|
-
if (owned_computer_room && owned_cabinet) {
|
563
|
-
// /visual/room/index_runtime.html?type=preview&room_id=00000000383e3381&rack_id=11&device_id=122
|
564
|
-
roomLink = "/visual/room/index_runtime.html?type=preview&room_id=" + owned_computer_room + "&rack_id=" + owned_cabinet + "&device_id=" + id;
|
565
|
-
value = /*#__PURE__*/_react["default"].createElement("span", {
|
566
|
-
onClick: function onClick() {
|
567
|
-
jump(roomLink, owned_computer_room);
|
568
|
-
}
|
569
|
-
}, /*#__PURE__*/_react["default"].createElement("span", {
|
570
|
-
className: _indexModule["default"].link,
|
571
|
-
title: address
|
572
|
-
}, address));
|
573
|
-
} else {
|
574
|
-
value = address;
|
523
|
+
if (owned_computer_room && owned_cabinet) {
|
524
|
+
// /visual/room/index_runtime.html?type=preview&room_id=00000000383e3381&rack_id=11&device_id=122
|
525
|
+
roomLink = "/visual/room/index_runtime.html?type=preview&room_id=" + owned_computer_room + "&rack_id=" + owned_cabinet + "&device_id=" + id;
|
526
|
+
value = /*#__PURE__*/_react["default"].createElement("span", {
|
527
|
+
onClick: function onClick() {
|
528
|
+
jump(roomLink, owned_computer_room);
|
575
529
|
}
|
530
|
+
}, /*#__PURE__*/_react["default"].createElement("span", {
|
531
|
+
className: _indexModule["default"].link,
|
532
|
+
title: address
|
533
|
+
}, address));
|
534
|
+
} else {
|
535
|
+
value = address;
|
536
|
+
}
|
576
537
|
|
577
|
-
|
578
|
-
|
538
|
+
contentTitle = address;
|
539
|
+
return _context5.abrupt("break", 24);
|
579
540
|
|
580
|
-
|
581
|
-
|
582
|
-
|
583
|
-
|
584
|
-
|
541
|
+
case 19:
|
542
|
+
node = topo.getDataModel().getDataByTag(id);
|
543
|
+
value = (node === null || node === void 0 ? void 0 : node.a('customName')) || (node === null || node === void 0 ? void 0 : node.a('name')) || '-';
|
544
|
+
contentTitle = value;
|
545
|
+
return _context5.abrupt("break", 24);
|
585
546
|
|
586
|
-
|
587
|
-
|
547
|
+
case 23:
|
548
|
+
return _context5.abrupt("break", 24);
|
588
549
|
|
589
|
-
|
590
|
-
|
591
|
-
|
550
|
+
case 24:
|
551
|
+
// 拿翻译字段属性数据
|
552
|
+
if (attributeMap[item.dataIndex] && attributeMap[item.dataIndex + ".name"]) {
|
553
|
+
value = attributeMap[item.dataIndex + ".name"];
|
554
|
+
contentTitle = value;
|
592
555
|
}
|
593
|
-
}
|
594
|
-
}, _callee5);
|
595
|
-
})(), "t0", 15);
|
596
|
-
|
597
|
-
case 15:
|
598
|
-
// 拿翻译字段属性数据
|
599
|
-
if (attributeMap[item.dataIndex] && attributeMap[item.dataIndex + ".name"]) {
|
600
|
-
value = attributeMap[item.dataIndex + ".name"];
|
601
|
-
contentTitle = value;
|
602
|
-
}
|
603
556
|
|
604
|
-
|
605
|
-
|
606
|
-
|
607
|
-
|
608
|
-
|
609
|
-
|
610
|
-
|
611
|
-
|
612
|
-
|
613
|
-
|
614
|
-
|
615
|
-
|
557
|
+
data = topo.attributeMetricDisplay.getData() || [];
|
558
|
+
_ref3 = [].concat(data.filter(function (m) {
|
559
|
+
return m.id === id;
|
560
|
+
})), _ref3$ = _ref3[0], _item = _ref3$ === void 0 ? {} : _ref3$;
|
561
|
+
_attributeMap = _item.attributeMap || {};
|
562
|
+
object = _attributeMap[item.dataIndex + "_object"] || {};
|
563
|
+
|
564
|
+
if (!attributeMap[item.dataIndex + ".name"] && JSON.stringify(object) !== '{}') {
|
565
|
+
_object2 = (0, _extends2["default"])({}, object), displayName = _object2.displayName;
|
566
|
+
value = displayName || _attributeMap["" + item.dataIndex];
|
567
|
+
contentTitle = value;
|
568
|
+
}
|
616
569
|
|
617
|
-
|
618
|
-
|
619
|
-
|
620
|
-
|
570
|
+
if (item.dataIndex === 'ipv6_address') {
|
571
|
+
value = _attributeMap["" + item.dataIndex];
|
572
|
+
contentTitle = value;
|
573
|
+
}
|
621
574
|
|
622
|
-
|
623
|
-
|
624
|
-
|
625
|
-
|
626
|
-
|
575
|
+
if (isAppTopo && (item.dataIndex === 'source_type' || item.dataIndex === 'destination_type')) {
|
576
|
+
attr = topo.ciTyeCache.getCiType(attributeMap["" + item.dataIndex]) || {};
|
577
|
+
value = attr.displayName || attributeMap["" + item.dataIndex];
|
578
|
+
contentTitle = value;
|
579
|
+
}
|
627
580
|
|
628
|
-
|
629
|
-
|
630
|
-
|
631
|
-
|
581
|
+
infoData.push((0, _extends2["default"])({}, item, {
|
582
|
+
value: value,
|
583
|
+
contentTitle: contentTitle
|
584
|
+
}));
|
632
585
|
|
633
|
-
|
634
|
-
|
586
|
+
case 33:
|
587
|
+
case "end":
|
588
|
+
return _context5.stop();
|
589
|
+
}
|
590
|
+
}, _loop);
|
591
|
+
});
|
592
|
+
_iterator = _createForOfIteratorHelperLoose(col);
|
593
|
+
|
594
|
+
case 11:
|
595
|
+
if ((_step = _iterator()).done) {
|
596
|
+
_context6.next = 15;
|
635
597
|
break;
|
598
|
+
}
|
636
599
|
|
637
|
-
|
638
|
-
settBaseInfoInitLoading(false);
|
639
|
-
setBaseInfo(infoData);
|
600
|
+
return _context6.delegateYield(_loop(), "t0", 13);
|
640
601
|
|
641
|
-
|
642
|
-
|
643
|
-
|
644
|
-
}
|
645
|
-
}
|
646
|
-
}, _callee6);
|
647
|
-
}));
|
648
|
-
return _baseInfoColChange.apply(this, arguments);
|
649
|
-
}
|
602
|
+
case 13:
|
603
|
+
_context6.next = 11;
|
604
|
+
break;
|
650
605
|
|
651
|
-
|
652
|
-
|
653
|
-
|
606
|
+
case 15:
|
607
|
+
settBaseInfoInitLoading(false);
|
608
|
+
setBaseInfo(infoData);
|
654
609
|
|
610
|
+
case 17:
|
611
|
+
case "end":
|
612
|
+
return _context6.stop();
|
613
|
+
}
|
614
|
+
}, _callee5);
|
615
|
+
}))).apply(this, arguments);
|
616
|
+
} // 获取属性信息
|
655
617
|
|
656
|
-
function _getAttribute() {
|
657
|
-
_getAttribute = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee7(id) {
|
658
|
-
var _yield$resourceOvervi, baseInfos, res, _ref4, attributes;
|
659
618
|
|
660
|
-
|
661
|
-
|
662
|
-
|
663
|
-
|
664
|
-
|
665
|
-
|
666
|
-
|
667
|
-
|
619
|
+
function getAttribute(_x7) {
|
620
|
+
return (_getAttribute = _getAttribute || (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee6(id) {
|
621
|
+
var _yield$resourceOvervi2, baseInfos, res, _ref4, attributes;
|
622
|
+
|
623
|
+
return _regenerator["default"].wrap(function _callee6$(_context7) {
|
624
|
+
while (1) switch (_context7.prev = _context7.next) {
|
625
|
+
case 0:
|
626
|
+
if (id) {
|
627
|
+
_context7.next = 2;
|
628
|
+
break;
|
629
|
+
}
|
668
630
|
|
669
|
-
|
631
|
+
return _context7.abrupt("return");
|
670
632
|
|
671
|
-
|
672
|
-
|
673
|
-
|
674
|
-
|
675
|
-
|
633
|
+
case 2:
|
634
|
+
if (!(resourceOverviewProps !== null && resourceOverviewProps !== void 0 && resourceOverviewProps.getData)) {
|
635
|
+
_context7.next = 9;
|
636
|
+
break;
|
637
|
+
}
|
676
638
|
|
677
|
-
|
678
|
-
|
679
|
-
|
680
|
-
|
639
|
+
_context7.next = 5;
|
640
|
+
return resourceOverviewProps === null || resourceOverviewProps === void 0 ? void 0 : resourceOverviewProps.getData({
|
641
|
+
id: id
|
642
|
+
});
|
681
643
|
|
682
|
-
|
683
|
-
|
684
|
-
|
644
|
+
case 5:
|
645
|
+
_yield$resourceOvervi2 = _context7.sent;
|
646
|
+
baseInfos = _yield$resourceOvervi2.baseInfos;
|
685
647
|
|
686
|
-
|
687
|
-
|
688
|
-
|
689
|
-
|
648
|
+
if (!baseInfos) {
|
649
|
+
_context7.next = 9;
|
650
|
+
break;
|
651
|
+
}
|
690
652
|
|
691
|
-
|
692
|
-
|
693
|
-
|
694
|
-
|
695
|
-
|
696
|
-
|
697
|
-
|
698
|
-
|
699
|
-
|
700
|
-
|
701
|
-
|
702
|
-
|
703
|
-
|
704
|
-
|
653
|
+
return _context7.abrupt("return", baseInfos);
|
654
|
+
|
655
|
+
case 9:
|
656
|
+
_context7.next = 11;
|
657
|
+
return _overview["default"].commonQueryCiData({
|
658
|
+
condition: "id('" + id + "')",
|
659
|
+
refAttribute: true,
|
660
|
+
orders: [{
|
661
|
+
name: 'CREATED_TIME',
|
662
|
+
type: 'asc'
|
663
|
+
}],
|
664
|
+
pageIndex: 1,
|
665
|
+
pageSize: 10
|
666
|
+
});
|
705
667
|
|
706
|
-
|
707
|
-
|
708
|
-
|
709
|
-
|
668
|
+
case 11:
|
669
|
+
res = _context7.sent;
|
670
|
+
_ref4 = (res === null || res === void 0 ? void 0 : res.data[0]) || {}, attributes = _ref4.attributes;
|
671
|
+
return _context7.abrupt("return", attributes || {});
|
710
672
|
|
711
|
-
|
712
|
-
|
713
|
-
|
714
|
-
}
|
673
|
+
case 14:
|
674
|
+
case "end":
|
675
|
+
return _context7.stop();
|
715
676
|
}
|
716
|
-
},
|
717
|
-
}));
|
718
|
-
|
719
|
-
}
|
677
|
+
}, _callee6);
|
678
|
+
}))).apply(this, arguments);
|
679
|
+
} // 指标设置改变
|
720
680
|
|
721
|
-
function metricColChange(_x8) {
|
722
|
-
return _metricColChange.apply(this, arguments);
|
723
|
-
}
|
724
681
|
|
725
|
-
function
|
726
|
-
_metricColChange = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function
|
682
|
+
function metricColChange(_x8) {
|
683
|
+
return (_metricColChange = _metricColChange || (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee7(col) {
|
727
684
|
var _col2, _col3;
|
728
685
|
|
729
|
-
var codes, endTime, params,
|
686
|
+
var codes, endTime, params, _ref6, times, metricList, metricLists;
|
730
687
|
|
731
|
-
return _regenerator["default"].wrap(function
|
732
|
-
while (1) {
|
733
|
-
|
734
|
-
|
735
|
-
|
736
|
-
|
737
|
-
|
738
|
-
|
688
|
+
return _regenerator["default"].wrap(function _callee7$(_context8) {
|
689
|
+
while (1) switch (_context8.prev = _context8.next) {
|
690
|
+
case 0:
|
691
|
+
// console.log('metricColChange col', col);
|
692
|
+
col = (_col2 = col) === null || _col2 === void 0 ? void 0 : _col2.filter(function (item) {
|
693
|
+
return !item.hidden;
|
694
|
+
});
|
695
|
+
|
696
|
+
if ((_col3 = col) !== null && _col3 !== void 0 && _col3.length) {
|
697
|
+
_context8.next = 4;
|
698
|
+
break;
|
699
|
+
}
|
700
|
+
|
701
|
+
setMetric([]); // Message.error('指标未设置')
|
702
|
+
|
703
|
+
return _context8.abrupt("return");
|
739
704
|
|
740
|
-
|
741
|
-
|
742
|
-
|
705
|
+
case 4:
|
706
|
+
codes = col.map(function (item) {
|
707
|
+
return item.dataIndex;
|
708
|
+
});
|
709
|
+
endTime = Math.floor(new Date().getTime() / 1000);
|
710
|
+
params = {
|
711
|
+
ciIds: [id],
|
712
|
+
subIds: [id],
|
713
|
+
startTime: endTime - 60 * 60,
|
714
|
+
endTime: endTime,
|
715
|
+
codes: codes
|
716
|
+
};
|
717
|
+
|
718
|
+
if (isAppTopo) {
|
719
|
+
_ref6 = resourceOverviewProps.metricProps || {}, times = _ref6.times;
|
720
|
+
|
721
|
+
if (times !== null && times !== void 0 && times.length) {
|
722
|
+
params.startTime = times[0];
|
723
|
+
params.endTime = times[1];
|
743
724
|
}
|
725
|
+
}
|
744
726
|
|
745
|
-
|
727
|
+
setMetricInitLoading(true);
|
728
|
+
_context8.next = 11;
|
729
|
+
return _overview["default"].getMetricList(params);
|
746
730
|
|
747
|
-
|
731
|
+
case 11:
|
732
|
+
metricList = _context8.sent;
|
733
|
+
metricLists = metricList.concat(getNewMetricList());
|
748
734
|
|
749
|
-
|
750
|
-
|
751
|
-
|
752
|
-
|
753
|
-
|
754
|
-
|
755
|
-
ciIds: [id],
|
756
|
-
subIds: [id],
|
735
|
+
_rlog.rlog.debug('metricColChange', metricLists, monitorMetricModels);
|
736
|
+
|
737
|
+
setMetric(col.map(function (item, key) {
|
738
|
+
return {
|
739
|
+
code: item.dataIndex,
|
740
|
+
chartIndex: key,
|
757
741
|
startTime: endTime - 60 * 60,
|
758
742
|
endTime: endTime,
|
759
|
-
|
743
|
+
metricItem: monitorMetricModels.find(function (m_item) {
|
744
|
+
return m_item.code === item.dataIndex;
|
745
|
+
}),
|
746
|
+
list: metricLists.filter(function (m_item) {
|
747
|
+
return m_item.metricCode === item.dataIndex;
|
748
|
+
})
|
760
749
|
};
|
750
|
+
}));
|
751
|
+
setMetricInitLoading(false);
|
752
|
+
|
753
|
+
if (!isAppTopo) {
|
754
|
+
// 一分钟更新一次指标信息 metricTimer
|
755
|
+
window.topo_overview_metric_timer && clearInterval(window.topo_overview_metric_timer);
|
756
|
+
window.topo_overview_metric_timer = setInterval(function () {
|
757
|
+
metricColChange(col);
|
758
|
+
}, 60000);
|
759
|
+
}
|
761
760
|
|
762
|
-
|
763
|
-
|
764
|
-
|
765
|
-
if (times !== null && times !== void 0 && times.length) {
|
766
|
-
params.startTime = times[0];
|
767
|
-
params.endTime = times[1];
|
768
|
-
}
|
769
|
-
}
|
770
|
-
|
771
|
-
setMetricInitLoading(true);
|
772
|
-
_context8.next = 11;
|
773
|
-
return _overview["default"].getMetricList(params);
|
774
|
-
|
775
|
-
case 11:
|
776
|
-
metricList = _context8.sent;
|
777
|
-
metricLists = metricList.concat(getNewMetricList());
|
778
|
-
|
779
|
-
_rlog.rlog.debug('metricColChange', metricLists, monitorMetricModels);
|
780
|
-
|
781
|
-
setMetric(col.map(function (item, key) {
|
782
|
-
return {
|
783
|
-
code: item.dataIndex,
|
784
|
-
chartIndex: key,
|
785
|
-
startTime: endTime - 60 * 60,
|
786
|
-
endTime: endTime,
|
787
|
-
metricItem: monitorMetricModels.find(function (m_item) {
|
788
|
-
return m_item.code === item.dataIndex;
|
789
|
-
}),
|
790
|
-
list: metricLists.filter(function (m_item) {
|
791
|
-
return m_item.metricCode === item.dataIndex;
|
792
|
-
})
|
793
|
-
};
|
794
|
-
}));
|
795
|
-
setMetricInitLoading(false);
|
796
|
-
|
797
|
-
if (!isAppTopo) {
|
798
|
-
// 一分钟更新一次指标信息 metricTimer
|
799
|
-
window.topo_overview_metric_timer && clearInterval(window.topo_overview_metric_timer);
|
800
|
-
window.topo_overview_metric_timer = setInterval(function () {
|
801
|
-
metricColChange(col);
|
802
|
-
}, 60000);
|
803
|
-
}
|
804
|
-
|
805
|
-
case 17:
|
806
|
-
case "end":
|
807
|
-
return _context8.stop();
|
808
|
-
}
|
761
|
+
case 17:
|
762
|
+
case "end":
|
763
|
+
return _context8.stop();
|
809
764
|
}
|
810
|
-
},
|
811
|
-
}));
|
812
|
-
return _metricColChange.apply(this, arguments);
|
765
|
+
}, _callee7);
|
766
|
+
}))).apply(this, arguments);
|
813
767
|
}
|
814
768
|
|
815
769
|
var getNewMetricList = function getNewMetricList() {
|