@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
@@ -61,7 +61,7 @@ function _createForOfIteratorHelperLoose(o, allowArrayLike) { var it = typeof Sy
|
|
61
61
|
|
62
62
|
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); }
|
63
63
|
|
64
|
-
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++)
|
64
|
+
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; }
|
65
65
|
|
66
66
|
// url 处理,UICBB 的地址需截取前缀
|
67
67
|
function formatUrl(url) {
|
@@ -82,7 +82,7 @@ function formatUrl(url) {
|
|
82
82
|
|
83
83
|
|
84
84
|
function ResourceOverview(props) {
|
85
|
-
var _data$attributes;
|
85
|
+
var _data$attributes, _ref, _getAddressFormat, _alarmRiskOperation, _baseInfoColChange, _getAttribute, _metricColChange;
|
86
86
|
|
87
87
|
var topo = props.topo,
|
88
88
|
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 = {
|
@@ -470,345 +445,324 @@ function ResourceOverview(props) {
|
|
470
445
|
}; // 基本信息设置改变
|
471
446
|
|
472
447
|
function baseInfoColChange(_x6) {
|
473
|
-
return _baseInfoColChange
|
474
|
-
|
448
|
+
return (_baseInfoColChange = _baseInfoColChange || (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee5(col) {
|
449
|
+
var _col;
|
475
450
|
|
451
|
+
var infoData, attributeMap, _loop, _iterator, _step;
|
476
452
|
|
477
|
-
|
478
|
-
|
479
|
-
|
453
|
+
return _regenerator["default"].wrap(function _callee5$(_context6) {
|
454
|
+
while (1) switch (_context6.prev = _context6.next) {
|
455
|
+
case 0:
|
456
|
+
if ((_col = col) !== null && _col !== void 0 && _col.length) {
|
457
|
+
_context6.next = 3;
|
458
|
+
break;
|
459
|
+
}
|
480
460
|
|
481
|
-
|
461
|
+
setBaseInfo([]);
|
462
|
+
return _context6.abrupt("return");
|
482
463
|
|
483
|
-
|
484
|
-
|
485
|
-
|
486
|
-
|
487
|
-
|
488
|
-
_context6.next = 3;
|
489
|
-
break;
|
490
|
-
}
|
464
|
+
case 3:
|
465
|
+
settBaseInfoInitLoading(true);
|
466
|
+
infoData = [];
|
467
|
+
_context6.next = 7;
|
468
|
+
return getAttribute(id);
|
491
469
|
|
492
|
-
|
493
|
-
|
470
|
+
case 7:
|
471
|
+
attributeMap = _context6.sent;
|
472
|
+
// console.log('getAttribute', attributeMap);
|
473
|
+
col = col.filter(function (item) {
|
474
|
+
return !item.hidden;
|
475
|
+
});
|
476
|
+
_loop = /*#__PURE__*/_regenerator["default"].mark(function _loop() {
|
477
|
+
var item, value, contentTitle, link, address, owned_computer_room, owned_cabinet, roomLink, node, data, _ref3, _ref3$, _item, _attributeMap, object, _object2, displayName, attr;
|
478
|
+
|
479
|
+
return _regenerator["default"].wrap(function _loop$(_context5) {
|
480
|
+
while (1) switch (_context5.prev = _context5.next) {
|
481
|
+
case 0:
|
482
|
+
item = _step.value;
|
483
|
+
value = (0, _metricUtil.formatMetric)(attributeMap[item.dataIndex], ciTypeMeta.attributeMap[item.dataIndex]);
|
484
|
+
contentTitle = value;
|
485
|
+
_context5.t0 = item.dataIndex;
|
486
|
+
_context5.next = _context5.t0 === 'display_name' ? 6 : _context5.t0 === 'ciName' ? 9 : _context5.t0 === 'res_address' ? 12 : _context5.t0 === 'imageName' ? 19 : 23;
|
487
|
+
break;
|
488
|
+
|
489
|
+
case 6:
|
490
|
+
// 无监控模板不能跳转详情。跳转前需判定资源实例数据属性中是否包含support_templates属性。若不包含,则不能跳转
|
491
|
+
if (attributeMap.support_templates) {
|
492
|
+
link = "/default/pagecenter/resDetail/view/" + id + "?resId=" + id + "&domainCode=" + ciTypeMeta.domain + "&title=" + attributeMap.display_name + "&ciCode=" + ciType; // 资源跳转链接
|
493
|
+
|
494
|
+
value = /*#__PURE__*/_react["default"].createElement("span", {
|
495
|
+
onClick: onClose
|
496
|
+
}, /*#__PURE__*/_react["default"].createElement(_Link["default"], {
|
497
|
+
className: _indexModule["default"].link,
|
498
|
+
disabled: true,
|
499
|
+
title: attributeMap.display_name || '',
|
500
|
+
to: formatUrl(link)
|
501
|
+
}, attributeMap.display_name || '-'));
|
502
|
+
} else {
|
503
|
+
value = attributeMap.display_name || '-';
|
504
|
+
}
|
494
505
|
|
495
|
-
|
496
|
-
|
497
|
-
infoData = [];
|
498
|
-
_context6.next = 7;
|
499
|
-
return getAttribute(id);
|
506
|
+
contentTitle = attributeMap.display_name || '-';
|
507
|
+
return _context5.abrupt("break", 24);
|
500
508
|
|
501
|
-
|
502
|
-
|
503
|
-
|
504
|
-
|
505
|
-
return !item.hidden;
|
506
|
-
});
|
507
|
-
_iterator = _createForOfIteratorHelperLoose(col);
|
509
|
+
case 9:
|
510
|
+
value = ciTypeMeta.displayName;
|
511
|
+
contentTitle = value;
|
512
|
+
return _context5.abrupt("break", 24);
|
508
513
|
|
509
|
-
|
510
|
-
|
511
|
-
|
512
|
-
break;
|
513
|
-
}
|
514
|
+
case 12:
|
515
|
+
_context5.next = 14;
|
516
|
+
return getAddressFormat(attributeMap);
|
514
517
|
|
515
|
-
|
516
|
-
|
517
|
-
|
518
|
-
return _context6.delegateYield( /*#__PURE__*/_regenerator["default"].mark(function _callee5() {
|
519
|
-
var link, address, owned_computer_room, owned_cabinet, roomLink, node;
|
520
|
-
return _regenerator["default"].wrap(function _callee5$(_context5) {
|
521
|
-
while (1) {
|
522
|
-
switch (_context5.prev = _context5.next) {
|
523
|
-
case 0:
|
524
|
-
_context5.t0 = item.dataIndex;
|
525
|
-
_context5.next = _context5.t0 === 'display_name' ? 3 : _context5.t0 === 'ciName' ? 6 : _context5.t0 === 'res_address' ? 9 : _context5.t0 === 'imageName' ? 16 : 20;
|
526
|
-
break;
|
527
|
-
|
528
|
-
case 3:
|
529
|
-
// 无监控模板不能跳转详情。跳转前需判定资源实例数据属性中是否包含support_templates属性。若不包含,则不能跳转
|
530
|
-
if (attributeMap.support_templates) {
|
531
|
-
link = "/default/pagecenter/resDetail/view/" + id + "?resId=" + id + "&domainCode=" + ciTypeMeta.domain + "&title=" + attributeMap.display_name + "&ciCode=" + ciType; // 资源跳转链接
|
532
|
-
|
533
|
-
value = /*#__PURE__*/_react["default"].createElement("span", {
|
534
|
-
onClick: onClose
|
535
|
-
}, /*#__PURE__*/_react["default"].createElement(_Link["default"], {
|
536
|
-
className: _indexModule["default"].link,
|
537
|
-
disabled: true,
|
538
|
-
title: attributeMap.display_name || '',
|
539
|
-
to: formatUrl(link)
|
540
|
-
}, attributeMap.display_name || '-'));
|
541
|
-
} else {
|
542
|
-
value = attributeMap.display_name || '-';
|
543
|
-
}
|
518
|
+
case 14:
|
519
|
+
address = _context5.sent;
|
520
|
+
owned_computer_room = attributeMap.owned_computer_room, owned_cabinet = attributeMap.owned_cabinet; // 跳转3D机房定位设备
|
544
521
|
|
545
|
-
|
546
|
-
|
547
|
-
|
548
|
-
|
549
|
-
|
550
|
-
|
551
|
-
return _context5.abrupt("break", 21);
|
552
|
-
|
553
|
-
case 9:
|
554
|
-
_context5.next = 11;
|
555
|
-
return getAddressFormat(attributeMap);
|
556
|
-
|
557
|
-
case 11:
|
558
|
-
address = _context5.sent;
|
559
|
-
owned_computer_room = attributeMap.owned_computer_room, owned_cabinet = attributeMap.owned_cabinet; // 跳转3D机房定位设备
|
560
|
-
|
561
|
-
if (owned_computer_room && owned_cabinet) {
|
562
|
-
// /visual/room/index_runtime.html?type=preview&room_id=00000000383e3381&rack_id=11&device_id=122
|
563
|
-
roomLink = "/visual/room/index_runtime.html?type=preview&room_id=" + owned_computer_room + "&rack_id=" + owned_cabinet + "&device_id=" + id;
|
564
|
-
value = /*#__PURE__*/_react["default"].createElement("span", {
|
565
|
-
onClick: function onClick() {
|
566
|
-
jump(roomLink, owned_computer_room);
|
567
|
-
}
|
568
|
-
}, /*#__PURE__*/_react["default"].createElement("span", {
|
569
|
-
className: _indexModule["default"].link,
|
570
|
-
title: address
|
571
|
-
}, address));
|
572
|
-
} else {
|
573
|
-
value = address;
|
522
|
+
if (owned_computer_room && owned_cabinet) {
|
523
|
+
// /visual/room/index_runtime.html?type=preview&room_id=00000000383e3381&rack_id=11&device_id=122
|
524
|
+
roomLink = "/visual/room/index_runtime.html?type=preview&room_id=" + owned_computer_room + "&rack_id=" + owned_cabinet + "&device_id=" + id;
|
525
|
+
value = /*#__PURE__*/_react["default"].createElement("span", {
|
526
|
+
onClick: function onClick() {
|
527
|
+
jump(roomLink, owned_computer_room);
|
574
528
|
}
|
529
|
+
}, /*#__PURE__*/_react["default"].createElement("span", {
|
530
|
+
className: _indexModule["default"].link,
|
531
|
+
title: address
|
532
|
+
}, address));
|
533
|
+
} else {
|
534
|
+
value = address;
|
535
|
+
}
|
575
536
|
|
576
|
-
|
577
|
-
|
537
|
+
contentTitle = address;
|
538
|
+
return _context5.abrupt("break", 24);
|
578
539
|
|
579
|
-
|
580
|
-
|
581
|
-
|
582
|
-
|
583
|
-
|
540
|
+
case 19:
|
541
|
+
node = topo.getDataModel().getDataByTag(id);
|
542
|
+
value = (node === null || node === void 0 ? void 0 : node.a('customName')) || (node === null || node === void 0 ? void 0 : node.a('name')) || '-';
|
543
|
+
contentTitle = value;
|
544
|
+
return _context5.abrupt("break", 24);
|
584
545
|
|
585
|
-
|
586
|
-
|
546
|
+
case 23:
|
547
|
+
return _context5.abrupt("break", 24);
|
587
548
|
|
588
|
-
|
589
|
-
|
590
|
-
|
549
|
+
case 24:
|
550
|
+
// 拿翻译字段属性数据
|
551
|
+
if (attributeMap[item.dataIndex] && attributeMap[item.dataIndex + ".name"]) {
|
552
|
+
value = attributeMap[item.dataIndex + ".name"];
|
553
|
+
contentTitle = value;
|
591
554
|
}
|
592
|
-
}
|
593
|
-
}, _callee5);
|
594
|
-
})(), "t0", 15);
|
595
|
-
|
596
|
-
case 15:
|
597
|
-
// 拿翻译字段属性数据
|
598
|
-
if (attributeMap[item.dataIndex] && attributeMap[item.dataIndex + ".name"]) {
|
599
|
-
value = attributeMap[item.dataIndex + ".name"];
|
600
|
-
contentTitle = value;
|
601
|
-
}
|
602
555
|
|
603
|
-
|
604
|
-
|
605
|
-
|
606
|
-
|
607
|
-
|
608
|
-
|
609
|
-
|
610
|
-
|
611
|
-
|
612
|
-
|
613
|
-
|
614
|
-
|
556
|
+
data = topo.attributeMetricDisplay.getData() || [];
|
557
|
+
_ref3 = [].concat(data.filter(function (m) {
|
558
|
+
return m.id === id;
|
559
|
+
})), _ref3$ = _ref3[0], _item = _ref3$ === void 0 ? {} : _ref3$;
|
560
|
+
_attributeMap = _item.attributeMap || {};
|
561
|
+
object = _attributeMap[item.dataIndex + "_object"] || {};
|
562
|
+
|
563
|
+
if (!attributeMap[item.dataIndex + ".name"] && JSON.stringify(object) !== '{}') {
|
564
|
+
_object2 = (0, _extends2["default"])({}, object), displayName = _object2.displayName;
|
565
|
+
value = displayName || _attributeMap["" + item.dataIndex];
|
566
|
+
contentTitle = value;
|
567
|
+
}
|
615
568
|
|
616
|
-
|
617
|
-
|
618
|
-
|
619
|
-
|
569
|
+
if (item.dataIndex === 'ipv6_address') {
|
570
|
+
value = _attributeMap["" + item.dataIndex];
|
571
|
+
contentTitle = value;
|
572
|
+
}
|
620
573
|
|
621
|
-
|
622
|
-
|
623
|
-
|
624
|
-
|
625
|
-
|
574
|
+
if (isAppTopo && (item.dataIndex === 'source_type' || item.dataIndex === 'destination_type')) {
|
575
|
+
attr = topo.ciTyeCache.getCiType(attributeMap["" + item.dataIndex]) || {};
|
576
|
+
value = attr.displayName || attributeMap["" + item.dataIndex];
|
577
|
+
contentTitle = value;
|
578
|
+
}
|
626
579
|
|
627
|
-
|
628
|
-
|
629
|
-
|
630
|
-
|
580
|
+
infoData.push((0, _extends2["default"])({}, item, {
|
581
|
+
value: value,
|
582
|
+
contentTitle: contentTitle
|
583
|
+
}));
|
631
584
|
|
632
|
-
|
633
|
-
|
585
|
+
case 33:
|
586
|
+
case "end":
|
587
|
+
return _context5.stop();
|
588
|
+
}
|
589
|
+
}, _loop);
|
590
|
+
});
|
591
|
+
_iterator = _createForOfIteratorHelperLoose(col);
|
592
|
+
|
593
|
+
case 11:
|
594
|
+
if ((_step = _iterator()).done) {
|
595
|
+
_context6.next = 15;
|
634
596
|
break;
|
597
|
+
}
|
635
598
|
|
636
|
-
|
637
|
-
settBaseInfoInitLoading(false);
|
638
|
-
setBaseInfo(infoData);
|
599
|
+
return _context6.delegateYield(_loop(), "t0", 13);
|
639
600
|
|
640
|
-
|
641
|
-
|
642
|
-
|
643
|
-
}
|
644
|
-
}
|
645
|
-
}, _callee6);
|
646
|
-
}));
|
647
|
-
return _baseInfoColChange.apply(this, arguments);
|
648
|
-
}
|
601
|
+
case 13:
|
602
|
+
_context6.next = 11;
|
603
|
+
break;
|
649
604
|
|
650
|
-
|
651
|
-
|
652
|
-
|
605
|
+
case 15:
|
606
|
+
settBaseInfoInitLoading(false);
|
607
|
+
setBaseInfo(infoData);
|
653
608
|
|
609
|
+
case 17:
|
610
|
+
case "end":
|
611
|
+
return _context6.stop();
|
612
|
+
}
|
613
|
+
}, _callee5);
|
614
|
+
}))).apply(this, arguments);
|
615
|
+
} // 获取属性信息
|
654
616
|
|
655
|
-
function _getAttribute() {
|
656
|
-
_getAttribute = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee7(id) {
|
657
|
-
var _yield$resourceOvervi, baseInfos, res, _ref4, attributes;
|
658
617
|
|
659
|
-
|
660
|
-
|
661
|
-
|
662
|
-
|
663
|
-
|
664
|
-
|
665
|
-
|
666
|
-
|
618
|
+
function getAttribute(_x7) {
|
619
|
+
return (_getAttribute = _getAttribute || (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee6(id) {
|
620
|
+
var _yield$resourceOvervi2, baseInfos, res, _ref4, attributes;
|
621
|
+
|
622
|
+
return _regenerator["default"].wrap(function _callee6$(_context7) {
|
623
|
+
while (1) switch (_context7.prev = _context7.next) {
|
624
|
+
case 0:
|
625
|
+
if (id) {
|
626
|
+
_context7.next = 2;
|
627
|
+
break;
|
628
|
+
}
|
667
629
|
|
668
|
-
|
630
|
+
return _context7.abrupt("return");
|
669
631
|
|
670
|
-
|
671
|
-
|
672
|
-
|
673
|
-
|
674
|
-
|
632
|
+
case 2:
|
633
|
+
if (!(resourceOverviewProps !== null && resourceOverviewProps !== void 0 && resourceOverviewProps.getData)) {
|
634
|
+
_context7.next = 9;
|
635
|
+
break;
|
636
|
+
}
|
675
637
|
|
676
|
-
|
677
|
-
|
678
|
-
|
679
|
-
|
638
|
+
_context7.next = 5;
|
639
|
+
return resourceOverviewProps === null || resourceOverviewProps === void 0 ? void 0 : resourceOverviewProps.getData({
|
640
|
+
id: id
|
641
|
+
});
|
680
642
|
|
681
|
-
|
682
|
-
|
683
|
-
|
643
|
+
case 5:
|
644
|
+
_yield$resourceOvervi2 = _context7.sent;
|
645
|
+
baseInfos = _yield$resourceOvervi2.baseInfos;
|
684
646
|
|
685
|
-
|
686
|
-
|
687
|
-
|
688
|
-
|
647
|
+
if (!baseInfos) {
|
648
|
+
_context7.next = 9;
|
649
|
+
break;
|
650
|
+
}
|
689
651
|
|
690
|
-
|
691
|
-
|
692
|
-
|
693
|
-
|
694
|
-
|
695
|
-
|
696
|
-
|
697
|
-
|
698
|
-
|
699
|
-
|
700
|
-
|
701
|
-
|
702
|
-
|
703
|
-
|
652
|
+
return _context7.abrupt("return", baseInfos);
|
653
|
+
|
654
|
+
case 9:
|
655
|
+
_context7.next = 11;
|
656
|
+
return _overview["default"].commonQueryCiData({
|
657
|
+
condition: "id('" + id + "')",
|
658
|
+
refAttribute: true,
|
659
|
+
orders: [{
|
660
|
+
name: 'CREATED_TIME',
|
661
|
+
type: 'asc'
|
662
|
+
}],
|
663
|
+
pageIndex: 1,
|
664
|
+
pageSize: 10
|
665
|
+
});
|
704
666
|
|
705
|
-
|
706
|
-
|
707
|
-
|
708
|
-
|
667
|
+
case 11:
|
668
|
+
res = _context7.sent;
|
669
|
+
_ref4 = (res === null || res === void 0 ? void 0 : res.data[0]) || {}, attributes = _ref4.attributes;
|
670
|
+
return _context7.abrupt("return", attributes || {});
|
709
671
|
|
710
|
-
|
711
|
-
|
712
|
-
|
713
|
-
}
|
672
|
+
case 14:
|
673
|
+
case "end":
|
674
|
+
return _context7.stop();
|
714
675
|
}
|
715
|
-
},
|
716
|
-
}));
|
717
|
-
|
718
|
-
}
|
676
|
+
}, _callee6);
|
677
|
+
}))).apply(this, arguments);
|
678
|
+
} // 指标设置改变
|
719
679
|
|
720
|
-
function metricColChange(_x8) {
|
721
|
-
return _metricColChange.apply(this, arguments);
|
722
|
-
}
|
723
680
|
|
724
|
-
function
|
725
|
-
_metricColChange = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function
|
681
|
+
function metricColChange(_x8) {
|
682
|
+
return (_metricColChange = _metricColChange || (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee7(col) {
|
726
683
|
var _col2, _col3;
|
727
684
|
|
728
|
-
var codes, endTime, params,
|
685
|
+
var codes, endTime, params, _ref6, times, metricList, metricLists;
|
729
686
|
|
730
|
-
return _regenerator["default"].wrap(function
|
731
|
-
while (1) {
|
732
|
-
|
733
|
-
|
734
|
-
|
735
|
-
|
736
|
-
|
737
|
-
|
687
|
+
return _regenerator["default"].wrap(function _callee7$(_context8) {
|
688
|
+
while (1) switch (_context8.prev = _context8.next) {
|
689
|
+
case 0:
|
690
|
+
// console.log('metricColChange col', col);
|
691
|
+
col = (_col2 = col) === null || _col2 === void 0 ? void 0 : _col2.filter(function (item) {
|
692
|
+
return !item.hidden;
|
693
|
+
});
|
694
|
+
|
695
|
+
if ((_col3 = col) !== null && _col3 !== void 0 && _col3.length) {
|
696
|
+
_context8.next = 4;
|
697
|
+
break;
|
698
|
+
}
|
699
|
+
|
700
|
+
setMetric([]); // Message.error('指标未设置')
|
701
|
+
|
702
|
+
return _context8.abrupt("return");
|
738
703
|
|
739
|
-
|
740
|
-
|
741
|
-
|
704
|
+
case 4:
|
705
|
+
codes = col.map(function (item) {
|
706
|
+
return item.dataIndex;
|
707
|
+
});
|
708
|
+
endTime = Math.floor(new Date().getTime() / 1000);
|
709
|
+
params = {
|
710
|
+
ciIds: [id],
|
711
|
+
subIds: [id],
|
712
|
+
startTime: endTime - 60 * 60,
|
713
|
+
endTime: endTime,
|
714
|
+
codes: codes
|
715
|
+
};
|
716
|
+
|
717
|
+
if (isAppTopo) {
|
718
|
+
_ref6 = resourceOverviewProps.metricProps || {}, times = _ref6.times;
|
719
|
+
|
720
|
+
if (times !== null && times !== void 0 && times.length) {
|
721
|
+
params.startTime = times[0];
|
722
|
+
params.endTime = times[1];
|
742
723
|
}
|
724
|
+
}
|
743
725
|
|
744
|
-
|
726
|
+
setMetricInitLoading(true);
|
727
|
+
_context8.next = 11;
|
728
|
+
return _overview["default"].getMetricList(params);
|
745
729
|
|
746
|
-
|
730
|
+
case 11:
|
731
|
+
metricList = _context8.sent;
|
732
|
+
metricLists = metricList.concat(getNewMetricList());
|
747
733
|
|
748
|
-
|
749
|
-
|
750
|
-
|
751
|
-
|
752
|
-
|
753
|
-
|
754
|
-
ciIds: [id],
|
755
|
-
subIds: [id],
|
734
|
+
_rlog.rlog.debug('metricColChange', metricLists, monitorMetricModels);
|
735
|
+
|
736
|
+
setMetric(col.map(function (item, key) {
|
737
|
+
return {
|
738
|
+
code: item.dataIndex,
|
739
|
+
chartIndex: key,
|
756
740
|
startTime: endTime - 60 * 60,
|
757
741
|
endTime: endTime,
|
758
|
-
|
742
|
+
metricItem: monitorMetricModels.find(function (m_item) {
|
743
|
+
return m_item.code === item.dataIndex;
|
744
|
+
}),
|
745
|
+
list: metricLists.filter(function (m_item) {
|
746
|
+
return m_item.metricCode === item.dataIndex;
|
747
|
+
})
|
759
748
|
};
|
749
|
+
}));
|
750
|
+
setMetricInitLoading(false);
|
751
|
+
|
752
|
+
if (!isAppTopo) {
|
753
|
+
// 一分钟更新一次指标信息 metricTimer
|
754
|
+
window.topo_overview_metric_timer && clearInterval(window.topo_overview_metric_timer);
|
755
|
+
window.topo_overview_metric_timer = setInterval(function () {
|
756
|
+
metricColChange(col);
|
757
|
+
}, 60000);
|
758
|
+
}
|
760
759
|
|
761
|
-
|
762
|
-
|
763
|
-
|
764
|
-
if (times !== null && times !== void 0 && times.length) {
|
765
|
-
params.startTime = times[0];
|
766
|
-
params.endTime = times[1];
|
767
|
-
}
|
768
|
-
}
|
769
|
-
|
770
|
-
setMetricInitLoading(true);
|
771
|
-
_context8.next = 11;
|
772
|
-
return _overview["default"].getMetricList(params);
|
773
|
-
|
774
|
-
case 11:
|
775
|
-
metricList = _context8.sent;
|
776
|
-
metricLists = metricList.concat(getNewMetricList());
|
777
|
-
|
778
|
-
_rlog.rlog.debug('metricColChange', metricLists, monitorMetricModels);
|
779
|
-
|
780
|
-
setMetric(col.map(function (item, key) {
|
781
|
-
return {
|
782
|
-
code: item.dataIndex,
|
783
|
-
chartIndex: key,
|
784
|
-
startTime: endTime - 60 * 60,
|
785
|
-
endTime: endTime,
|
786
|
-
metricItem: monitorMetricModels.find(function (m_item) {
|
787
|
-
return m_item.code === item.dataIndex;
|
788
|
-
}),
|
789
|
-
list: metricLists.filter(function (m_item) {
|
790
|
-
return m_item.metricCode === item.dataIndex;
|
791
|
-
})
|
792
|
-
};
|
793
|
-
}));
|
794
|
-
setMetricInitLoading(false);
|
795
|
-
|
796
|
-
if (!isAppTopo) {
|
797
|
-
// 一分钟更新一次指标信息 metricTimer
|
798
|
-
window.topo_overview_metric_timer && clearInterval(window.topo_overview_metric_timer);
|
799
|
-
window.topo_overview_metric_timer = setInterval(function () {
|
800
|
-
metricColChange(col);
|
801
|
-
}, 60000);
|
802
|
-
}
|
803
|
-
|
804
|
-
case 17:
|
805
|
-
case "end":
|
806
|
-
return _context8.stop();
|
807
|
-
}
|
760
|
+
case 17:
|
761
|
+
case "end":
|
762
|
+
return _context8.stop();
|
808
763
|
}
|
809
|
-
},
|
810
|
-
}));
|
811
|
-
return _metricColChange.apply(this, arguments);
|
764
|
+
}, _callee7);
|
765
|
+
}))).apply(this, arguments);
|
812
766
|
}
|
813
767
|
|
814
768
|
var getNewMetricList = function getNewMetricList() {
|