@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
@@ -8,7 +8,7 @@ function _createForOfIteratorHelperLoose(o, allowArrayLike) { var it = typeof Sy
|
|
8
8
|
|
9
9
|
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); }
|
10
10
|
|
11
|
-
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++)
|
11
|
+
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; }
|
12
12
|
|
13
13
|
import _regeneratorRuntime from "@babel/runtime/regenerator";
|
14
14
|
import moment from 'moment';
|
@@ -49,7 +49,7 @@ function formatUrl(url) {
|
|
49
49
|
|
50
50
|
|
51
51
|
export default function ResourceOverview(props) {
|
52
|
-
var _viewerProps$resource, _data$attributes;
|
52
|
+
var _viewerProps$resource, _data$attributes, _ref, _getAddressFormat, _alarmRiskOperation, _baseInfoColChange, _getAttribute, _metricColChange;
|
53
53
|
|
54
54
|
var topo = props.topo,
|
55
55
|
id = props.id,
|
@@ -159,39 +159,33 @@ export default function ResourceOverview(props) {
|
|
159
159
|
isAppTopo && resourceOverviewProps.onClose && resourceOverviewProps.onClose();
|
160
160
|
}
|
161
161
|
|
162
|
-
var jump =
|
163
|
-
|
162
|
+
var jump = function jump(_x, _x2) {
|
163
|
+
return (_ref = _ref || _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(roomLink, id) {
|
164
164
|
var power;
|
165
165
|
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
166
|
-
while (1) {
|
167
|
-
|
168
|
-
|
169
|
-
|
170
|
-
|
171
|
-
|
172
|
-
|
173
|
-
|
174
|
-
|
175
|
-
|
176
|
-
|
177
|
-
|
178
|
-
|
179
|
-
|
180
|
-
|
181
|
-
}
|
166
|
+
while (1) switch (_context.prev = _context.next) {
|
167
|
+
case 0:
|
168
|
+
onClose();
|
169
|
+
_context.next = 3;
|
170
|
+
return commonQueryCiData(id);
|
171
|
+
|
172
|
+
case 3:
|
173
|
+
power = _context.sent;
|
174
|
+
|
175
|
+
// console.log(power)
|
176
|
+
if (power.data.length) {
|
177
|
+
window.open("" + window.location.origin + roomLink);
|
178
|
+
} else {
|
179
|
+
_Message.error('无访问权限,请联系管理员');
|
180
|
+
}
|
182
181
|
|
183
|
-
|
184
|
-
|
185
|
-
|
186
|
-
}
|
182
|
+
case 5:
|
183
|
+
case "end":
|
184
|
+
return _context.stop();
|
187
185
|
}
|
188
186
|
}, _callee);
|
189
|
-
}));
|
190
|
-
|
191
|
-
return function jump(_x, _x2) {
|
192
|
-
return _ref.apply(this, arguments);
|
193
|
-
};
|
194
|
-
}(); // 基本信息可选项
|
187
|
+
}))).apply(this, arguments);
|
188
|
+
}; // 基本信息可选项
|
195
189
|
|
196
190
|
|
197
191
|
var baseInfoCol = useMemo(function () {
|
@@ -245,90 +239,78 @@ export default function ResourceOverview(props) {
|
|
245
239
|
})) || [];
|
246
240
|
}, [id, monitorMetricModels, initFlag]);
|
247
241
|
useEffect(function () {
|
242
|
+
var _getDevice;
|
243
|
+
|
248
244
|
// 获取上架设备类型,判断资源是否是上架设备
|
249
245
|
function getDevice() {
|
250
|
-
return _getDevice.
|
251
|
-
}
|
252
|
-
|
253
|
-
function _getDevice() {
|
254
|
-
_getDevice = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2() {
|
246
|
+
return (_getDevice = _getDevice || _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2() {
|
255
247
|
var list;
|
256
248
|
return _regeneratorRuntime.wrap(function _callee2$(_context2) {
|
257
|
-
while (1) {
|
258
|
-
|
259
|
-
|
260
|
-
|
261
|
-
|
262
|
-
|
263
|
-
|
264
|
-
|
265
|
-
|
266
|
-
|
267
|
-
|
268
|
-
|
269
|
-
|
270
|
-
|
271
|
-
return _context2.stop();
|
272
|
-
}
|
249
|
+
while (1) switch (_context2.prev = _context2.next) {
|
250
|
+
case 0:
|
251
|
+
_context2.next = 2;
|
252
|
+
return service.getDeviceTypeList();
|
253
|
+
|
254
|
+
case 2:
|
255
|
+
list = _context2.sent;
|
256
|
+
setIsDevice(list.some(function (item) {
|
257
|
+
return item.code === ciType;
|
258
|
+
})); // console.log('getDevice', ciType, list);
|
259
|
+
|
260
|
+
case 4:
|
261
|
+
case "end":
|
262
|
+
return _context2.stop();
|
273
263
|
}
|
274
264
|
}, _callee2);
|
275
|
-
}));
|
276
|
-
return _getDevice.apply(this, arguments);
|
265
|
+
}))).apply(this, arguments);
|
277
266
|
}
|
278
267
|
|
279
268
|
getDevice();
|
280
269
|
}, [ciType]); // 获取地址信息:机房 机柜 起始U-结束U
|
281
270
|
|
282
271
|
function getAddressFormat(_x3) {
|
283
|
-
return _getAddressFormat.
|
284
|
-
} // 告警table列配置
|
285
|
-
|
286
|
-
|
287
|
-
function _getAddressFormat() {
|
288
|
-
_getAddressFormat = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee3(_ref2) {
|
272
|
+
return (_getAddressFormat = _getAddressFormat || _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee3(_ref2) {
|
289
273
|
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;
|
290
274
|
|
291
275
|
return _regeneratorRuntime.wrap(function _callee3$(_context3) {
|
292
|
-
while (1) {
|
293
|
-
|
294
|
-
|
295
|
-
|
296
|
-
address = '';
|
276
|
+
while (1) switch (_context3.prev = _context3.next) {
|
277
|
+
case 0:
|
278
|
+
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;
|
279
|
+
address = '';
|
297
280
|
|
298
|
-
|
299
|
-
|
300
|
-
|
301
|
-
|
281
|
+
if (!(owned_computer_room && owned_cabinet)) {
|
282
|
+
_context3.next = 7;
|
283
|
+
break;
|
284
|
+
}
|
302
285
|
|
303
|
-
|
304
|
-
|
286
|
+
_context3.next = 5;
|
287
|
+
return queryCisByIds([owned_computer_room, owned_cabinet]);
|
305
288
|
|
306
|
-
|
307
|
-
|
308
|
-
|
309
|
-
|
310
|
-
|
311
|
-
|
312
|
-
|
289
|
+
case 5:
|
290
|
+
res = _context3.sent;
|
291
|
+
address = (((_res$find = res.find(function (item) {
|
292
|
+
return item.id === owned_computer_room;
|
293
|
+
})) === 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) {
|
294
|
+
return item.id === owned_cabinet;
|
295
|
+
})) === 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) || '');
|
313
296
|
|
314
|
-
|
315
|
-
|
297
|
+
case 7:
|
298
|
+
u = '';
|
316
299
|
|
317
|
-
|
318
|
-
|
319
|
-
|
300
|
+
if (start_u_location || end_u_location) {
|
301
|
+
u = (start_u_location || '') + "-" + (end_u_location || '');
|
302
|
+
}
|
320
303
|
|
321
|
-
|
304
|
+
return _context3.abrupt("return", address || u ? "" + (address || '') + (u ? " " + u : '') : '');
|
322
305
|
|
323
|
-
|
324
|
-
|
325
|
-
|
326
|
-
}
|
306
|
+
case 10:
|
307
|
+
case "end":
|
308
|
+
return _context3.stop();
|
327
309
|
}
|
328
310
|
}, _callee3);
|
329
|
-
}));
|
330
|
-
|
331
|
-
|
311
|
+
}))).apply(this, arguments);
|
312
|
+
} // 告警table列配置
|
313
|
+
|
332
314
|
|
333
315
|
var columns = [{
|
334
316
|
title: '描述',
|
@@ -384,48 +366,41 @@ export default function ResourceOverview(props) {
|
|
384
366
|
}]; // 告警/风险 操作 (受理)
|
385
367
|
|
386
368
|
function alarmRiskOperation(_x4, _x5) {
|
387
|
-
return _alarmRiskOperation.
|
388
|
-
}
|
389
|
-
|
390
|
-
function _alarmRiskOperation() {
|
391
|
-
_alarmRiskOperation = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee4(type, params) {
|
369
|
+
return (_alarmRiskOperation = _alarmRiskOperation || _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee4(type, params) {
|
392
370
|
var res;
|
393
371
|
return _regeneratorRuntime.wrap(function _callee4$(_context4) {
|
394
|
-
while (1) {
|
395
|
-
|
396
|
-
|
397
|
-
|
398
|
-
|
399
|
-
|
400
|
-
}
|
372
|
+
while (1) switch (_context4.prev = _context4.next) {
|
373
|
+
case 0:
|
374
|
+
if (!(type === 'alarm')) {
|
375
|
+
_context4.next = 6;
|
376
|
+
break;
|
377
|
+
}
|
401
378
|
|
402
|
-
|
403
|
-
|
379
|
+
_context4.next = 3;
|
380
|
+
return service.handleAlarm(params);
|
404
381
|
|
405
|
-
|
406
|
-
|
382
|
+
case 3:
|
383
|
+
res = _context4.sent;
|
407
384
|
|
408
|
-
|
385
|
+
_Message.success('受理成功');
|
409
386
|
|
410
|
-
|
411
|
-
|
412
|
-
|
413
|
-
|
414
|
-
|
415
|
-
|
416
|
-
|
417
|
-
|
418
|
-
|
419
|
-
|
387
|
+
refreshAlarmData(id); // if (isAppTopo) {
|
388
|
+
// const {
|
389
|
+
// displayName: ciName,
|
390
|
+
// attributeMap: modelAttributeMap,
|
391
|
+
// domain,
|
392
|
+
// } = topo.ciTyeCache.getCiType(ciType);
|
393
|
+
// initAppTopo(monitorMetricModels, modelAttributeMap, ciName, domain);
|
394
|
+
// } else {
|
395
|
+
// getAlarmRiskData(id);
|
396
|
+
// }
|
420
397
|
|
421
|
-
|
422
|
-
|
423
|
-
|
424
|
-
}
|
398
|
+
case 6:
|
399
|
+
case "end":
|
400
|
+
return _context4.stop();
|
425
401
|
}
|
426
402
|
}, _callee4);
|
427
|
-
}));
|
428
|
-
return _alarmRiskOperation.apply(this, arguments);
|
403
|
+
}))).apply(this, arguments);
|
429
404
|
}
|
430
405
|
|
431
406
|
var elementData = {
|
@@ -437,343 +412,322 @@ export default function ResourceOverview(props) {
|
|
437
412
|
}; // 基本信息设置改变
|
438
413
|
|
439
414
|
function baseInfoColChange(_x6) {
|
440
|
-
return _baseInfoColChange.
|
441
|
-
|
415
|
+
return (_baseInfoColChange = _baseInfoColChange || _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee5(col) {
|
416
|
+
var _col;
|
442
417
|
|
418
|
+
var infoData, attributeMap, _loop, _iterator, _step;
|
443
419
|
|
444
|
-
|
445
|
-
|
446
|
-
|
420
|
+
return _regeneratorRuntime.wrap(function _callee5$(_context6) {
|
421
|
+
while (1) switch (_context6.prev = _context6.next) {
|
422
|
+
case 0:
|
423
|
+
if ((_col = col) !== null && _col !== void 0 && _col.length) {
|
424
|
+
_context6.next = 3;
|
425
|
+
break;
|
426
|
+
}
|
447
427
|
|
448
|
-
|
428
|
+
setBaseInfo([]);
|
429
|
+
return _context6.abrupt("return");
|
449
430
|
|
450
|
-
|
451
|
-
|
452
|
-
|
453
|
-
|
454
|
-
|
455
|
-
_context6.next = 3;
|
456
|
-
break;
|
457
|
-
}
|
431
|
+
case 3:
|
432
|
+
settBaseInfoInitLoading(true);
|
433
|
+
infoData = [];
|
434
|
+
_context6.next = 7;
|
435
|
+
return getAttribute(id);
|
458
436
|
|
459
|
-
|
460
|
-
|
437
|
+
case 7:
|
438
|
+
attributeMap = _context6.sent;
|
439
|
+
// console.log('getAttribute', attributeMap);
|
440
|
+
col = col.filter(function (item) {
|
441
|
+
return !item.hidden;
|
442
|
+
});
|
443
|
+
_loop = /*#__PURE__*/_regeneratorRuntime.mark(function _loop() {
|
444
|
+
var item, value, contentTitle, link, address, owned_computer_room, owned_cabinet, roomLink, node, data, _ref3, _ref3$, _item, _attributeMap, object, _object2, displayName, attr;
|
445
|
+
|
446
|
+
return _regeneratorRuntime.wrap(function _loop$(_context5) {
|
447
|
+
while (1) switch (_context5.prev = _context5.next) {
|
448
|
+
case 0:
|
449
|
+
item = _step.value;
|
450
|
+
value = formatMetric(attributeMap[item.dataIndex], ciTypeMeta.attributeMap[item.dataIndex]);
|
451
|
+
contentTitle = value;
|
452
|
+
_context5.t0 = item.dataIndex;
|
453
|
+
_context5.next = _context5.t0 === 'display_name' ? 6 : _context5.t0 === 'ciName' ? 9 : _context5.t0 === 'res_address' ? 12 : _context5.t0 === 'imageName' ? 19 : 23;
|
454
|
+
break;
|
455
|
+
|
456
|
+
case 6:
|
457
|
+
// 无监控模板不能跳转详情。跳转前需判定资源实例数据属性中是否包含support_templates属性。若不包含,则不能跳转
|
458
|
+
if (attributeMap.support_templates) {
|
459
|
+
link = "/default/pagecenter/resDetail/view/" + id + "?resId=" + id + "&domainCode=" + ciTypeMeta.domain + "&title=" + attributeMap.display_name + "&ciCode=" + ciType; // 资源跳转链接
|
460
|
+
|
461
|
+
value = /*#__PURE__*/React.createElement("span", {
|
462
|
+
onClick: onClose
|
463
|
+
}, /*#__PURE__*/React.createElement(Link, {
|
464
|
+
className: styles.link,
|
465
|
+
disabled: true,
|
466
|
+
title: attributeMap.display_name || '',
|
467
|
+
to: formatUrl(link)
|
468
|
+
}, attributeMap.display_name || '-'));
|
469
|
+
} else {
|
470
|
+
value = attributeMap.display_name || '-';
|
471
|
+
}
|
461
472
|
|
462
|
-
|
463
|
-
|
464
|
-
infoData = [];
|
465
|
-
_context6.next = 7;
|
466
|
-
return getAttribute(id);
|
473
|
+
contentTitle = attributeMap.display_name || '-';
|
474
|
+
return _context5.abrupt("break", 24);
|
467
475
|
|
468
|
-
|
469
|
-
|
470
|
-
|
471
|
-
|
472
|
-
return !item.hidden;
|
473
|
-
});
|
474
|
-
_iterator = _createForOfIteratorHelperLoose(col);
|
476
|
+
case 9:
|
477
|
+
value = ciTypeMeta.displayName;
|
478
|
+
contentTitle = value;
|
479
|
+
return _context5.abrupt("break", 24);
|
475
480
|
|
476
|
-
|
477
|
-
|
478
|
-
|
479
|
-
break;
|
480
|
-
}
|
481
|
+
case 12:
|
482
|
+
_context5.next = 14;
|
483
|
+
return getAddressFormat(attributeMap);
|
481
484
|
|
482
|
-
|
483
|
-
|
484
|
-
|
485
|
-
return _context6.delegateYield( /*#__PURE__*/_regeneratorRuntime.mark(function _callee5() {
|
486
|
-
var link, address, owned_computer_room, owned_cabinet, roomLink, node;
|
487
|
-
return _regeneratorRuntime.wrap(function _callee5$(_context5) {
|
488
|
-
while (1) {
|
489
|
-
switch (_context5.prev = _context5.next) {
|
490
|
-
case 0:
|
491
|
-
_context5.t0 = item.dataIndex;
|
492
|
-
_context5.next = _context5.t0 === 'display_name' ? 3 : _context5.t0 === 'ciName' ? 6 : _context5.t0 === 'res_address' ? 9 : _context5.t0 === 'imageName' ? 16 : 20;
|
493
|
-
break;
|
494
|
-
|
495
|
-
case 3:
|
496
|
-
// 无监控模板不能跳转详情。跳转前需判定资源实例数据属性中是否包含support_templates属性。若不包含,则不能跳转
|
497
|
-
if (attributeMap.support_templates) {
|
498
|
-
link = "/default/pagecenter/resDetail/view/" + id + "?resId=" + id + "&domainCode=" + ciTypeMeta.domain + "&title=" + attributeMap.display_name + "&ciCode=" + ciType; // 资源跳转链接
|
499
|
-
|
500
|
-
value = /*#__PURE__*/React.createElement("span", {
|
501
|
-
onClick: onClose
|
502
|
-
}, /*#__PURE__*/React.createElement(Link, {
|
503
|
-
className: styles.link,
|
504
|
-
disabled: true,
|
505
|
-
title: attributeMap.display_name || '',
|
506
|
-
to: formatUrl(link)
|
507
|
-
}, attributeMap.display_name || '-'));
|
508
|
-
} else {
|
509
|
-
value = attributeMap.display_name || '-';
|
510
|
-
}
|
485
|
+
case 14:
|
486
|
+
address = _context5.sent;
|
487
|
+
owned_computer_room = attributeMap.owned_computer_room, owned_cabinet = attributeMap.owned_cabinet; // 跳转3D机房定位设备
|
511
488
|
|
512
|
-
|
513
|
-
|
514
|
-
|
515
|
-
|
516
|
-
|
517
|
-
|
518
|
-
return _context5.abrupt("break", 21);
|
519
|
-
|
520
|
-
case 9:
|
521
|
-
_context5.next = 11;
|
522
|
-
return getAddressFormat(attributeMap);
|
523
|
-
|
524
|
-
case 11:
|
525
|
-
address = _context5.sent;
|
526
|
-
owned_computer_room = attributeMap.owned_computer_room, owned_cabinet = attributeMap.owned_cabinet; // 跳转3D机房定位设备
|
527
|
-
|
528
|
-
if (owned_computer_room && owned_cabinet) {
|
529
|
-
// /visual/room/index_runtime.html?type=preview&room_id=00000000383e3381&rack_id=11&device_id=122
|
530
|
-
roomLink = "/visual/room/index_runtime.html?type=preview&room_id=" + owned_computer_room + "&rack_id=" + owned_cabinet + "&device_id=" + id;
|
531
|
-
value = /*#__PURE__*/React.createElement("span", {
|
532
|
-
onClick: function onClick() {
|
533
|
-
jump(roomLink, owned_computer_room);
|
534
|
-
}
|
535
|
-
}, /*#__PURE__*/React.createElement("span", {
|
536
|
-
className: styles.link,
|
537
|
-
title: address
|
538
|
-
}, address));
|
539
|
-
} else {
|
540
|
-
value = address;
|
489
|
+
if (owned_computer_room && owned_cabinet) {
|
490
|
+
// /visual/room/index_runtime.html?type=preview&room_id=00000000383e3381&rack_id=11&device_id=122
|
491
|
+
roomLink = "/visual/room/index_runtime.html?type=preview&room_id=" + owned_computer_room + "&rack_id=" + owned_cabinet + "&device_id=" + id;
|
492
|
+
value = /*#__PURE__*/React.createElement("span", {
|
493
|
+
onClick: function onClick() {
|
494
|
+
jump(roomLink, owned_computer_room);
|
541
495
|
}
|
496
|
+
}, /*#__PURE__*/React.createElement("span", {
|
497
|
+
className: styles.link,
|
498
|
+
title: address
|
499
|
+
}, address));
|
500
|
+
} else {
|
501
|
+
value = address;
|
502
|
+
}
|
542
503
|
|
543
|
-
|
544
|
-
|
504
|
+
contentTitle = address;
|
505
|
+
return _context5.abrupt("break", 24);
|
545
506
|
|
546
|
-
|
547
|
-
|
548
|
-
|
549
|
-
|
550
|
-
|
507
|
+
case 19:
|
508
|
+
node = topo.getDataModel().getDataByTag(id);
|
509
|
+
value = (node === null || node === void 0 ? void 0 : node.a('customName')) || (node === null || node === void 0 ? void 0 : node.a('name')) || '-';
|
510
|
+
contentTitle = value;
|
511
|
+
return _context5.abrupt("break", 24);
|
551
512
|
|
552
|
-
|
553
|
-
|
513
|
+
case 23:
|
514
|
+
return _context5.abrupt("break", 24);
|
554
515
|
|
555
|
-
|
556
|
-
|
557
|
-
|
516
|
+
case 24:
|
517
|
+
// 拿翻译字段属性数据
|
518
|
+
if (attributeMap[item.dataIndex] && attributeMap[item.dataIndex + ".name"]) {
|
519
|
+
value = attributeMap[item.dataIndex + ".name"];
|
520
|
+
contentTitle = value;
|
558
521
|
}
|
559
|
-
}
|
560
|
-
}, _callee5);
|
561
|
-
})(), "t0", 15);
|
562
|
-
|
563
|
-
case 15:
|
564
|
-
// 拿翻译字段属性数据
|
565
|
-
if (attributeMap[item.dataIndex] && attributeMap[item.dataIndex + ".name"]) {
|
566
|
-
value = attributeMap[item.dataIndex + ".name"];
|
567
|
-
contentTitle = value;
|
568
|
-
}
|
569
522
|
|
570
|
-
|
571
|
-
|
572
|
-
|
573
|
-
|
574
|
-
|
575
|
-
|
576
|
-
|
577
|
-
|
578
|
-
|
579
|
-
|
580
|
-
|
581
|
-
|
523
|
+
data = topo.attributeMetricDisplay.getData() || [];
|
524
|
+
_ref3 = [].concat(data.filter(function (m) {
|
525
|
+
return m.id === id;
|
526
|
+
})), _ref3$ = _ref3[0], _item = _ref3$ === void 0 ? {} : _ref3$;
|
527
|
+
_attributeMap = _item.attributeMap || {};
|
528
|
+
object = _attributeMap[item.dataIndex + "_object"] || {};
|
529
|
+
|
530
|
+
if (!attributeMap[item.dataIndex + ".name"] && JSON.stringify(object) !== '{}') {
|
531
|
+
_object2 = _extends({}, object), displayName = _object2.displayName;
|
532
|
+
value = displayName || _attributeMap["" + item.dataIndex];
|
533
|
+
contentTitle = value;
|
534
|
+
}
|
582
535
|
|
583
|
-
|
584
|
-
|
585
|
-
|
586
|
-
|
536
|
+
if (item.dataIndex === 'ipv6_address') {
|
537
|
+
value = _attributeMap["" + item.dataIndex];
|
538
|
+
contentTitle = value;
|
539
|
+
}
|
587
540
|
|
588
|
-
|
589
|
-
|
590
|
-
|
591
|
-
|
592
|
-
|
541
|
+
if (isAppTopo && (item.dataIndex === 'source_type' || item.dataIndex === 'destination_type')) {
|
542
|
+
attr = topo.ciTyeCache.getCiType(attributeMap["" + item.dataIndex]) || {};
|
543
|
+
value = attr.displayName || attributeMap["" + item.dataIndex];
|
544
|
+
contentTitle = value;
|
545
|
+
}
|
593
546
|
|
594
|
-
|
595
|
-
|
596
|
-
|
597
|
-
|
547
|
+
infoData.push(_extends({}, item, {
|
548
|
+
value: value,
|
549
|
+
contentTitle: contentTitle
|
550
|
+
}));
|
598
551
|
|
599
|
-
|
600
|
-
|
552
|
+
case 33:
|
553
|
+
case "end":
|
554
|
+
return _context5.stop();
|
555
|
+
}
|
556
|
+
}, _loop);
|
557
|
+
});
|
558
|
+
_iterator = _createForOfIteratorHelperLoose(col);
|
559
|
+
|
560
|
+
case 11:
|
561
|
+
if ((_step = _iterator()).done) {
|
562
|
+
_context6.next = 15;
|
601
563
|
break;
|
564
|
+
}
|
602
565
|
|
603
|
-
|
604
|
-
settBaseInfoInitLoading(false);
|
605
|
-
setBaseInfo(infoData);
|
566
|
+
return _context6.delegateYield(_loop(), "t0", 13);
|
606
567
|
|
607
|
-
|
608
|
-
|
609
|
-
|
610
|
-
}
|
611
|
-
}
|
612
|
-
}, _callee6);
|
613
|
-
}));
|
614
|
-
return _baseInfoColChange.apply(this, arguments);
|
615
|
-
}
|
568
|
+
case 13:
|
569
|
+
_context6.next = 11;
|
570
|
+
break;
|
616
571
|
|
617
|
-
|
618
|
-
|
619
|
-
|
572
|
+
case 15:
|
573
|
+
settBaseInfoInitLoading(false);
|
574
|
+
setBaseInfo(infoData);
|
620
575
|
|
576
|
+
case 17:
|
577
|
+
case "end":
|
578
|
+
return _context6.stop();
|
579
|
+
}
|
580
|
+
}, _callee5);
|
581
|
+
}))).apply(this, arguments);
|
582
|
+
} // 获取属性信息
|
621
583
|
|
622
|
-
function _getAttribute() {
|
623
|
-
_getAttribute = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee7(id) {
|
624
|
-
var _yield$resourceOvervi, baseInfos, res, _ref4, attributes;
|
625
584
|
|
626
|
-
|
627
|
-
|
628
|
-
|
629
|
-
|
630
|
-
|
631
|
-
|
632
|
-
|
633
|
-
|
585
|
+
function getAttribute(_x7) {
|
586
|
+
return (_getAttribute = _getAttribute || _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee6(id) {
|
587
|
+
var _yield$resourceOvervi2, baseInfos, res, _ref4, attributes;
|
588
|
+
|
589
|
+
return _regeneratorRuntime.wrap(function _callee6$(_context7) {
|
590
|
+
while (1) switch (_context7.prev = _context7.next) {
|
591
|
+
case 0:
|
592
|
+
if (id) {
|
593
|
+
_context7.next = 2;
|
594
|
+
break;
|
595
|
+
}
|
634
596
|
|
635
|
-
|
597
|
+
return _context7.abrupt("return");
|
636
598
|
|
637
|
-
|
638
|
-
|
639
|
-
|
640
|
-
|
641
|
-
|
599
|
+
case 2:
|
600
|
+
if (!(resourceOverviewProps !== null && resourceOverviewProps !== void 0 && resourceOverviewProps.getData)) {
|
601
|
+
_context7.next = 9;
|
602
|
+
break;
|
603
|
+
}
|
642
604
|
|
643
|
-
|
644
|
-
|
645
|
-
|
646
|
-
|
605
|
+
_context7.next = 5;
|
606
|
+
return resourceOverviewProps === null || resourceOverviewProps === void 0 ? void 0 : resourceOverviewProps.getData({
|
607
|
+
id: id
|
608
|
+
});
|
647
609
|
|
648
|
-
|
649
|
-
|
650
|
-
|
610
|
+
case 5:
|
611
|
+
_yield$resourceOvervi2 = _context7.sent;
|
612
|
+
baseInfos = _yield$resourceOvervi2.baseInfos;
|
651
613
|
|
652
|
-
|
653
|
-
|
654
|
-
|
655
|
-
|
614
|
+
if (!baseInfos) {
|
615
|
+
_context7.next = 9;
|
616
|
+
break;
|
617
|
+
}
|
656
618
|
|
657
|
-
|
658
|
-
|
659
|
-
|
660
|
-
|
661
|
-
|
662
|
-
|
663
|
-
|
664
|
-
|
665
|
-
|
666
|
-
|
667
|
-
|
668
|
-
|
669
|
-
|
670
|
-
|
619
|
+
return _context7.abrupt("return", baseInfos);
|
620
|
+
|
621
|
+
case 9:
|
622
|
+
_context7.next = 11;
|
623
|
+
return service.commonQueryCiData({
|
624
|
+
condition: "id('" + id + "')",
|
625
|
+
refAttribute: true,
|
626
|
+
orders: [{
|
627
|
+
name: 'CREATED_TIME',
|
628
|
+
type: 'asc'
|
629
|
+
}],
|
630
|
+
pageIndex: 1,
|
631
|
+
pageSize: 10
|
632
|
+
});
|
671
633
|
|
672
|
-
|
673
|
-
|
674
|
-
|
675
|
-
|
634
|
+
case 11:
|
635
|
+
res = _context7.sent;
|
636
|
+
_ref4 = (res === null || res === void 0 ? void 0 : res.data[0]) || {}, attributes = _ref4.attributes;
|
637
|
+
return _context7.abrupt("return", attributes || {});
|
676
638
|
|
677
|
-
|
678
|
-
|
679
|
-
|
680
|
-
}
|
639
|
+
case 14:
|
640
|
+
case "end":
|
641
|
+
return _context7.stop();
|
681
642
|
}
|
682
|
-
},
|
683
|
-
}));
|
684
|
-
|
685
|
-
}
|
643
|
+
}, _callee6);
|
644
|
+
}))).apply(this, arguments);
|
645
|
+
} // 指标设置改变
|
686
646
|
|
687
|
-
function metricColChange(_x8) {
|
688
|
-
return _metricColChange.apply(this, arguments);
|
689
|
-
}
|
690
647
|
|
691
|
-
function
|
692
|
-
_metricColChange = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
648
|
+
function metricColChange(_x8) {
|
649
|
+
return (_metricColChange = _metricColChange || _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee7(col) {
|
693
650
|
var _col2, _col3;
|
694
651
|
|
695
|
-
var codes, endTime, params,
|
652
|
+
var codes, endTime, params, _ref6, times, metricList, metricLists;
|
696
653
|
|
697
|
-
return _regeneratorRuntime.wrap(function
|
698
|
-
while (1) {
|
699
|
-
|
700
|
-
|
701
|
-
|
702
|
-
|
703
|
-
|
704
|
-
});
|
654
|
+
return _regeneratorRuntime.wrap(function _callee7$(_context8) {
|
655
|
+
while (1) switch (_context8.prev = _context8.next) {
|
656
|
+
case 0:
|
657
|
+
// console.log('metricColChange col', col);
|
658
|
+
col = (_col2 = col) === null || _col2 === void 0 ? void 0 : _col2.filter(function (item) {
|
659
|
+
return !item.hidden;
|
660
|
+
});
|
705
661
|
|
706
|
-
|
707
|
-
|
708
|
-
|
709
|
-
|
662
|
+
if ((_col3 = col) !== null && _col3 !== void 0 && _col3.length) {
|
663
|
+
_context8.next = 4;
|
664
|
+
break;
|
665
|
+
}
|
710
666
|
|
711
|
-
|
667
|
+
setMetric([]); // Message.error('指标未设置')
|
712
668
|
|
713
|
-
|
669
|
+
return _context8.abrupt("return");
|
714
670
|
|
715
|
-
|
716
|
-
|
717
|
-
|
718
|
-
|
719
|
-
|
720
|
-
|
721
|
-
|
722
|
-
|
671
|
+
case 4:
|
672
|
+
codes = col.map(function (item) {
|
673
|
+
return item.dataIndex;
|
674
|
+
});
|
675
|
+
endTime = Math.floor(new Date().getTime() / 1000);
|
676
|
+
params = {
|
677
|
+
ciIds: [id],
|
678
|
+
subIds: [id],
|
679
|
+
startTime: endTime - 60 * 60,
|
680
|
+
endTime: endTime,
|
681
|
+
codes: codes
|
682
|
+
};
|
683
|
+
|
684
|
+
if (isAppTopo) {
|
685
|
+
_ref6 = resourceOverviewProps.metricProps || {}, times = _ref6.times;
|
686
|
+
|
687
|
+
if (times !== null && times !== void 0 && times.length) {
|
688
|
+
params.startTime = times[0];
|
689
|
+
params.endTime = times[1];
|
690
|
+
}
|
691
|
+
}
|
692
|
+
|
693
|
+
setMetricInitLoading(true);
|
694
|
+
_context8.next = 11;
|
695
|
+
return service.getMetricList(params);
|
696
|
+
|
697
|
+
case 11:
|
698
|
+
metricList = _context8.sent;
|
699
|
+
metricLists = metricList.concat(getNewMetricList());
|
700
|
+
rlog.debug('metricColChange', metricLists, monitorMetricModels);
|
701
|
+
setMetric(col.map(function (item, key) {
|
702
|
+
return {
|
703
|
+
code: item.dataIndex,
|
704
|
+
chartIndex: key,
|
723
705
|
startTime: endTime - 60 * 60,
|
724
706
|
endTime: endTime,
|
725
|
-
|
707
|
+
metricItem: monitorMetricModels.find(function (m_item) {
|
708
|
+
return m_item.code === item.dataIndex;
|
709
|
+
}),
|
710
|
+
list: metricLists.filter(function (m_item) {
|
711
|
+
return m_item.metricCode === item.dataIndex;
|
712
|
+
})
|
726
713
|
};
|
714
|
+
}));
|
715
|
+
setMetricInitLoading(false);
|
716
|
+
|
717
|
+
if (!isAppTopo) {
|
718
|
+
// 一分钟更新一次指标信息 metricTimer
|
719
|
+
window.topo_overview_metric_timer && clearInterval(window.topo_overview_metric_timer);
|
720
|
+
window.topo_overview_metric_timer = setInterval(function () {
|
721
|
+
metricColChange(col);
|
722
|
+
}, 60000);
|
723
|
+
}
|
727
724
|
|
728
|
-
|
729
|
-
|
730
|
-
|
731
|
-
if (times !== null && times !== void 0 && times.length) {
|
732
|
-
params.startTime = times[0];
|
733
|
-
params.endTime = times[1];
|
734
|
-
}
|
735
|
-
}
|
736
|
-
|
737
|
-
setMetricInitLoading(true);
|
738
|
-
_context8.next = 11;
|
739
|
-
return service.getMetricList(params);
|
740
|
-
|
741
|
-
case 11:
|
742
|
-
metricList = _context8.sent;
|
743
|
-
metricLists = metricList.concat(getNewMetricList());
|
744
|
-
rlog.debug('metricColChange', metricLists, monitorMetricModels);
|
745
|
-
setMetric(col.map(function (item, key) {
|
746
|
-
return {
|
747
|
-
code: item.dataIndex,
|
748
|
-
chartIndex: key,
|
749
|
-
startTime: endTime - 60 * 60,
|
750
|
-
endTime: endTime,
|
751
|
-
metricItem: monitorMetricModels.find(function (m_item) {
|
752
|
-
return m_item.code === item.dataIndex;
|
753
|
-
}),
|
754
|
-
list: metricLists.filter(function (m_item) {
|
755
|
-
return m_item.metricCode === item.dataIndex;
|
756
|
-
})
|
757
|
-
};
|
758
|
-
}));
|
759
|
-
setMetricInitLoading(false);
|
760
|
-
|
761
|
-
if (!isAppTopo) {
|
762
|
-
// 一分钟更新一次指标信息 metricTimer
|
763
|
-
window.topo_overview_metric_timer && clearInterval(window.topo_overview_metric_timer);
|
764
|
-
window.topo_overview_metric_timer = setInterval(function () {
|
765
|
-
metricColChange(col);
|
766
|
-
}, 60000);
|
767
|
-
}
|
768
|
-
|
769
|
-
case 17:
|
770
|
-
case "end":
|
771
|
-
return _context8.stop();
|
772
|
-
}
|
725
|
+
case 17:
|
726
|
+
case "end":
|
727
|
+
return _context8.stop();
|
773
728
|
}
|
774
|
-
},
|
775
|
-
}));
|
776
|
-
return _metricColChange.apply(this, arguments);
|
729
|
+
}, _callee7);
|
730
|
+
}))).apply(this, arguments);
|
777
731
|
}
|
778
732
|
|
779
733
|
var getNewMetricList = function getNewMetricList() {
|