@riil-frontend/component-topology 11.0.30 → 11.0.31
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 +2 -4
- package/build/index.js +34 -49
- package/es/components/MultiResourceDrawer/index.js +18 -16
- package/es/components/ResourceList/ResourceSelect.js +50 -48
- package/es/components/ResourceSelectDrawer/ResourceSelectDrawer.js +26 -24
- package/es/components/SingleResourceDrawer/SelectDrawer.js +20 -18
- package/es/core/components/DisplaySettingDrawer/DisplaySettingDrawer.js +25 -23
- package/es/core/components/DisplaySettingDrawer/hooks/useDisplaySetting.js +84 -78
- package/es/core/components/titlebar/widgets/TitleWidget.js +3 -5
- package/es/core/editor/components/BackgroundView/UploadDialog/index.js +17 -15
- package/es/core/editor/components/BackgroundView/index.js +129 -119
- package/es/core/editor/components/CustomIconPlugin/RenameDialog.js +22 -20
- package/es/core/editor/components/CustomIconPlugin/UploadIconDialog.js +33 -31
- package/es/core/editor/components/CustomIconPlugin/utils/svgToShape.js +17 -15
- package/es/core/editor/components/GroupAddResourceDrawerPlugin/GroupAddResourceDrawer.js +9 -7
- package/es/core/editor/components/Sidebar/views/CanvasPanel/hooks/useCanvasThemeConfig.js +41 -37
- package/es/core/editor/components/Toolbar/widgets/BoxBackgroundButton/BoxBackgroundSetting.js +54 -50
- package/es/core/editor/components/Toolbar/widgets/FontColorButton.js +54 -50
- package/es/core/editor/components/Toolbar/widgets/IconSelect/index.module.scss +1 -1
- package/es/core/editor/components/settings/propertyViews/layer/DataTab/DefaultLayerAddResourceDrawer.js +13 -11
- package/es/core/editor/components/settings/propertyViews/node/data/BindResourceDrawer.js +23 -21
- package/es/core/editor/components/settings/propertyViews/node/data/Data.js +17 -15
- package/es/core/editor/components/settings/propertyViews/view/BackgroundSize.js +12 -10
- package/es/core/editor/components/titlebar/TopoEditorTitleBar.js +27 -21
- 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 +10 -8
- package/es/core/editor/store/topoEdit.js +6 -4
- package/es/core/editor/utils/edgeTypeStyleUtil.js +4 -2
- package/es/core/hooks/usePolling.js +121 -117
- package/es/core/hooks/useResourceConfig.js +66 -58
- package/es/core/hooks/useTopoEdit.js +511 -476
- package/es/core/models/Alarm.js +298 -281
- package/es/core/models/AttributeMetricDisplay.js +107 -101
- package/es/core/models/PluginManager.js +3 -4
- package/es/core/models/SelectionModel.js +5 -4
- package/es/core/models/TopoApp.js +240 -205
- package/es/core/models/TopoGraphView.js +21 -18
- package/es/core/models/cache/CiCache.js +27 -28
- package/es/core/models/cache/CiTypeCache.js +41 -37
- package/es/core/models/cache/DictCache.js +35 -33
- package/es/core/models/graph/Background.js +17 -15
- package/es/core/models/plugins/resourceWebControllUrl.js +82 -76
- package/es/core/models/tagstips/ElementTagTipConfig.js +38 -34
- package/es/core/models/topoData.js +70 -68
- package/es/core/models/utils/linkUtils.js +43 -41
- package/es/core/models/utils/nodeNameVisibleUtil.js +4 -4
- package/es/core/services/alarm.js +16 -14
- package/es/core/services/background.js +67 -59
- package/es/core/services/cmdb/metric.js +11 -9
- package/es/core/services/cmdb.js +20 -18
- package/es/core/services/index.js +45 -39
- package/es/core/services/overview.js +151 -131
- package/es/core/services/topo/basic.js +13 -11
- package/es/core/services/topo/tagtip.js +12 -10
- package/es/core/store/models/ciModel.js +62 -58
- package/es/core/store/models/customIcon.js +134 -120
- package/es/core/store/models/displayConfig.js +19 -15
- package/es/core/store/models/selection.js +6 -4
- package/es/core/store/models/topoAlarm.js +145 -162
- package/es/core/store/models/topoBaseInfoOverview.js +6 -4
- package/es/core/store/models/topoBizMod.js +32 -28
- package/es/core/store/models/topoConfig.js +231 -215
- package/es/core/store/models/topoGraphView.js +6 -4
- package/es/core/store/models/topoMod.js +395 -373
- package/es/core/utils/imageUtil.js +20 -18
- package/es/core/utils/saveSerialize.js +11 -9
- package/es/core/viewer/components/plugins/ResourceDetail/components/ClusterMemberTable.js +58 -56
- package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/EventsCard.js +17 -15
- package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/ResourceOverview.js +357 -343
- package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/components/Configurator/index.js +92 -86
- package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/components/LinkTopo/LinkTopoCard.js +41 -39
- package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/components/LinkTopo/services/index.js +205 -189
- package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/hooks/useAlarmAndRiskData.js +109 -107
- package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/hooks/useMetricModels.js +59 -57
- package/es/core/viewer/components/plugins/ResourceDetail/components/WebConsole/WebConsoleForm/hooks/useWebConsole.js +37 -33
- package/es/core/viewer/components/plugins/ResourceDetail/getCiDisplayMetricModels.js +29 -25
- package/es/core/viewer/components/plugins/ResourceDetail/hooks/useUserId.js +36 -32
- package/es/core/viewer/components/plugins/ResourceWebControllUrlSettingDialog.js +19 -17
- package/es/networkTopo/components/Link/hook.js +77 -73
- package/es/networkTopo/components/Link/index.js +94 -86
- package/es/networkTopo/components/Link/setting.js +44 -42
- package/es/networkTopo/getTopoData.js +69 -63
- package/es/networkTopo/hooks/viewer/useRelateTopo.js +32 -30
- package/es/networkTopo/models/LinkDynamicStyleExecutor.js +2 -2
- package/es/networkTopo/models/TopoCenter.js +22 -18
- package/es/networkTopo/services/alert.js +22 -18
- package/es/networkTopo/services/authorization.js +55 -45
- package/es/networkTopo/services/cmdb.js +470 -422
- package/es/networkTopo/services/funcAuth.js +24 -22
- package/es/networkTopo/services/link.js +117 -107
- package/es/networkTopo/services/mdc.js +24 -18
- package/es/networkTopo/services/metric.js +27 -23
- package/es/networkTopo/services/model.js +509 -445
- package/es/networkTopo/services/risk.js +11 -9
- package/es/networkTopo/services/topo/auth.js +33 -27
- package/es/networkTopo/services/topo/basic.js +314 -274
- package/es/networkTopo/services/topo/blacklist.js +24 -20
- package/es/networkTopo/services/topo/ciInfo.js +31 -27
- package/es/networkTopo/services/topo/icon.js +59 -49
- package/es/networkTopo/services/topo/networkLink.js +36 -32
- package/es/networkTopo/services/topo/relation.js +11 -9
- package/es/networkTopo/services/topo/resourceWebUrl.js +42 -36
- package/es/networkTopo/store/functionAuth.js +37 -31
- package/es/networkTopo/store/topoCenter.js +152 -142
- package/es/networkTopo/store/topoLinkMod.js +6 -4
- package/es/networkTopo/store/topoTreeMod.js +182 -170
- package/es/networkTopo/utils/exportData.js +54 -52
- package/lib/components/MultiResourceDrawer/index.js +18 -16
- package/lib/components/ResourceList/ResourceSelect.js +50 -48
- package/lib/components/ResourceSelectDrawer/ResourceSelectDrawer.js +29 -27
- package/lib/components/SingleResourceDrawer/SelectDrawer.js +20 -18
- package/lib/core/components/DisplaySettingDrawer/DisplaySettingDrawer.js +32 -30
- package/lib/core/components/DisplaySettingDrawer/hooks/useDisplaySetting.js +84 -78
- package/lib/core/components/titlebar/widgets/TitleWidget.js +3 -5
- package/lib/core/editor/components/BackgroundView/UploadDialog/index.js +17 -15
- package/lib/core/editor/components/BackgroundView/index.js +128 -118
- package/lib/core/editor/components/CustomIconPlugin/RenameDialog.js +24 -22
- package/lib/core/editor/components/CustomIconPlugin/UploadIconDialog.js +33 -31
- package/lib/core/editor/components/CustomIconPlugin/utils/svgToShape.js +21 -19
- package/lib/core/editor/components/GroupAddResourceDrawerPlugin/GroupAddResourceDrawer.js +10 -8
- package/lib/core/editor/components/Sidebar/views/CanvasPanel/hooks/useCanvasThemeConfig.js +41 -37
- package/lib/core/editor/components/Toolbar/widgets/BoxBackgroundButton/BoxBackgroundSetting.js +54 -50
- package/lib/core/editor/components/Toolbar/widgets/FontColorButton.js +54 -50
- package/lib/core/editor/components/Toolbar/widgets/IconSelect/index.module.scss +1 -1
- package/lib/core/editor/components/settings/propertyViews/layer/DataTab/DefaultLayerAddResourceDrawer.js +14 -12
- package/lib/core/editor/components/settings/propertyViews/node/data/BindResourceDrawer.js +28 -26
- package/lib/core/editor/components/settings/propertyViews/node/data/Data.js +17 -15
- package/lib/core/editor/components/settings/propertyViews/view/BackgroundSize.js +14 -12
- package/lib/core/editor/components/titlebar/TopoEditorTitleBar.js +31 -25
- 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 +10 -8
- package/lib/core/editor/store/topoEdit.js +6 -4
- package/lib/core/editor/utils/edgeTypeStyleUtil.js +4 -2
- package/lib/core/hooks/usePolling.js +120 -116
- package/lib/core/hooks/useResourceConfig.js +66 -58
- package/lib/core/hooks/useTopoEdit.js +503 -468
- package/lib/core/models/Alarm.js +292 -275
- package/lib/core/models/AttributeMetricDisplay.js +110 -104
- package/lib/core/models/PluginManager.js +3 -4
- package/lib/core/models/SelectionModel.js +5 -4
- package/lib/core/models/TopoApp.js +240 -205
- package/lib/core/models/TopoGraphView.js +21 -18
- package/lib/core/models/cache/CiCache.js +32 -33
- package/lib/core/models/cache/CiTypeCache.js +42 -38
- package/lib/core/models/cache/DictCache.js +35 -33
- package/lib/core/models/graph/Background.js +18 -16
- package/lib/core/models/plugins/resourceWebControllUrl.js +80 -74
- package/lib/core/models/tagstips/ElementTagTipConfig.js +38 -34
- package/lib/core/models/topoData.js +71 -69
- package/lib/core/models/utils/linkUtils.js +43 -41
- package/lib/core/models/utils/nodeNameVisibleUtil.js +4 -4
- package/lib/core/services/alarm.js +20 -18
- package/lib/core/services/background.js +78 -70
- package/lib/core/services/cmdb/metric.js +12 -10
- package/lib/core/services/cmdb.js +22 -20
- package/lib/core/services/index.js +51 -45
- package/lib/core/services/overview.js +151 -131
- package/lib/core/services/topo/basic.js +15 -13
- package/lib/core/services/topo/tagtip.js +14 -12
- package/lib/core/store/models/ciModel.js +70 -66
- package/lib/core/store/models/customIcon.js +134 -120
- package/lib/core/store/models/displayConfig.js +19 -15
- package/lib/core/store/models/selection.js +6 -4
- package/lib/core/store/models/topoAlarm.js +145 -163
- package/lib/core/store/models/topoBaseInfoOverview.js +6 -4
- package/lib/core/store/models/topoBizMod.js +38 -34
- package/lib/core/store/models/topoConfig.js +238 -222
- package/lib/core/store/models/topoGraphView.js +6 -4
- package/lib/core/store/models/topoMod.js +397 -375
- package/lib/core/utils/imageUtil.js +24 -22
- package/lib/core/utils/saveSerialize.js +11 -9
- package/lib/core/viewer/components/plugins/ResourceDetail/components/ClusterMemberTable.js +58 -56
- package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/EventsCard.js +17 -15
- package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/ResourceOverview.js +358 -344
- package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/components/Configurator/index.js +92 -86
- package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/components/LinkTopo/LinkTopoCard.js +41 -39
- package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/components/LinkTopo/services/index.js +206 -190
- package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/hooks/useAlarmAndRiskData.js +109 -107
- package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/hooks/useMetricModels.js +59 -57
- package/lib/core/viewer/components/plugins/ResourceDetail/components/WebConsole/WebConsoleForm/hooks/useWebConsole.js +33 -29
- package/lib/core/viewer/components/plugins/ResourceDetail/getCiDisplayMetricModels.js +29 -25
- package/lib/core/viewer/components/plugins/ResourceDetail/hooks/useUserId.js +36 -32
- package/lib/core/viewer/components/plugins/ResourceWebControllUrlSettingDialog.js +20 -18
- package/lib/networkTopo/components/Link/hook.js +77 -73
- package/lib/networkTopo/components/Link/index.js +95 -87
- package/lib/networkTopo/components/Link/setting.js +44 -42
- package/lib/networkTopo/getTopoData.js +69 -63
- package/lib/networkTopo/hooks/viewer/useRelateTopo.js +33 -31
- package/lib/networkTopo/models/LinkDynamicStyleExecutor.js +2 -2
- package/lib/networkTopo/models/TopoCenter.js +22 -18
- package/lib/networkTopo/services/alert.js +22 -18
- package/lib/networkTopo/services/authorization.js +65 -55
- package/lib/networkTopo/services/cmdb.js +470 -422
- package/lib/networkTopo/services/funcAuth.js +26 -24
- package/lib/networkTopo/services/link.js +118 -108
- package/lib/networkTopo/services/mdc.js +27 -21
- package/lib/networkTopo/services/metric.js +31 -27
- package/lib/networkTopo/services/model.js +509 -445
- package/lib/networkTopo/services/risk.js +13 -11
- package/lib/networkTopo/services/topo/auth.js +33 -27
- package/lib/networkTopo/services/topo/basic.js +317 -277
- package/lib/networkTopo/services/topo/blacklist.js +24 -20
- package/lib/networkTopo/services/topo/ciInfo.js +38 -34
- package/lib/networkTopo/services/topo/icon.js +69 -59
- package/lib/networkTopo/services/topo/networkLink.js +36 -32
- package/lib/networkTopo/services/topo/relation.js +13 -11
- package/lib/networkTopo/services/topo/resourceWebUrl.js +50 -44
- package/lib/networkTopo/store/functionAuth.js +37 -31
- package/lib/networkTopo/store/topoCenter.js +152 -142
- package/lib/networkTopo/store/topoLinkMod.js +6 -4
- package/lib/networkTopo/store/topoTreeMod.js +178 -166
- package/lib/networkTopo/utils/exportData.js +61 -59
- 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++) arr2[i] = arr[i]; return arr2; }
|
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';
|
@@ -163,25 +163,27 @@ export default function ResourceOverview(props) {
|
|
163
163
|
var _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
|
-
|
166
|
+
while (1) {
|
167
|
+
switch (_context.prev = _context.next) {
|
168
|
+
case 0:
|
169
|
+
onClose();
|
170
|
+
_context.next = 3;
|
171
|
+
return commonQueryCiData(id);
|
172
|
+
|
173
|
+
case 3:
|
174
|
+
power = _context.sent;
|
175
|
+
|
176
|
+
// console.log(power)
|
177
|
+
if (power.data.length) {
|
178
|
+
window.open("" + window.location.origin + roomLink);
|
179
|
+
} else {
|
180
|
+
_Message.error('无访问权限,请联系管理员');
|
181
|
+
}
|
181
182
|
|
182
|
-
|
183
|
-
|
184
|
-
|
183
|
+
case 5:
|
184
|
+
case "end":
|
185
|
+
return _context.stop();
|
186
|
+
}
|
185
187
|
}
|
186
188
|
}, _callee);
|
187
189
|
}));
|
@@ -252,20 +254,22 @@ export default function ResourceOverview(props) {
|
|
252
254
|
_getDevice = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2() {
|
253
255
|
var list;
|
254
256
|
return _regeneratorRuntime.wrap(function _callee2$(_context2) {
|
255
|
-
while (1)
|
256
|
-
|
257
|
-
|
258
|
-
|
259
|
-
|
260
|
-
|
261
|
-
|
262
|
-
|
263
|
-
|
264
|
-
|
265
|
-
|
266
|
-
|
267
|
-
|
268
|
-
|
257
|
+
while (1) {
|
258
|
+
switch (_context2.prev = _context2.next) {
|
259
|
+
case 0:
|
260
|
+
_context2.next = 2;
|
261
|
+
return service.getDeviceTypeList();
|
262
|
+
|
263
|
+
case 2:
|
264
|
+
list = _context2.sent;
|
265
|
+
setIsDevice(list.some(function (item) {
|
266
|
+
return item.code === ciType;
|
267
|
+
})); // console.log('getDevice', ciType, list);
|
268
|
+
|
269
|
+
case 4:
|
270
|
+
case "end":
|
271
|
+
return _context2.stop();
|
272
|
+
}
|
269
273
|
}
|
270
274
|
}, _callee2);
|
271
275
|
}));
|
@@ -285,39 +289,41 @@ export default function ResourceOverview(props) {
|
|
285
289
|
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;
|
286
290
|
|
287
291
|
return _regeneratorRuntime.wrap(function _callee3$(_context3) {
|
288
|
-
while (1)
|
289
|
-
|
290
|
-
|
291
|
-
|
292
|
+
while (1) {
|
293
|
+
switch (_context3.prev = _context3.next) {
|
294
|
+
case 0:
|
295
|
+
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;
|
296
|
+
address = '';
|
292
297
|
|
293
|
-
|
294
|
-
|
295
|
-
|
296
|
-
|
298
|
+
if (!(owned_computer_room && owned_cabinet)) {
|
299
|
+
_context3.next = 7;
|
300
|
+
break;
|
301
|
+
}
|
297
302
|
|
298
|
-
|
299
|
-
|
303
|
+
_context3.next = 5;
|
304
|
+
return queryCisByIds([owned_computer_room, owned_cabinet]);
|
300
305
|
|
301
|
-
|
302
|
-
|
303
|
-
|
304
|
-
|
305
|
-
|
306
|
-
|
307
|
-
|
306
|
+
case 5:
|
307
|
+
res = _context3.sent;
|
308
|
+
address = (((_res$find = res.find(function (item) {
|
309
|
+
return item.id === owned_computer_room;
|
310
|
+
})) === 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) {
|
311
|
+
return item.id === owned_cabinet;
|
312
|
+
})) === 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) || '');
|
308
313
|
|
309
|
-
|
310
|
-
|
314
|
+
case 7:
|
315
|
+
u = '';
|
311
316
|
|
312
|
-
|
313
|
-
|
314
|
-
|
317
|
+
if (start_u_location || end_u_location) {
|
318
|
+
u = (start_u_location || '') + "-" + (end_u_location || '');
|
319
|
+
}
|
315
320
|
|
316
|
-
|
321
|
+
return _context3.abrupt("return", address || u ? "" + (address || '') + (u ? " " + u : '') : '');
|
317
322
|
|
318
|
-
|
319
|
-
|
320
|
-
|
323
|
+
case 10:
|
324
|
+
case "end":
|
325
|
+
return _context3.stop();
|
326
|
+
}
|
321
327
|
}
|
322
328
|
}, _callee3);
|
323
329
|
}));
|
@@ -385,35 +391,37 @@ export default function ResourceOverview(props) {
|
|
385
391
|
_alarmRiskOperation = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee4(type, params) {
|
386
392
|
var res;
|
387
393
|
return _regeneratorRuntime.wrap(function _callee4$(_context4) {
|
388
|
-
while (1)
|
389
|
-
|
390
|
-
|
391
|
-
|
392
|
-
|
393
|
-
|
394
|
+
while (1) {
|
395
|
+
switch (_context4.prev = _context4.next) {
|
396
|
+
case 0:
|
397
|
+
if (!(type === 'alarm')) {
|
398
|
+
_context4.next = 6;
|
399
|
+
break;
|
400
|
+
}
|
394
401
|
|
395
|
-
|
396
|
-
|
402
|
+
_context4.next = 3;
|
403
|
+
return service.handleAlarm(params);
|
397
404
|
|
398
|
-
|
399
|
-
|
405
|
+
case 3:
|
406
|
+
res = _context4.sent;
|
400
407
|
|
401
|
-
|
408
|
+
_Message.success('受理成功');
|
402
409
|
|
403
|
-
|
404
|
-
|
405
|
-
|
406
|
-
|
407
|
-
|
408
|
-
|
409
|
-
|
410
|
-
|
411
|
-
|
412
|
-
|
410
|
+
refreshAlarmData(id); // if (isAppTopo) {
|
411
|
+
// const {
|
412
|
+
// displayName: ciName,
|
413
|
+
// attributeMap: modelAttributeMap,
|
414
|
+
// domain,
|
415
|
+
// } = topo.ciTyeCache.getCiType(ciType);
|
416
|
+
// initAppTopo(monitorMetricModels, modelAttributeMap, ciName, domain);
|
417
|
+
// } else {
|
418
|
+
// getAlarmRiskData(id);
|
419
|
+
// }
|
413
420
|
|
414
|
-
|
415
|
-
|
416
|
-
|
421
|
+
case 6:
|
422
|
+
case "end":
|
423
|
+
return _context4.stop();
|
424
|
+
}
|
417
425
|
}
|
418
426
|
}, _callee4);
|
419
427
|
}));
|
@@ -433,172 +441,174 @@ export default function ResourceOverview(props) {
|
|
433
441
|
|
434
442
|
|
435
443
|
function _baseInfoColChange() {
|
436
|
-
_baseInfoColChange = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
444
|
+
_baseInfoColChange = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee6(col) {
|
437
445
|
var _col;
|
438
446
|
|
439
|
-
var infoData, attributeMap,
|
440
|
-
|
441
|
-
return _regeneratorRuntime.wrap(function _callee5$(_context6) {
|
442
|
-
while (1) switch (_context6.prev = _context6.next) {
|
443
|
-
case 0:
|
444
|
-
if ((_col = col) !== null && _col !== void 0 && _col.length) {
|
445
|
-
_context6.next = 3;
|
446
|
-
break;
|
447
|
-
}
|
448
|
-
|
449
|
-
setBaseInfo([]);
|
450
|
-
return _context6.abrupt("return");
|
447
|
+
var infoData, attributeMap, _iterator, _step, item, value, contentTitle, _data, _ref3, _ref3$, _item, _attributeMap, object, _object, displayName, attr;
|
451
448
|
|
452
|
-
|
453
|
-
|
454
|
-
|
455
|
-
|
456
|
-
|
457
|
-
|
458
|
-
|
459
|
-
|
460
|
-
// console.log('getAttribute', attributeMap);
|
461
|
-
col = col.filter(function (item) {
|
462
|
-
return !item.hidden;
|
463
|
-
});
|
464
|
-
_loop = /*#__PURE__*/_regeneratorRuntime.mark(function _loop() {
|
465
|
-
var item, value, contentTitle, link, address, owned_computer_room, owned_cabinet, roomLink, node, data, _ref3, _ref3$, _item, _attributeMap, object, _object2, displayName, attr;
|
466
|
-
|
467
|
-
return _regeneratorRuntime.wrap(function _loop$(_context5) {
|
468
|
-
while (1) switch (_context5.prev = _context5.next) {
|
469
|
-
case 0:
|
470
|
-
item = _step.value;
|
471
|
-
value = formatMetric(attributeMap[item.dataIndex], ciTypeMeta.attributeMap[item.dataIndex]);
|
472
|
-
contentTitle = value;
|
473
|
-
_context5.t0 = item.dataIndex;
|
474
|
-
_context5.next = _context5.t0 === 'display_name' ? 6 : _context5.t0 === 'ciName' ? 9 : _context5.t0 === 'res_address' ? 12 : _context5.t0 === 'imageName' ? 19 : 23;
|
475
|
-
break;
|
476
|
-
|
477
|
-
case 6:
|
478
|
-
// 无监控模板不能跳转详情。跳转前需判定资源实例数据属性中是否包含support_templates属性。若不包含,则不能跳转
|
479
|
-
if (attributeMap.support_templates) {
|
480
|
-
link = "/default/pagecenter/resDetail/view/" + id + "?resId=" + id + "&domainCode=" + ciTypeMeta.domain + "&title=" + attributeMap.display_name + "&ciCode=" + ciType; // 资源跳转链接
|
481
|
-
|
482
|
-
value = /*#__PURE__*/React.createElement("span", {
|
483
|
-
onClick: onClose
|
484
|
-
}, /*#__PURE__*/React.createElement(Link, {
|
485
|
-
className: styles.link,
|
486
|
-
disabled: true,
|
487
|
-
title: attributeMap.display_name || '',
|
488
|
-
to: formatUrl(link)
|
489
|
-
}, attributeMap.display_name || '-'));
|
490
|
-
} else {
|
491
|
-
value = attributeMap.display_name || '-';
|
492
|
-
}
|
449
|
+
return _regeneratorRuntime.wrap(function _callee6$(_context6) {
|
450
|
+
while (1) {
|
451
|
+
switch (_context6.prev = _context6.next) {
|
452
|
+
case 0:
|
453
|
+
if ((_col = col) !== null && _col !== void 0 && _col.length) {
|
454
|
+
_context6.next = 3;
|
455
|
+
break;
|
456
|
+
}
|
493
457
|
|
494
|
-
|
495
|
-
|
458
|
+
setBaseInfo([]);
|
459
|
+
return _context6.abrupt("return");
|
496
460
|
|
497
|
-
|
498
|
-
|
499
|
-
|
500
|
-
|
461
|
+
case 3:
|
462
|
+
settBaseInfoInitLoading(true);
|
463
|
+
infoData = [];
|
464
|
+
_context6.next = 7;
|
465
|
+
return getAttribute(id);
|
501
466
|
|
502
|
-
|
503
|
-
|
504
|
-
|
467
|
+
case 7:
|
468
|
+
attributeMap = _context6.sent;
|
469
|
+
// console.log('getAttribute', attributeMap);
|
470
|
+
col = col.filter(function (item) {
|
471
|
+
return !item.hidden;
|
472
|
+
});
|
473
|
+
_iterator = _createForOfIteratorHelperLoose(col);
|
505
474
|
|
506
|
-
|
507
|
-
|
508
|
-
|
475
|
+
case 10:
|
476
|
+
if ((_step = _iterator()).done) {
|
477
|
+
_context6.next = 26;
|
478
|
+
break;
|
479
|
+
}
|
509
480
|
|
510
|
-
|
511
|
-
|
512
|
-
|
513
|
-
|
514
|
-
|
515
|
-
|
481
|
+
item = _step.value;
|
482
|
+
value = formatMetric(attributeMap[item.dataIndex], ciTypeMeta.attributeMap[item.dataIndex]);
|
483
|
+
contentTitle = value;
|
484
|
+
return _context6.delegateYield( /*#__PURE__*/_regeneratorRuntime.mark(function _callee5() {
|
485
|
+
var link, address, owned_computer_room, owned_cabinet, roomLink, node;
|
486
|
+
return _regeneratorRuntime.wrap(function _callee5$(_context5) {
|
487
|
+
while (1) {
|
488
|
+
switch (_context5.prev = _context5.next) {
|
489
|
+
case 0:
|
490
|
+
_context5.t0 = item.dataIndex;
|
491
|
+
_context5.next = _context5.t0 === 'display_name' ? 3 : _context5.t0 === 'ciName' ? 6 : _context5.t0 === 'res_address' ? 9 : _context5.t0 === 'imageName' ? 16 : 20;
|
492
|
+
break;
|
493
|
+
|
494
|
+
case 3:
|
495
|
+
// 无监控模板不能跳转详情。跳转前需判定资源实例数据属性中是否包含support_templates属性。若不包含,则不能跳转
|
496
|
+
if (attributeMap.support_templates) {
|
497
|
+
link = "/default/pagecenter/resDetail/view/" + id + "?resId=" + id + "&domainCode=" + ciTypeMeta.domain + "&title=" + attributeMap.display_name + "&ciCode=" + ciType; // 资源跳转链接
|
498
|
+
|
499
|
+
value = /*#__PURE__*/React.createElement("span", {
|
500
|
+
onClick: onClose
|
501
|
+
}, /*#__PURE__*/React.createElement(Link, {
|
502
|
+
className: styles.link,
|
503
|
+
disabled: true,
|
504
|
+
title: attributeMap.display_name || '',
|
505
|
+
to: formatUrl(link)
|
506
|
+
}, attributeMap.display_name || '-'));
|
507
|
+
} else {
|
508
|
+
value = attributeMap.display_name || '-';
|
516
509
|
}
|
517
|
-
}, /*#__PURE__*/React.createElement("span", {
|
518
|
-
className: styles.link,
|
519
|
-
title: address
|
520
|
-
}, address));
|
521
|
-
} else {
|
522
|
-
value = address;
|
523
|
-
}
|
524
510
|
|
525
|
-
|
526
|
-
|
511
|
+
contentTitle = attributeMap.display_name || '-';
|
512
|
+
return _context5.abrupt("break", 21);
|
513
|
+
|
514
|
+
case 6:
|
515
|
+
value = ciTypeMeta.displayName;
|
516
|
+
contentTitle = value;
|
517
|
+
return _context5.abrupt("break", 21);
|
518
|
+
|
519
|
+
case 9:
|
520
|
+
_context5.next = 11;
|
521
|
+
return getAddressFormat(attributeMap);
|
522
|
+
|
523
|
+
case 11:
|
524
|
+
address = _context5.sent;
|
525
|
+
owned_computer_room = attributeMap.owned_computer_room, owned_cabinet = attributeMap.owned_cabinet; // 跳转3D机房定位设备
|
526
|
+
|
527
|
+
if (owned_computer_room && owned_cabinet) {
|
528
|
+
// /visual/room/index_runtime.html?type=preview&room_id=00000000383e3381&rack_id=11&device_id=122
|
529
|
+
roomLink = "/visual/room/index_runtime.html?type=preview&room_id=" + owned_computer_room + "&rack_id=" + owned_cabinet + "&device_id=" + id;
|
530
|
+
value = /*#__PURE__*/React.createElement("span", {
|
531
|
+
onClick: function onClick() {
|
532
|
+
jump(roomLink, owned_computer_room);
|
533
|
+
}
|
534
|
+
}, /*#__PURE__*/React.createElement("span", {
|
535
|
+
className: styles.link,
|
536
|
+
title: address
|
537
|
+
}, address));
|
538
|
+
} else {
|
539
|
+
value = address;
|
540
|
+
}
|
527
541
|
|
528
|
-
|
529
|
-
|
530
|
-
value = (node === null || node === void 0 ? void 0 : node.a('customName')) || (node === null || node === void 0 ? void 0 : node.a('name')) || '-';
|
531
|
-
contentTitle = value;
|
532
|
-
return _context5.abrupt("break", 24);
|
542
|
+
contentTitle = address;
|
543
|
+
return _context5.abrupt("break", 21);
|
533
544
|
|
534
|
-
|
535
|
-
|
545
|
+
case 16:
|
546
|
+
node = topo.getDataModel().getDataByTag(id);
|
547
|
+
value = (node === null || node === void 0 ? void 0 : node.a('customName')) || (node === null || node === void 0 ? void 0 : node.a('name')) || '-';
|
548
|
+
contentTitle = value;
|
549
|
+
return _context5.abrupt("break", 21);
|
536
550
|
|
537
|
-
|
538
|
-
|
539
|
-
if (attributeMap[item.dataIndex] && attributeMap[item.dataIndex + ".name"]) {
|
540
|
-
value = attributeMap[item.dataIndex + ".name"];
|
541
|
-
contentTitle = value;
|
542
|
-
}
|
551
|
+
case 20:
|
552
|
+
return _context5.abrupt("break", 21);
|
543
553
|
|
544
|
-
|
545
|
-
|
546
|
-
|
547
|
-
})), _ref3$ = _ref3[0], _item = _ref3$ === void 0 ? {} : _ref3$;
|
548
|
-
_attributeMap = _item.attributeMap || {};
|
549
|
-
object = _attributeMap[item.dataIndex + "_object"] || {};
|
550
|
-
|
551
|
-
if (!attributeMap[item.dataIndex + ".name"] && JSON.stringify(object) !== '{}') {
|
552
|
-
_object2 = _extends({}, object), displayName = _object2.displayName;
|
553
|
-
value = displayName || _attributeMap["" + item.dataIndex];
|
554
|
-
contentTitle = value;
|
554
|
+
case 21:
|
555
|
+
case "end":
|
556
|
+
return _context5.stop();
|
555
557
|
}
|
558
|
+
}
|
559
|
+
}, _callee5);
|
560
|
+
})(), "t0", 15);
|
561
|
+
|
562
|
+
case 15:
|
563
|
+
// 拿翻译字段属性数据
|
564
|
+
if (attributeMap[item.dataIndex] && attributeMap[item.dataIndex + ".name"]) {
|
565
|
+
value = attributeMap[item.dataIndex + ".name"];
|
566
|
+
contentTitle = value;
|
567
|
+
}
|
556
568
|
|
557
|
-
|
558
|
-
|
559
|
-
|
560
|
-
|
569
|
+
_data = topo.attributeMetricDisplay.getData() || [];
|
570
|
+
_ref3 = [].concat(_data.filter(function (m) {
|
571
|
+
return m.id === id;
|
572
|
+
})), _ref3$ = _ref3[0], _item = _ref3$ === void 0 ? {} : _ref3$;
|
573
|
+
_attributeMap = _item.attributeMap || {};
|
574
|
+
object = _attributeMap[item.dataIndex + "_object"] || {};
|
575
|
+
|
576
|
+
if (!attributeMap[item.dataIndex + ".name"] && JSON.stringify(object) !== '{}') {
|
577
|
+
_object = _extends({}, object), displayName = _object.displayName;
|
578
|
+
value = displayName || _attributeMap["" + item.dataIndex];
|
579
|
+
contentTitle = value;
|
580
|
+
}
|
561
581
|
|
562
|
-
|
563
|
-
|
564
|
-
|
565
|
-
|
566
|
-
}
|
582
|
+
if (item.dataIndex === 'ipv6_address') {
|
583
|
+
value = _attributeMap["" + item.dataIndex];
|
584
|
+
contentTitle = value;
|
585
|
+
}
|
567
586
|
|
568
|
-
|
569
|
-
|
570
|
-
|
571
|
-
|
587
|
+
if (isAppTopo && (item.dataIndex === 'source_type' || item.dataIndex === 'destination_type')) {
|
588
|
+
attr = topo.ciTyeCache.getCiType(attributeMap["" + item.dataIndex]) || {};
|
589
|
+
value = attr.displayName || attributeMap["" + item.dataIndex];
|
590
|
+
contentTitle = value;
|
591
|
+
}
|
572
592
|
|
573
|
-
|
574
|
-
|
575
|
-
|
576
|
-
|
577
|
-
}, _loop);
|
578
|
-
});
|
579
|
-
_iterator = _createForOfIteratorHelperLoose(col);
|
593
|
+
infoData.push(_extends({}, item, {
|
594
|
+
value: value,
|
595
|
+
contentTitle: contentTitle
|
596
|
+
}));
|
580
597
|
|
581
|
-
|
582
|
-
|
583
|
-
_context6.next = 15;
|
598
|
+
case 24:
|
599
|
+
_context6.next = 10;
|
584
600
|
break;
|
585
|
-
}
|
586
|
-
|
587
|
-
return _context6.delegateYield(_loop(), "t0", 13);
|
588
|
-
|
589
|
-
case 13:
|
590
|
-
_context6.next = 11;
|
591
|
-
break;
|
592
601
|
|
593
|
-
|
594
|
-
|
595
|
-
|
602
|
+
case 26:
|
603
|
+
settBaseInfoInitLoading(false);
|
604
|
+
setBaseInfo(infoData);
|
596
605
|
|
597
|
-
|
598
|
-
|
599
|
-
|
606
|
+
case 28:
|
607
|
+
case "end":
|
608
|
+
return _context6.stop();
|
609
|
+
}
|
600
610
|
}
|
601
|
-
},
|
611
|
+
}, _callee6);
|
602
612
|
}));
|
603
613
|
return _baseInfoColChange.apply(this, arguments);
|
604
614
|
}
|
@@ -609,64 +619,66 @@ export default function ResourceOverview(props) {
|
|
609
619
|
|
610
620
|
|
611
621
|
function _getAttribute() {
|
612
|
-
_getAttribute = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
613
|
-
var _yield$
|
614
|
-
|
615
|
-
return _regeneratorRuntime.wrap(function _callee6$(_context7) {
|
616
|
-
while (1) switch (_context7.prev = _context7.next) {
|
617
|
-
case 0:
|
618
|
-
if (id) {
|
619
|
-
_context7.next = 2;
|
620
|
-
break;
|
621
|
-
}
|
622
|
+
_getAttribute = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee7(id) {
|
623
|
+
var _yield$resourceOvervi, baseInfos, res, _ref4, attributes;
|
622
624
|
|
623
|
-
|
625
|
+
return _regeneratorRuntime.wrap(function _callee7$(_context7) {
|
626
|
+
while (1) {
|
627
|
+
switch (_context7.prev = _context7.next) {
|
628
|
+
case 0:
|
629
|
+
if (id) {
|
630
|
+
_context7.next = 2;
|
631
|
+
break;
|
632
|
+
}
|
624
633
|
|
625
|
-
|
626
|
-
if (!(resourceOverviewProps !== null && resourceOverviewProps !== void 0 && resourceOverviewProps.getData)) {
|
627
|
-
_context7.next = 9;
|
628
|
-
break;
|
629
|
-
}
|
634
|
+
return _context7.abrupt("return");
|
630
635
|
|
631
|
-
|
632
|
-
|
633
|
-
|
634
|
-
|
636
|
+
case 2:
|
637
|
+
if (!(resourceOverviewProps !== null && resourceOverviewProps !== void 0 && resourceOverviewProps.getData)) {
|
638
|
+
_context7.next = 9;
|
639
|
+
break;
|
640
|
+
}
|
635
641
|
|
636
|
-
|
637
|
-
|
638
|
-
|
642
|
+
_context7.next = 5;
|
643
|
+
return resourceOverviewProps === null || resourceOverviewProps === void 0 ? void 0 : resourceOverviewProps.getData({
|
644
|
+
id: id
|
645
|
+
});
|
639
646
|
|
640
|
-
|
641
|
-
|
642
|
-
|
643
|
-
}
|
647
|
+
case 5:
|
648
|
+
_yield$resourceOvervi = _context7.sent;
|
649
|
+
baseInfos = _yield$resourceOvervi.baseInfos;
|
644
650
|
|
645
|
-
|
646
|
-
|
647
|
-
|
648
|
-
|
649
|
-
|
650
|
-
|
651
|
-
|
652
|
-
|
653
|
-
|
654
|
-
|
655
|
-
|
656
|
-
|
657
|
-
|
658
|
-
|
651
|
+
if (!baseInfos) {
|
652
|
+
_context7.next = 9;
|
653
|
+
break;
|
654
|
+
}
|
655
|
+
|
656
|
+
return _context7.abrupt("return", baseInfos);
|
657
|
+
|
658
|
+
case 9:
|
659
|
+
_context7.next = 11;
|
660
|
+
return service.commonQueryCiData({
|
661
|
+
condition: "id('" + id + "')",
|
662
|
+
refAttribute: true,
|
663
|
+
orders: [{
|
664
|
+
name: 'CREATED_TIME',
|
665
|
+
type: 'asc'
|
666
|
+
}],
|
667
|
+
pageIndex: 1,
|
668
|
+
pageSize: 10
|
669
|
+
});
|
659
670
|
|
660
|
-
|
661
|
-
|
662
|
-
|
663
|
-
|
671
|
+
case 11:
|
672
|
+
res = _context7.sent;
|
673
|
+
_ref4 = (res === null || res === void 0 ? void 0 : res.data[0]) || {}, attributes = _ref4.attributes;
|
674
|
+
return _context7.abrupt("return", attributes || {});
|
664
675
|
|
665
|
-
|
666
|
-
|
667
|
-
|
676
|
+
case 14:
|
677
|
+
case "end":
|
678
|
+
return _context7.stop();
|
679
|
+
}
|
668
680
|
}
|
669
|
-
},
|
681
|
+
}, _callee7);
|
670
682
|
}));
|
671
683
|
return _getAttribute.apply(this, arguments);
|
672
684
|
}
|
@@ -676,87 +688,89 @@ export default function ResourceOverview(props) {
|
|
676
688
|
}
|
677
689
|
|
678
690
|
function _metricColChange() {
|
679
|
-
_metricColChange = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
691
|
+
_metricColChange = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee8(col) {
|
680
692
|
var _col2, _col3;
|
681
693
|
|
682
|
-
var codes, endTime, params,
|
683
|
-
|
684
|
-
return _regeneratorRuntime.wrap(function _callee7$(_context8) {
|
685
|
-
while (1) switch (_context8.prev = _context8.next) {
|
686
|
-
case 0:
|
687
|
-
// console.log('metricColChange col', col);
|
688
|
-
col = (_col2 = col) === null || _col2 === void 0 ? void 0 : _col2.filter(function (item) {
|
689
|
-
return !item.hidden;
|
690
|
-
});
|
694
|
+
var codes, endTime, params, _ref5, times, metricList, metricLists;
|
691
695
|
|
692
|
-
|
693
|
-
|
694
|
-
|
695
|
-
|
696
|
+
return _regeneratorRuntime.wrap(function _callee8$(_context8) {
|
697
|
+
while (1) {
|
698
|
+
switch (_context8.prev = _context8.next) {
|
699
|
+
case 0:
|
700
|
+
// console.log('metricColChange col', col);
|
701
|
+
col = (_col2 = col) === null || _col2 === void 0 ? void 0 : _col2.filter(function (item) {
|
702
|
+
return !item.hidden;
|
703
|
+
});
|
696
704
|
|
697
|
-
|
705
|
+
if ((_col3 = col) !== null && _col3 !== void 0 && _col3.length) {
|
706
|
+
_context8.next = 4;
|
707
|
+
break;
|
708
|
+
}
|
698
709
|
|
699
|
-
|
710
|
+
setMetric([]); // Message.error('指标未设置')
|
700
711
|
|
701
|
-
|
702
|
-
codes = col.map(function (item) {
|
703
|
-
return item.dataIndex;
|
704
|
-
});
|
705
|
-
endTime = Math.floor(new Date().getTime() / 1000);
|
706
|
-
params = {
|
707
|
-
ciIds: [id],
|
708
|
-
subIds: [id],
|
709
|
-
startTime: endTime - 60 * 60,
|
710
|
-
endTime: endTime,
|
711
|
-
codes: codes
|
712
|
-
};
|
713
|
-
|
714
|
-
if (isAppTopo) {
|
715
|
-
_ref6 = resourceOverviewProps.metricProps || {}, times = _ref6.times;
|
716
|
-
|
717
|
-
if (times !== null && times !== void 0 && times.length) {
|
718
|
-
params.startTime = times[0];
|
719
|
-
params.endTime = times[1];
|
720
|
-
}
|
721
|
-
}
|
712
|
+
return _context8.abrupt("return");
|
722
713
|
|
723
|
-
|
724
|
-
|
725
|
-
|
726
|
-
|
727
|
-
|
728
|
-
|
729
|
-
|
730
|
-
|
731
|
-
setMetric(col.map(function (item, key) {
|
732
|
-
return {
|
733
|
-
code: item.dataIndex,
|
734
|
-
chartIndex: key,
|
714
|
+
case 4:
|
715
|
+
codes = col.map(function (item) {
|
716
|
+
return item.dataIndex;
|
717
|
+
});
|
718
|
+
endTime = Math.floor(new Date().getTime() / 1000);
|
719
|
+
params = {
|
720
|
+
ciIds: [id],
|
721
|
+
subIds: [id],
|
735
722
|
startTime: endTime - 60 * 60,
|
736
723
|
endTime: endTime,
|
737
|
-
|
738
|
-
return m_item.code === item.dataIndex;
|
739
|
-
}),
|
740
|
-
list: metricLists.filter(function (m_item) {
|
741
|
-
return m_item.metricCode === item.dataIndex;
|
742
|
-
})
|
724
|
+
codes: codes
|
743
725
|
};
|
744
|
-
}));
|
745
|
-
setMetricInitLoading(false);
|
746
|
-
|
747
|
-
if (!isAppTopo) {
|
748
|
-
// 一分钟更新一次指标信息 metricTimer
|
749
|
-
window.topo_overview_metric_timer && clearInterval(window.topo_overview_metric_timer);
|
750
|
-
window.topo_overview_metric_timer = setInterval(function () {
|
751
|
-
metricColChange(col);
|
752
|
-
}, 60000);
|
753
|
-
}
|
754
726
|
|
755
|
-
|
756
|
-
|
757
|
-
|
727
|
+
if (isAppTopo) {
|
728
|
+
_ref5 = resourceOverviewProps.metricProps || {}, times = _ref5.times;
|
729
|
+
|
730
|
+
if (times !== null && times !== void 0 && times.length) {
|
731
|
+
params.startTime = times[0];
|
732
|
+
params.endTime = times[1];
|
733
|
+
}
|
734
|
+
}
|
735
|
+
|
736
|
+
setMetricInitLoading(true);
|
737
|
+
_context8.next = 11;
|
738
|
+
return service.getMetricList(params);
|
739
|
+
|
740
|
+
case 11:
|
741
|
+
metricList = _context8.sent;
|
742
|
+
metricLists = metricList.concat(getNewMetricList());
|
743
|
+
rlog.debug('metricColChange', metricLists, monitorMetricModels);
|
744
|
+
setMetric(col.map(function (item, key) {
|
745
|
+
return {
|
746
|
+
code: item.dataIndex,
|
747
|
+
chartIndex: key,
|
748
|
+
startTime: endTime - 60 * 60,
|
749
|
+
endTime: endTime,
|
750
|
+
metricItem: monitorMetricModels.find(function (m_item) {
|
751
|
+
return m_item.code === item.dataIndex;
|
752
|
+
}),
|
753
|
+
list: metricLists.filter(function (m_item) {
|
754
|
+
return m_item.metricCode === item.dataIndex;
|
755
|
+
})
|
756
|
+
};
|
757
|
+
}));
|
758
|
+
setMetricInitLoading(false);
|
759
|
+
|
760
|
+
if (!isAppTopo) {
|
761
|
+
// 一分钟更新一次指标信息 metricTimer
|
762
|
+
window.topo_overview_metric_timer && clearInterval(window.topo_overview_metric_timer);
|
763
|
+
window.topo_overview_metric_timer = setInterval(function () {
|
764
|
+
metricColChange(col);
|
765
|
+
}, 60000);
|
766
|
+
}
|
767
|
+
|
768
|
+
case 17:
|
769
|
+
case "end":
|
770
|
+
return _context8.stop();
|
771
|
+
}
|
758
772
|
}
|
759
|
-
},
|
773
|
+
}, _callee8);
|
760
774
|
}));
|
761
775
|
return _metricColChange.apply(this, arguments);
|
762
776
|
}
|