@riil-frontend/component-topology 12.0.0-dev.8 → 12.1.0-dev.1
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 +1 -1
- package/build/index.css +1 -1
- package/build/index.js +14 -14
- package/es/components/TemplateButton/index.module.scss +1 -1
- package/es/core/components/AlarmListPanel/components/AlarmListItem.js +58 -3
- package/es/core/components/TopoView/topoView.js +5 -1
- package/es/core/editor/components/Toolbar/widgets/EdgeColorButton/EdgeColorButton.js +5 -12
- package/es/core/editor/components/Toolbar/widgets/EdgeTypeButton/EdgeType.js +27 -10
- package/es/core/editor/components/Toolbar/widgets/EdgeTypeButton/EdgeType.module.scss +21 -1
- package/es/core/editor/components/Toolbar/widgets/EdgeTypeButton/LineType.js +9 -0
- package/es/core/editor/components/Toolbar/widgets/EdgeTypeButton/index.js +2 -2
- package/es/core/editor/components/Toolbar/widgets/Layout/index.js +16 -2
- package/es/core/editor/hooks/useKeyboardShortcut.js +3 -1
- package/es/core/editor/utils/copyElementUtil.js +12 -0
- package/es/core/editor/utils/edgeTypeStyleUtil.js +8 -30
- package/es/core/hooks/useAlarm.js +131 -81
- package/es/core/hooks/useCmpLinkAlarm.js +153 -0
- package/es/core/hooks/useEventData.js +1 -2
- package/es/core/hooks/useGraphAlarmDisplay.js +91 -56
- package/es/core/hooks/useResourceConfig.js +1 -3
- package/es/core/hooks/useTopoEdit.js +51 -58
- package/es/core/models/Alarm.js +69 -142
- package/es/core/models/AttributeMetricDisplay.js +14 -5
- package/es/core/models/TopoApp.js +1 -1
- package/es/core/models/cache/CiCache.d.ts +1 -1
- package/es/core/models/cache/CiCache.js +3 -3
- package/es/core/models/cache/CiTypeCache.js +4 -0
- package/es/core/models/topoData.js +0 -1
- package/es/core/models/utils/linkUtils.js +20 -13
- package/es/core/services/index.js +1 -1
- package/es/core/services/topo/basic.js +2 -2
- package/es/core/store/models/topoConfig.js +7 -10
- package/es/core/store/models/topoMod.js +81 -134
- package/es/core/utils/edgeUtil.js +8 -0
- package/es/core/utils/metricUtil.js +8 -4
- package/es/core/utils/showGraphManageStatusUtil.js +3 -2
- package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/EventsCard.js +12 -13
- package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/components/LinkTopo/LinkTopoCard.js +2 -2
- package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/hooks/useAlarmAndRiskData.js +20 -18
- package/es/core/viewer/components/plugins/ViewerPlugin.js +3 -1
- package/es/core/viewer/components/titlebar/widgets/AlarmButton.js +1 -5
- package/es/networkTopo/components/TopoView.js +6 -11
- package/es/networkTopo/hooks/useEdgeExpand.js +2 -3
- package/es/networkTopo/services/topo/basic.js +3 -3
- package/es/networkTopo/store/topoCenter.js +260 -223
- package/es/style.js +1 -1
- package/es/utils/ResourceConfigUtil.js +3 -36
- package/es/utils/ciRefAttributeTranslateUtil.d.ts +19 -0
- package/es/utils/ciRefAttributeTranslateUtil.js +155 -0
- package/es/utils/topoData.js +4 -2
- package/lib/components/TemplateButton/index.module.scss +1 -1
- package/lib/core/components/AlarmListPanel/components/AlarmListItem.js +60 -3
- package/lib/core/components/TopoView/topoView.js +5 -1
- package/lib/core/editor/components/Toolbar/widgets/EdgeColorButton/EdgeColorButton.js +6 -12
- package/lib/core/editor/components/Toolbar/widgets/EdgeTypeButton/EdgeType.js +27 -9
- package/lib/core/editor/components/Toolbar/widgets/EdgeTypeButton/EdgeType.module.scss +21 -1
- package/lib/core/editor/components/Toolbar/widgets/EdgeTypeButton/LineType.js +8 -0
- package/lib/core/editor/components/Toolbar/widgets/EdgeTypeButton/index.js +1 -1
- package/lib/core/editor/components/Toolbar/widgets/Layout/index.js +16 -2
- package/lib/core/editor/hooks/useKeyboardShortcut.js +2 -0
- package/lib/core/editor/utils/copyElementUtil.js +15 -0
- package/lib/core/editor/utils/edgeTypeStyleUtil.js +8 -31
- package/lib/core/hooks/useAlarm.js +130 -79
- package/lib/core/hooks/useCmpLinkAlarm.js +166 -0
- package/lib/core/hooks/useEventData.js +1 -2
- package/lib/core/hooks/useGraphAlarmDisplay.js +91 -55
- package/lib/core/hooks/useResourceConfig.js +1 -3
- package/lib/core/hooks/useTopoEdit.js +50 -57
- package/lib/core/models/Alarm.js +69 -144
- package/lib/core/models/AttributeMetricDisplay.js +16 -4
- package/lib/core/models/TopoApp.js +1 -1
- package/lib/core/models/cache/CiCache.d.ts +1 -1
- package/lib/core/models/cache/CiCache.js +3 -3
- package/lib/core/models/cache/CiTypeCache.js +4 -0
- package/lib/core/models/topoData.js +0 -1
- package/lib/core/models/utils/linkUtils.js +21 -13
- package/lib/core/services/index.js +1 -1
- package/lib/core/services/topo/basic.js +2 -2
- package/lib/core/store/models/topoConfig.js +7 -10
- package/lib/core/store/models/topoMod.js +81 -134
- package/lib/core/utils/edgeUtil.js +10 -0
- package/lib/core/utils/metricUtil.js +8 -4
- package/lib/core/utils/showGraphManageStatusUtil.js +3 -2
- package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/EventsCard.js +12 -13
- package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/components/LinkTopo/LinkTopoCard.js +2 -2
- package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/hooks/useAlarmAndRiskData.js +20 -18
- package/lib/core/viewer/components/plugins/ViewerPlugin.js +3 -1
- package/lib/core/viewer/components/titlebar/widgets/AlarmButton.js +1 -5
- package/lib/networkTopo/components/TopoView.js +5 -14
- package/lib/networkTopo/hooks/useEdgeExpand.js +2 -3
- package/lib/networkTopo/services/topo/basic.js +3 -3
- package/lib/networkTopo/store/topoCenter.js +262 -225
- package/lib/style.js +1 -1
- package/lib/utils/ResourceConfigUtil.js +3 -38
- package/lib/utils/ciRefAttributeTranslateUtil.d.ts +19 -0
- package/lib/utils/ciRefAttributeTranslateUtil.js +168 -0
- package/lib/utils/topoData.js +4 -2
- package/package.json +3 -3
@@ -226,76 +226,23 @@ function _default(topoApp) {
|
|
226
226
|
enterEditMode: function enterEditMode(playload, rootState) {
|
227
227
|
topoApp.enterEditMode();
|
228
228
|
},
|
229
|
-
|
230
|
-
var _this3 = this;
|
231
|
-
|
229
|
+
refreshPermission: function refreshPermission() {
|
232
230
|
return (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee3() {
|
233
|
-
var topoId, treeData;
|
234
231
|
return _regenerator["default"].wrap(function _callee3$(_context3) {
|
235
232
|
while (1) switch (_context3.prev = _context3.next) {
|
236
233
|
case 0:
|
237
|
-
|
238
|
-
conditions = {};
|
239
|
-
}
|
240
|
-
|
241
|
-
topoId = rootState.topoTreeMod.defId;
|
242
|
-
|
243
|
-
if (!topoId) {
|
244
|
-
// 查找第一个
|
245
|
-
treeData = rootState.topoTreeMod.treeData;
|
246
|
-
(0, _tree.loopTreeByKey)(treeData, 'type', 1, function (item, index, arr) {
|
247
|
-
if (!topoId) {
|
248
|
-
topoId = item.id;
|
249
|
-
}
|
250
|
-
});
|
251
|
-
} // 右侧切换拓扑图
|
252
|
-
|
253
|
-
|
254
|
-
_this3.openTopoPage({
|
255
|
-
id: topoId
|
256
|
-
});
|
257
|
-
|
258
|
-
case 4:
|
259
|
-
case "end":
|
260
|
-
return _context3.stop();
|
261
|
-
}
|
262
|
-
}, _callee3);
|
263
|
-
}))();
|
264
|
-
},
|
265
|
-
refreshPermission: function refreshPermission() {
|
266
|
-
var _this4 = this;
|
267
|
-
|
268
|
-
return (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee4() {
|
269
|
-
return _regenerator["default"].wrap(function _callee4$(_context4) {
|
270
|
-
while (1) switch (_context4.prev = _context4.next) {
|
271
|
-
case 0:
|
272
|
-
_context4.next = 2;
|
234
|
+
_context3.next = 2;
|
273
235
|
return dispatch.functionAuth.refresh();
|
274
236
|
|
275
237
|
case 2:
|
276
|
-
|
277
|
-
return _this4.refreshTopoTree();
|
278
|
-
|
279
|
-
case 4:
|
280
|
-
case "end":
|
281
|
-
return _context4.stop();
|
282
|
-
}
|
283
|
-
}, _callee4);
|
284
|
-
}))();
|
285
|
-
},
|
286
|
-
refreshTopoTree: function refreshTopoTree() {
|
287
|
-
return (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee5() {
|
288
|
-
return _regenerator["default"].wrap(function _callee5$(_context5) {
|
289
|
-
while (1) switch (_context5.prev = _context5.next) {
|
290
|
-
case 0:
|
291
|
-
_context5.next = 2;
|
238
|
+
_context3.next = 4;
|
292
239
|
return dispatch.topoTreeMod.refreshTree();
|
293
240
|
|
294
|
-
case
|
241
|
+
case 4:
|
295
242
|
case "end":
|
296
|
-
return
|
243
|
+
return _context3.stop();
|
297
244
|
}
|
298
|
-
},
|
245
|
+
}, _callee3);
|
299
246
|
}))();
|
300
247
|
},
|
301
248
|
|
@@ -310,19 +257,19 @@ function _default(topoApp) {
|
|
310
257
|
* @return {Promise<void>}
|
311
258
|
*/
|
312
259
|
initTopoData: function initTopoData(props, state) {
|
313
|
-
var
|
260
|
+
var _this3 = this;
|
314
261
|
|
315
|
-
return (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function
|
262
|
+
return (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee4() {
|
316
263
|
var _result$config;
|
317
264
|
|
318
265
|
var startTime, topoId, data, linkToData, refresh, clear, linkTo, startState, permission, result, graphConfig, topoConfig, extraConfig, _combTopoData, topoData, resAndMetrics, _yield$Promise$all, newData, endTime;
|
319
266
|
|
320
|
-
return _regenerator["default"].wrap(function
|
321
|
-
while (1) switch (
|
267
|
+
return _regenerator["default"].wrap(function _callee4$(_context4) {
|
268
|
+
while (1) switch (_context4.prev = _context4.next) {
|
322
269
|
case 0:
|
323
270
|
startTime = (0, _moment["default"])();
|
324
271
|
topoId = props.topoId, data = props.data, linkToData = props.linkTo, refresh = props.refresh, clear = props.clear;
|
325
|
-
|
272
|
+
_context4.next = 4;
|
326
273
|
return topoApp.open(topoId);
|
327
274
|
|
328
275
|
case 4:
|
@@ -345,7 +292,7 @@ function _default(topoApp) {
|
|
345
292
|
});
|
346
293
|
}
|
347
294
|
|
348
|
-
|
295
|
+
_this3.update(startState);
|
349
296
|
|
350
297
|
dispatch.topoBizMod.update({
|
351
298
|
pollingSwitch: false
|
@@ -355,24 +302,24 @@ function _default(topoApp) {
|
|
355
302
|
permission = 'write';
|
356
303
|
|
357
304
|
if (!topoApp.options.usePermission) {
|
358
|
-
|
305
|
+
_context4.next = 19;
|
359
306
|
break;
|
360
307
|
}
|
361
308
|
|
362
|
-
|
363
|
-
return
|
309
|
+
_context4.next = 14;
|
310
|
+
return _this3.getTopoPermission({
|
364
311
|
id: topoId
|
365
312
|
});
|
366
313
|
|
367
314
|
case 14:
|
368
|
-
permission =
|
315
|
+
permission = _context4.sent;
|
369
316
|
|
370
317
|
if (_topoPermissionUtil["default"].isReadable(permission)) {
|
371
|
-
|
318
|
+
_context4.next = 19;
|
372
319
|
break;
|
373
320
|
}
|
374
321
|
|
375
|
-
|
322
|
+
_this3.update({
|
376
323
|
loading: false,
|
377
324
|
topoData: null,
|
378
325
|
data: null,
|
@@ -381,26 +328,26 @@ function _default(topoApp) {
|
|
381
328
|
});
|
382
329
|
|
383
330
|
topoApp.options.onLoad();
|
384
|
-
return
|
331
|
+
return _context4.abrupt("return");
|
385
332
|
|
386
333
|
case 19:
|
387
334
|
if (!data) {
|
388
|
-
|
335
|
+
_context4.next = 30;
|
389
336
|
break;
|
390
337
|
}
|
391
338
|
|
392
339
|
graphConfig = {};
|
393
340
|
|
394
341
|
if (!topoId) {
|
395
|
-
|
342
|
+
_context4.next = 27;
|
396
343
|
break;
|
397
344
|
}
|
398
345
|
|
399
|
-
|
346
|
+
_context4.next = 24;
|
400
347
|
return _topo["default"].getTopoData(topoId);
|
401
348
|
|
402
349
|
case 24:
|
403
|
-
topoConfig =
|
350
|
+
topoConfig = _context4.sent;
|
404
351
|
if (!topoConfig) _componentTopologyUtils.rlog.error("\u672A\u67E5\u8BE2\u5230\u62D3\u6251id " + topoId + " \u7684\u6570\u636E\uFF0C\u8BF7\u68C0\u67E5");
|
405
352
|
graphConfig = {
|
406
353
|
global: topoConfig === null || topoConfig === void 0 ? void 0 : topoConfig.global,
|
@@ -410,23 +357,23 @@ function _default(topoApp) {
|
|
410
357
|
|
411
358
|
case 27:
|
412
359
|
result = (0, _extends2["default"])({}, data, graphConfig);
|
413
|
-
|
360
|
+
_context4.next = 33;
|
414
361
|
break;
|
415
362
|
|
416
363
|
case 30:
|
417
|
-
|
364
|
+
_context4.next = 32;
|
418
365
|
return topoApp.options.loadData(topoId, topoApp.serverApi);
|
419
366
|
|
420
367
|
case 32:
|
421
|
-
result =
|
368
|
+
result = _context4.sent;
|
422
369
|
|
423
370
|
case 33:
|
424
371
|
if (result) {
|
425
|
-
|
372
|
+
_context4.next = 37;
|
426
373
|
break;
|
427
374
|
}
|
428
375
|
|
429
|
-
|
376
|
+
_this3.update({
|
430
377
|
loading: false,
|
431
378
|
data: null,
|
432
379
|
globalConfig: null,
|
@@ -435,19 +382,19 @@ function _default(topoApp) {
|
|
435
382
|
});
|
436
383
|
|
437
384
|
topoApp.options.onLoad();
|
438
|
-
return
|
385
|
+
return _context4.abrupt("return");
|
439
386
|
|
440
387
|
case 37:
|
441
388
|
result = (0, _topoData.parseTopoData)(result);
|
442
389
|
|
443
390
|
_componentTopologyUtils.rlog.debug('topoMod.initTopoData 查询数据完成', topoId, linkTo, result);
|
444
391
|
|
445
|
-
|
392
|
+
_context4.next = 41;
|
446
393
|
return dispatch.customIcon.loadCustomIcons();
|
447
394
|
|
448
395
|
case 41:
|
449
396
|
extraConfig = result.global.extraConfig;
|
450
|
-
|
397
|
+
_context4.next = 44;
|
451
398
|
return dispatch.displayConfig.setConfig((0, _extends2["default"])({}, extraConfig, {
|
452
399
|
alarmSwitch: result.global.alarmSwitch,
|
453
400
|
alarmListDefaultOpen: result.global.alarmListDefaultOpen
|
@@ -461,8 +408,8 @@ function _default(topoApp) {
|
|
461
408
|
globalConfig: extraConfig
|
462
409
|
}), topoData = _combTopoData.topoData, resAndMetrics = _combTopoData.resAndMetrics; // rlog.debug("topoMod.initTopoData combTopoData", { topoData, resAndMetrics, });
|
463
410
|
|
464
|
-
|
465
|
-
return
|
411
|
+
_context4.next = 47;
|
412
|
+
return _this3.update({
|
466
413
|
currentTopo: topoData.config,
|
467
414
|
data: result,
|
468
415
|
globalConfig: extraConfig,
|
@@ -477,15 +424,15 @@ function _default(topoApp) {
|
|
477
424
|
|
478
425
|
topoApp.alarm.open(); // 加载标注悬浮框数据
|
479
426
|
|
480
|
-
|
427
|
+
_context4.next = 52;
|
481
428
|
return Promise.all([(0, _getTopoData.addLinkData)(result), topoApp.ciTyeCache.load((0, _topoData.getCiTypes)(result)), topoApp.elementTagTipConfig.init(result) // 暂停新配置开发
|
482
429
|
]);
|
483
430
|
|
484
431
|
case 52:
|
485
|
-
_yield$Promise$all =
|
432
|
+
_yield$Promise$all = _context4.sent;
|
486
433
|
newData = _yield$Promise$all[0];
|
487
|
-
|
488
|
-
return
|
434
|
+
_context4.next = 56;
|
435
|
+
return _this3.update({
|
489
436
|
data: newData
|
490
437
|
});
|
491
438
|
|
@@ -500,15 +447,15 @@ function _default(topoApp) {
|
|
500
447
|
|
501
448
|
topoApp.options.onLoad();
|
502
449
|
|
503
|
-
|
450
|
+
_this3.update({
|
504
451
|
loading: false
|
505
452
|
});
|
506
453
|
|
507
454
|
case 62:
|
508
455
|
case "end":
|
509
|
-
return
|
456
|
+
return _context4.stop();
|
510
457
|
}
|
511
|
-
},
|
458
|
+
}, _callee4);
|
512
459
|
}))();
|
513
460
|
},
|
514
461
|
|
@@ -516,21 +463,21 @@ function _default(topoApp) {
|
|
516
463
|
* 刷新拓扑图
|
517
464
|
*/
|
518
465
|
refreshTopo: function refreshTopo(payload, rootState) {
|
519
|
-
var
|
466
|
+
var _this4 = this;
|
520
467
|
|
521
|
-
return (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function
|
468
|
+
return (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee5() {
|
522
469
|
var _payload, clear;
|
523
470
|
|
524
|
-
return _regenerator["default"].wrap(function
|
525
|
-
while (1) switch (
|
471
|
+
return _regenerator["default"].wrap(function _callee5$(_context5) {
|
472
|
+
while (1) switch (_context5.prev = _context5.next) {
|
526
473
|
case 0:
|
527
474
|
if (payload === void 0) {
|
528
475
|
payload = {};
|
529
476
|
}
|
530
477
|
|
531
478
|
_payload = payload, clear = _payload.clear;
|
532
|
-
|
533
|
-
return
|
479
|
+
_context5.next = 4;
|
480
|
+
return _this4.initTopoData({
|
534
481
|
topoId: rootState.topoMod.topoId,
|
535
482
|
refresh: true,
|
536
483
|
clear: clear
|
@@ -538,18 +485,18 @@ function _default(topoApp) {
|
|
538
485
|
|
539
486
|
case 4:
|
540
487
|
case "end":
|
541
|
-
return
|
488
|
+
return _context5.stop();
|
542
489
|
}
|
543
|
-
},
|
490
|
+
}, _callee5);
|
544
491
|
}))();
|
545
492
|
},
|
546
493
|
operationTopoPage: function operationTopoPage(conditions, state) {
|
547
|
-
var
|
494
|
+
var _this5 = this;
|
548
495
|
|
549
|
-
return (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function
|
496
|
+
return (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee6() {
|
550
497
|
var td;
|
551
|
-
return _regenerator["default"].wrap(function
|
552
|
-
while (1) switch (
|
498
|
+
return _regenerator["default"].wrap(function _callee6$(_context6) {
|
499
|
+
while (1) switch (_context6.prev = _context6.next) {
|
553
500
|
case 0:
|
554
501
|
if (conditions === void 0) {
|
555
502
|
conditions = {};
|
@@ -557,7 +504,7 @@ function _default(topoApp) {
|
|
557
504
|
|
558
505
|
if (conditions.id === state.topoMod.topoId) {
|
559
506
|
if (conditions.type === 'delete') {
|
560
|
-
|
507
|
+
_this5.update({
|
561
508
|
topoId: conditions.defId
|
562
509
|
});
|
563
510
|
}
|
@@ -569,7 +516,7 @@ function _default(topoApp) {
|
|
569
516
|
})
|
570
517
|
});
|
571
518
|
|
572
|
-
|
519
|
+
_this5.update({
|
573
520
|
topoData: td
|
574
521
|
});
|
575
522
|
}
|
@@ -577,29 +524,29 @@ function _default(topoApp) {
|
|
577
524
|
|
578
525
|
case 2:
|
579
526
|
case "end":
|
580
|
-
return
|
527
|
+
return _context6.stop();
|
581
528
|
}
|
582
|
-
},
|
529
|
+
}, _callee6);
|
583
530
|
}))();
|
584
531
|
},
|
585
532
|
openPermissionSetting: function openPermissionSetting(payload, rootState) {
|
586
|
-
return (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function
|
587
|
-
return _regenerator["default"].wrap(function
|
588
|
-
while (1) switch (
|
533
|
+
return (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee7() {
|
534
|
+
return _regenerator["default"].wrap(function _callee7$(_context7) {
|
535
|
+
while (1) switch (_context7.prev = _context7.next) {
|
589
536
|
case 0:
|
590
537
|
dispatch.permissionSetting.open();
|
591
538
|
|
592
539
|
case 1:
|
593
540
|
case "end":
|
594
|
-
return
|
541
|
+
return _context7.stop();
|
595
542
|
}
|
596
|
-
},
|
543
|
+
}, _callee7);
|
597
544
|
}))();
|
598
545
|
},
|
599
546
|
updateDelId: function updateDelId(conditions, state) {
|
600
|
-
return (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function
|
601
|
-
return _regenerator["default"].wrap(function
|
602
|
-
while (1) switch (
|
547
|
+
return (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee8() {
|
548
|
+
return _regenerator["default"].wrap(function _callee8$(_context8) {
|
549
|
+
while (1) switch (_context8.prev = _context8.next) {
|
603
550
|
case 0:
|
604
551
|
if (conditions === void 0) {
|
605
552
|
conditions = '';
|
@@ -609,53 +556,53 @@ function _default(topoApp) {
|
|
609
556
|
|
610
557
|
case 2:
|
611
558
|
case "end":
|
612
|
-
return
|
559
|
+
return _context8.stop();
|
613
560
|
}
|
614
|
-
},
|
561
|
+
}, _callee8);
|
615
562
|
}))();
|
616
563
|
},
|
617
564
|
getTopoPermission: function getTopoPermission(playload, rootState) {
|
618
|
-
var
|
565
|
+
var _this6 = this;
|
619
566
|
|
620
|
-
return (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function
|
567
|
+
return (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee9() {
|
621
568
|
var id, update, topoPermission;
|
622
|
-
return _regenerator["default"].wrap(function
|
623
|
-
while (1) switch (
|
569
|
+
return _regenerator["default"].wrap(function _callee9$(_context9) {
|
570
|
+
while (1) switch (_context9.prev = _context9.next) {
|
624
571
|
case 0:
|
625
572
|
id = playload.id, update = playload.update;
|
626
|
-
|
627
|
-
|
573
|
+
_context9.prev = 1;
|
574
|
+
_context9.next = 4;
|
628
575
|
return topoApp.serverApi.auth.getTopoPermission(id);
|
629
576
|
|
630
577
|
case 4:
|
631
|
-
topoPermission =
|
578
|
+
topoPermission = _context9.sent;
|
632
579
|
|
633
580
|
_componentTopologyUtils.rlog.debug('查询拓扑权限', topoPermission);
|
634
581
|
|
635
|
-
|
582
|
+
_context9.next = 11;
|
636
583
|
break;
|
637
584
|
|
638
585
|
case 8:
|
639
|
-
|
640
|
-
|
586
|
+
_context9.prev = 8;
|
587
|
+
_context9.t0 = _context9["catch"](1);
|
641
588
|
|
642
|
-
_componentTopologyUtils.rlog.error("\u67E5\u8BE2\u62D3\u6251" + id + "\u7684\u6743\u9650\u5931\u8D25",
|
589
|
+
_componentTopologyUtils.rlog.error("\u67E5\u8BE2\u62D3\u6251" + id + "\u7684\u6743\u9650\u5931\u8D25", _context9.t0); // 尚未区分拓扑图不存在还是接口请求报错
|
643
590
|
|
644
591
|
|
645
592
|
case 11:
|
646
593
|
if (update !== false) {
|
647
|
-
|
594
|
+
_this6.update({
|
648
595
|
topoPermission: topoPermission
|
649
596
|
});
|
650
597
|
}
|
651
598
|
|
652
|
-
return
|
599
|
+
return _context9.abrupt("return", topoPermission);
|
653
600
|
|
654
601
|
case 13:
|
655
602
|
case "end":
|
656
|
-
return
|
603
|
+
return _context9.stop();
|
657
604
|
}
|
658
|
-
},
|
605
|
+
}, _callee9, null, [[1, 8]]);
|
659
606
|
}))();
|
660
607
|
}
|
661
608
|
};
|
@@ -3,17 +3,27 @@
|
|
3
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
4
4
|
|
5
5
|
exports.__esModule = true;
|
6
|
+
exports.isCustomEdge = isCustomEdge;
|
6
7
|
exports.updateEdgeExpanded = void 0;
|
7
8
|
|
8
9
|
var _rlog = _interopRequireDefault(require("@riil-frontend/component-topology-utils/es/rlog"));
|
9
10
|
|
10
11
|
var _linkUtils = require("../models/utils/linkUtils");
|
11
12
|
|
13
|
+
/**
|
14
|
+
* 是否手工连线
|
15
|
+
* @param {*} edge
|
16
|
+
*/
|
17
|
+
function isCustomEdge(edge) {
|
18
|
+
return !edge.isEdgeGroupAgent() && (edge.a('type') == 'line' || !edge.a('type'));
|
19
|
+
}
|
12
20
|
/**
|
13
21
|
* 根据配置更新连线展开折叠状态
|
14
22
|
*
|
15
23
|
* @param {*} topo
|
16
24
|
*/
|
25
|
+
|
26
|
+
|
17
27
|
var updateEdgeExpanded = function updateEdgeExpanded(topo) {
|
18
28
|
var _topo$historyManager, _topo$historyManager2;
|
19
29
|
|
@@ -5,6 +5,8 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
|
|
5
5
|
exports.__esModule = true;
|
6
6
|
exports.formatMetric = formatMetric;
|
7
7
|
|
8
|
+
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
9
|
+
|
8
10
|
var _utils = require("@riil-frontend/utils");
|
9
11
|
|
10
12
|
var _DictCache = _interopRequireDefault(require("../models/cache/DictCache"));
|
@@ -23,16 +25,18 @@ function formatMetric(val, metricModel) {
|
|
23
25
|
if (metricModel) {
|
24
26
|
var _result$value;
|
25
27
|
|
26
|
-
// 分级字典特殊处理
|
27
|
-
|
28
|
-
|
28
|
+
var dictObject = (0, _extends2["default"])({}, _DictCache["default"].getDictObject()); // 分级字典特殊处理
|
29
|
+
|
30
|
+
if (metricModel.dict) {
|
31
|
+
// val = metricModel.dict[val]
|
32
|
+
dictObject[metricModel.code] = metricModel.dict;
|
29
33
|
}
|
30
34
|
|
31
35
|
var result = (0, _utils.metricValueFormat)({
|
32
36
|
value: val,
|
33
37
|
dataType: metricModel.dataType,
|
34
38
|
changeValue: metricModel.changeValue,
|
35
|
-
dict:
|
39
|
+
dict: dictObject,
|
36
40
|
unit: metricModel.unit,
|
37
41
|
code: metricModel.code
|
38
42
|
});
|
@@ -14,6 +14,7 @@ function showManageStatus(options) {
|
|
14
14
|
var topo = options.topo,
|
15
15
|
resources = options.resources,
|
16
16
|
graphLoaded = options.graphLoaded,
|
17
|
+
alarmSwitch = options.alarmSwitch,
|
17
18
|
cisEventLevel = options.cisEventLevel;
|
18
19
|
|
19
20
|
var hasAlarm = function hasAlarm(id) {
|
@@ -30,9 +31,9 @@ function showManageStatus(options) {
|
|
30
31
|
manageStatus = resource.manageStatus,
|
31
32
|
permission = resource.permission;
|
32
33
|
var isNotMonite = manageStatus === 0;
|
33
|
-
var readable = !!(permission !== null && permission !== void 0 && permission.readable); //
|
34
|
+
var readable = !!(permission !== null && permission !== void 0 && permission.readable); // 未监控 && 有查看权限 && (告警静默 || 没有告警),才显示未监控状态
|
34
35
|
|
35
|
-
var showUnMoniteStatus =
|
36
|
+
var showUnMoniteStatus = isNotMonite && readable && (alarmSwitch === false || !hasAlarm(id));
|
36
37
|
var element = topo.getDataModel().getDataByTag(id);
|
37
38
|
if (!element) return; // ht元素设置是否显示监控状态,是否展示,用于缩小色块时显示未监控颜色
|
38
39
|
|
package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/EventsCard.js
CHANGED
@@ -37,32 +37,31 @@ function EventsCard(props) {
|
|
37
37
|
onHandleAlarm = props.onHandleAlarm; // 告警table列配置
|
38
38
|
|
39
39
|
var columns = [{
|
40
|
-
title:
|
41
|
-
dataIndex:
|
42
|
-
key:
|
40
|
+
title: "描述",
|
41
|
+
dataIndex: "title",
|
42
|
+
key: "title",
|
43
43
|
cell: function cell(value, index, record) {
|
44
44
|
return /*#__PURE__*/_react["default"].createElement("div", {
|
45
|
-
className: _indexModule["default"][
|
45
|
+
className: _indexModule["default"]["alarm-title"],
|
46
46
|
title: value,
|
47
47
|
onClick: closeDetailDrawer
|
48
48
|
}, /*#__PURE__*/_react["default"].createElement(_icon["default"], {
|
49
49
|
type: record.icon,
|
50
50
|
size: "xs",
|
51
|
-
className: _indexModule["default"][
|
52
|
-
}), /*#__PURE__*/_react["default"].createElement("
|
53
|
-
|
54
|
-
href: formatUrl(record.link)
|
51
|
+
className: _indexModule["default"]["alarm-color-icon"] + " " + record.className
|
52
|
+
}), /*#__PURE__*/_react["default"].createElement(_Link["default"], {
|
53
|
+
to: formatUrl(record.link)
|
55
54
|
}, value));
|
56
55
|
}
|
57
56
|
}, {
|
58
|
-
title:
|
59
|
-
dataIndex:
|
60
|
-
key:
|
57
|
+
title: "时间",
|
58
|
+
dataIndex: "time",
|
59
|
+
key: "time",
|
61
60
|
width: 144,
|
62
61
|
cell: function cell(value, index, record) {
|
63
62
|
return /*#__PURE__*/_react["default"].createElement("div", {
|
64
|
-
title: (0, _moment["default"])(value).format(
|
65
|
-
}, (0, _moment["default"])(value).format(
|
63
|
+
title: (0, _moment["default"])(value).format("YYYY-MM-DD HH:mm:ss")
|
64
|
+
}, (0, _moment["default"])(value).format("YYYY-MM-DD HH:mm:ss"));
|
66
65
|
}
|
67
66
|
} // 临时屏蔽告警操作列,后续版本按权限显示 2023-3-6 20:23:45
|
68
67
|
// {
|
@@ -41,8 +41,8 @@ function LinkTopoCard(props) {
|
|
41
41
|
openFlow = _useState[0],
|
42
42
|
setOpenFlow = _useState[1];
|
43
43
|
|
44
|
-
var analysisUrl = "../../default/trafficControl/linkConfigure?id=" + data.attributes.
|
45
|
-
var linkDetailsUrl = "/default/pagecenter/linkDetail/view/" + data.id + "?resId=" + data.id + "&domainCode=network&title=" + data.attributes.
|
44
|
+
var analysisUrl = "../../default/trafficControl/linkConfigure?id=" + encodeURIComponent(data.attributes.display_name) + "&num=0";
|
45
|
+
var linkDetailsUrl = "/default/pagecenter/linkDetail/view/" + data.id + "?resId=" + data.id + "&domainCode=network&title=" + encodeURIComponent(data.attributes.display_name) + "&ciCode=network_link&tabByComType=uicbb-res-crucial-link-flow";
|
46
46
|
|
47
47
|
var isOpenFlows = /*#__PURE__*/function () {
|
48
48
|
var _ref = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee() {
|