@riil-frontend/component-topology 7.0.0-dev.2 → 7.0.0-dev.20
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 +1 -1
- package/build/index.js +31 -31
- package/es/core/components/TopoView/topoView.js +2 -19
- package/es/core/components/titlebar/index.js +2 -1
- package/es/core/editor/components/EditorPlugin.js +1 -2
- package/es/core/editor/components/Toolbar/buttons.js +2 -2
- package/es/core/editor/components/Toolbar/widgets/components/textStyleSetting/ElementTextStyleSetting/elements/edgeTag.js +11 -3
- package/es/core/editor/components/Toolbar/widgets/components/textStyleSetting/ElementTextStyleSetting/elements/nodeTag.js +6 -1
- package/es/core/editor/components/Toolbar/widgets/components/textStyleSetting/ElementTextStyleSetting/textStyleUtil.js +5 -0
- package/es/core/editor/components/settings/PropertyView.js +11 -10
- package/es/core/editor/components/settings/Settings.js +8 -1
- package/es/core/editor/components/settings/core/PropertyViewManager.js +4 -3
- package/es/core/editor/components/settings/core/edgePropertyViewAdapter.js +1 -7
- package/es/core/editor/components/settings/propertyViews/node/data/Data.js +6 -3
- package/es/core/editor/components/settings/propertyViews/node/data/NodeRelateResourceButton.js +4 -2
- package/es/core/editor/components/settings/propertyViews/node/data/PlatformDisplay.js +10 -0
- package/es/core/editor/hooks/useKeyboardShortcut.js +1 -1
- package/es/core/hooks/usePolling.js +1 -6
- package/es/core/hooks/useTopoEdit.js +134 -170
- package/es/core/models/Alarm.js +12 -24
- package/es/core/models/TopoApp.js +1 -1
- package/es/core/models/topoData.js +3 -3
- package/es/core/models/utils/linkUtils.js +0 -3
- package/es/core/store/models/topoConfig.js +7 -5
- package/es/core/store/models/topoMod.js +8 -7
- package/es/core/utils/saveSerialize.js +2 -3
- package/es/core/viewer/components/plugins/ResourceDetail/ResourceDetailDrawer.js +13 -2
- package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/EventsCard.js +28 -25
- package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/ResourceOverview.js +4 -0
- package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/components/Configurator/index.js +17 -17
- package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/index.module.scss +1 -0
- package/es/core/viewer/components/titlebar/BasicTools.js +3 -16
- package/es/core/viewer/components/titlebar/widgets/AlarmButton.js +25 -0
- package/es/networkTopo/components/editor/propertyViews/edge/LinkPropertyView/Data/index.js +8 -2
- package/es/networkTopo/components/editor/propertyViews/edge/LinkPropertyView/LinkPropertyView.js +7 -9
- package/es/networkTopo/components/editor/propertyViews/edge/link/LinkInfoPreview.js +42 -16
- package/es/networkTopo/components/editor/useEditorProps.js +4 -5
- package/es/networkTopo/getTopoData.js +18 -30
- package/es/networkTopo/hooks/editor/useDeleteEdges.js +6 -3
- package/es/networkTopo/services/alert.js +55 -0
- package/es/networkTopo/services/authorization.js +135 -0
- package/es/networkTopo/services/cmdb.js +897 -0
- package/es/networkTopo/services/index.js +2 -26
- package/es/networkTopo/services/mdc.js +74 -0
- package/es/networkTopo/services/metric.js +68 -0
- package/es/networkTopo/services/model.js +1283 -0
- package/es/networkTopo/services/risk.js +29 -0
- package/es/networkTopo/services/topo/auth.js +67 -0
- package/es/networkTopo/services/topo/basic.js +727 -0
- package/es/networkTopo/services/topo/blacklist.js +60 -0
- package/es/networkTopo/services/topo/ciInfo.js +69 -0
- package/es/networkTopo/services/topo/constants.js +1 -0
- package/es/networkTopo/services/topo/icon.js +131 -0
- package/es/networkTopo/services/topo/index.js +18 -0
- package/es/networkTopo/services/topo/networkLink.js +33 -0
- package/es/networkTopo/services/topo/relation.js +27 -0
- package/es/networkTopo/services/topo/resourceWebUrl.js +84 -0
- package/es/networkTopo/utils/storage.js +38 -0
- package/es/style.js +21 -21
- package/es/utils/tree.js +1 -0
- package/lib/core/components/TopoView/topoView.js +2 -20
- package/lib/core/components/titlebar/index.js +5 -1
- package/lib/core/editor/components/EditorPlugin.js +1 -3
- package/lib/core/editor/components/Toolbar/buttons.js +2 -2
- package/lib/core/editor/components/Toolbar/widgets/components/textStyleSetting/ElementTextStyleSetting/elements/edgeTag.js +11 -4
- package/lib/core/editor/components/Toolbar/widgets/components/textStyleSetting/ElementTextStyleSetting/elements/nodeTag.js +6 -1
- package/lib/core/editor/components/Toolbar/widgets/components/textStyleSetting/ElementTextStyleSetting/textStyleUtil.js +5 -0
- package/lib/core/editor/components/settings/PropertyView.js +10 -10
- package/lib/core/editor/components/settings/Settings.js +9 -1
- package/lib/core/editor/components/settings/core/PropertyViewManager.js +4 -3
- package/lib/core/editor/components/settings/core/edgePropertyViewAdapter.js +1 -10
- package/lib/core/editor/components/settings/propertyViews/node/data/Data.js +7 -4
- package/lib/core/editor/components/settings/propertyViews/node/data/NodeRelateResourceButton.js +4 -2
- package/lib/core/editor/components/settings/propertyViews/node/data/PlatformDisplay.js +18 -0
- package/lib/core/editor/hooks/useKeyboardShortcut.js +1 -1
- package/lib/core/hooks/usePolling.js +1 -6
- package/lib/core/hooks/useTopoEdit.js +134 -170
- package/lib/core/models/Alarm.js +12 -24
- package/lib/core/models/TopoApp.js +1 -1
- package/lib/core/models/topoData.js +7 -11
- package/lib/core/models/utils/linkUtils.js +0 -5
- package/lib/core/store/models/topoConfig.js +7 -5
- package/lib/core/store/models/topoMod.js +10 -7
- package/lib/core/utils/saveSerialize.js +1 -3
- package/lib/core/viewer/components/plugins/ResourceDetail/ResourceDetailDrawer.js +13 -2
- package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/EventsCard.js +28 -26
- package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/ResourceOverview.js +4 -0
- package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/components/Configurator/index.js +17 -17
- package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/index.module.scss +1 -0
- package/lib/core/viewer/components/titlebar/BasicTools.js +3 -17
- package/lib/core/viewer/components/titlebar/widgets/AlarmButton.js +36 -0
- package/lib/networkTopo/components/editor/propertyViews/edge/LinkPropertyView/Data/index.js +8 -2
- package/lib/networkTopo/components/editor/propertyViews/edge/LinkPropertyView/LinkPropertyView.js +7 -9
- package/lib/networkTopo/components/editor/propertyViews/edge/link/LinkInfoPreview.js +42 -16
- package/lib/networkTopo/components/editor/useEditorProps.js +4 -6
- package/lib/networkTopo/getTopoData.js +19 -33
- package/lib/networkTopo/hooks/editor/useDeleteEdges.js +6 -4
- package/lib/networkTopo/services/alert.js +66 -0
- package/lib/networkTopo/services/authorization.js +145 -0
- package/lib/networkTopo/services/cmdb.js +977 -0
- package/lib/networkTopo/services/index.js +3 -29
- package/lib/networkTopo/services/mdc.js +91 -0
- package/lib/networkTopo/services/metric.js +82 -0
- package/lib/networkTopo/services/model.js +1387 -0
- package/lib/networkTopo/services/risk.js +40 -0
- package/lib/networkTopo/services/topo/auth.js +79 -0
- package/lib/networkTopo/services/topo/basic.js +753 -0
- package/lib/networkTopo/services/topo/blacklist.js +72 -0
- package/lib/networkTopo/services/topo/ciInfo.js +82 -0
- package/lib/networkTopo/services/topo/constants.js +6 -0
- package/lib/networkTopo/services/topo/icon.js +144 -0
- package/lib/networkTopo/services/topo/index.js +42 -0
- package/lib/networkTopo/services/topo/networkLink.js +45 -0
- package/lib/networkTopo/services/topo/relation.js +39 -0
- package/lib/networkTopo/services/topo/resourceWebUrl.js +95 -0
- package/lib/networkTopo/utils/storage.js +46 -0
- package/lib/style.js +21 -21
- package/lib/utils/tree.js +1 -0
- package/package.json +3 -3
- package/es/core/editor/components/plugins/MultipleResourceSelectPlugin.js +0 -15
- package/es/core/editor/components/settings/propertyViews/edge/addEdgeProps.js +0 -10
- package/es/networkTopo/components/editor/propertyViews/edge/addLinkDrawer/AddLinkDrawer.js +0 -630
- package/es/networkTopo/components/editor/propertyViews/edge/addLinkDrawer/components/NetworkLinkForm.js +0 -4
- package/es/networkTopo/components/editor/propertyViews/edge/addLinkDrawer/components/editLinkInfo.js +0 -458
- package/es/networkTopo/components/editor/propertyViews/edge/addLinkDrawer/components/index.module.scss +0 -34
- package/es/networkTopo/components/editor/propertyViews/edge/addLinkDrawer/hooks/useAddLink.js +0 -104
- package/es/networkTopo/components/editor/propertyViews/edge/addLinkDrawer/index.module.scss +0 -12
- package/es/networkTopo/components/editor/propertyViews/edge/addLinkDrawer/mock.js +0 -55
- package/es/networkTopo/components/editor/propertyViews/edge/addLinkDrawer/server.js +0 -187
- package/es/networkTopo/event/index.js +0 -6
- package/lib/core/editor/components/plugins/MultipleResourceSelectPlugin.js +0 -25
- package/lib/core/editor/components/settings/propertyViews/edge/addEdgeProps.js +0 -19
- package/lib/networkTopo/components/editor/propertyViews/edge/addLinkDrawer/AddLinkDrawer.js +0 -661
- package/lib/networkTopo/components/editor/propertyViews/edge/addLinkDrawer/components/NetworkLinkForm.js +0 -12
- package/lib/networkTopo/components/editor/propertyViews/edge/addLinkDrawer/components/editLinkInfo.js +0 -486
- package/lib/networkTopo/components/editor/propertyViews/edge/addLinkDrawer/components/index.module.scss +0 -34
- package/lib/networkTopo/components/editor/propertyViews/edge/addLinkDrawer/hooks/useAddLink.js +0 -120
- package/lib/networkTopo/components/editor/propertyViews/edge/addLinkDrawer/index.module.scss +0 -12
- package/lib/networkTopo/components/editor/propertyViews/edge/addLinkDrawer/mock.js +0 -60
- package/lib/networkTopo/components/editor/propertyViews/edge/addLinkDrawer/server.js +0 -207
- package/lib/networkTopo/event/index.js +0 -11
package/es/core/models/Alarm.js
CHANGED
@@ -220,23 +220,11 @@ var Alarm = /*#__PURE__*/function () {
|
|
220
220
|
|
221
221
|
_proto.hmGetTopoAlarm = /*#__PURE__*/function () {
|
222
222
|
var _hmGetTopoAlarm = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee3(id) {
|
223
|
-
var
|
224
|
-
|
223
|
+
var mainCiIdList, endTime, startTime, parms, result;
|
225
224
|
return _regeneratorRuntime.wrap(function _callee3$(_context3) {
|
226
225
|
while (1) {
|
227
226
|
switch (_context3.prev = _context3.next) {
|
228
227
|
case 0:
|
229
|
-
_this$topo$store$getS = this.topo.store.getState().topoMod, data = _this$topo$store$getS.data, resAndMetrics = _this$topo$store$getS.resAndMetrics, topoData = _this$topo$store$getS.topoData;
|
230
|
-
_this$getState2 = this.getState(), alarmIsOpened = _this$getState2.alarmIsOpened, alarmOpening = _this$getState2.alarmOpening; // const { nodes, links } = data;
|
231
|
-
|
232
|
-
nodeIdsList = resAndMetrics.nodeIdsList, linkIdsList = resAndMetrics.linkIdsList, resIdsList = resAndMetrics.resIdsList; // rlog.debug(
|
233
|
-
// "获取告警列表--resAndMetrics,topoData,data",
|
234
|
-
// this.topo,
|
235
|
-
// resAndMetrics,
|
236
|
-
// topoData,
|
237
|
-
// data
|
238
|
-
// );
|
239
|
-
|
240
228
|
mainCiIdList = this.topo.dataModel.getDatas().filter(function (ci) {
|
241
229
|
return !!ci.operation;
|
242
230
|
}) // 过滤掉权限
|
@@ -245,7 +233,7 @@ var Alarm = /*#__PURE__*/function () {
|
|
245
233
|
});
|
246
234
|
|
247
235
|
if (!(mainCiIdList.length === 0)) {
|
248
|
-
_context3.next =
|
236
|
+
_context3.next = 4;
|
249
237
|
break;
|
250
238
|
}
|
251
239
|
|
@@ -255,7 +243,7 @@ var Alarm = /*#__PURE__*/function () {
|
|
255
243
|
});
|
256
244
|
return _context3.abrupt("return");
|
257
245
|
|
258
|
-
case
|
246
|
+
case 4:
|
259
247
|
//rlog.debug("获取告警列表", mainCiIdList);
|
260
248
|
endTime = null; // new Date().valueOf();
|
261
249
|
|
@@ -280,10 +268,10 @@ var Alarm = /*#__PURE__*/function () {
|
|
280
268
|
endTime: endTime
|
281
269
|
}
|
282
270
|
};
|
283
|
-
_context3.next =
|
271
|
+
_context3.next = 9;
|
284
272
|
return topoService.getAlarmByIds(parms);
|
285
273
|
|
286
|
-
case
|
274
|
+
case 9:
|
287
275
|
result = _context3.sent;
|
288
276
|
rlog.debug("getAlarmById-result", result); // if (alarmIsOpened) {
|
289
277
|
// //this.topo.loadAlarm(result.datas);
|
@@ -294,7 +282,7 @@ var Alarm = /*#__PURE__*/function () {
|
|
294
282
|
// alarmPanelIsOpen: result.datas.length > 0,
|
295
283
|
// });
|
296
284
|
|
297
|
-
case
|
285
|
+
case 11:
|
298
286
|
case "end":
|
299
287
|
return _context3.stop();
|
300
288
|
}
|
@@ -389,14 +377,14 @@ var Alarm = /*#__PURE__*/function () {
|
|
389
377
|
var _openTopoAlarm = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee6(id) {
|
390
378
|
var _this2 = this;
|
391
379
|
|
392
|
-
var _this$
|
380
|
+
var _this$getState2, alarmOpening, topoAlarmIsOpen, alarmDispatchers;
|
393
381
|
|
394
382
|
return _regeneratorRuntime.wrap(function _callee6$(_context6) {
|
395
383
|
while (1) {
|
396
384
|
switch (_context6.prev = _context6.next) {
|
397
385
|
case 0:
|
398
386
|
// 如果当前拓扑图开启中或已开启则退出
|
399
|
-
_this$
|
387
|
+
_this$getState2 = this.getState(), alarmOpening = _this$getState2.alarmOpening, topoAlarmIsOpen = _this$getState2.topoAlarmIsOpen;
|
400
388
|
|
401
389
|
if (!(this.currentTopoId === id && (topoAlarmIsOpen || alarmOpening))) {
|
402
390
|
_context6.next = 3;
|
@@ -456,14 +444,14 @@ var Alarm = /*#__PURE__*/function () {
|
|
456
444
|
/*#__PURE__*/
|
457
445
|
function () {
|
458
446
|
var _closeTopoAlarm = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee7(id) {
|
459
|
-
var _this$
|
447
|
+
var _this$getState3, alarmIsOpened, alarmOpening;
|
460
448
|
|
461
449
|
return _regeneratorRuntime.wrap(function _callee7$(_context7) {
|
462
450
|
while (1) {
|
463
451
|
switch (_context7.prev = _context7.next) {
|
464
452
|
case 0:
|
465
453
|
// 如果未开启则退出
|
466
|
-
_this$
|
454
|
+
_this$getState3 = this.getState(), alarmIsOpened = _this$getState3.alarmIsOpened, alarmOpening = _this$getState3.alarmOpening;
|
467
455
|
|
468
456
|
if (!(!alarmIsOpened && !alarmOpening)) {
|
469
457
|
_context7.next = 3;
|
@@ -550,13 +538,13 @@ var Alarm = /*#__PURE__*/function () {
|
|
550
538
|
/*#__PURE__*/
|
551
539
|
function () {
|
552
540
|
var _handleAlarmEvent = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee9(alertData) {
|
553
|
-
var _this$
|
541
|
+
var _this$getState4, alarmIsOpened, resAndMetrics, resIdsList, nodeIdsList, linkIdsList, alarmDispatchers, sendAl, idsList, operations, _yield$alarmDispatche, eqFlag, alarmlist, _this$topo$viewProps, _this$topo$viewProps2;
|
554
542
|
|
555
543
|
return _regeneratorRuntime.wrap(function _callee9$(_context9) {
|
556
544
|
while (1) {
|
557
545
|
switch (_context9.prev = _context9.next) {
|
558
546
|
case 0:
|
559
|
-
_this$
|
547
|
+
_this$getState4 = this.getState(), alarmIsOpened = _this$getState4.alarmIsOpened;
|
560
548
|
resAndMetrics = this.topo.store.getState().topoMod.resAndMetrics;
|
561
549
|
resIdsList = resAndMetrics.resIdsList, nodeIdsList = resAndMetrics.nodeIdsList, linkIdsList = resAndMetrics.linkIdsList;
|
562
550
|
alarmDispatchers = this.topo.store.getModelDispatchers("topoAlarm"); // 添加事件
|
@@ -23,7 +23,7 @@ import topoFactory from "./topoFactory";
|
|
23
23
|
import ElementTagTipConfig from "./tagstips/ElementTagTipConfig";
|
24
24
|
import SelectionModel from "./SelectionModel"; // eslint-disable-next-line no-undef
|
25
25
|
|
26
|
-
var version = typeof "7.0.0-dev.
|
26
|
+
var version = typeof "7.0.0-dev.20" === 'string' ? "7.0.0-dev.20" : null;
|
27
27
|
console.info("\u62D3\u6251\u7248\u672C: " + version);
|
28
28
|
/**
|
29
29
|
* 拓扑显示和编辑
|
@@ -1,7 +1,7 @@
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
2
2
|
import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
|
3
3
|
import _regeneratorRuntime from "@babel/runtime/regenerator";
|
4
|
-
import
|
4
|
+
import { TOPO_PARENT_ID } from "@riil-frontend/component-topology-common/es/services/topo";
|
5
5
|
import rlog from "@riil-frontend/component-topology-utils/es/rlog";
|
6
6
|
export function getLayoutId(layout) {
|
7
7
|
if (!layout || typeof layout === "string") {
|
@@ -33,12 +33,12 @@ export function saveTopo(_x) {
|
|
33
33
|
|
34
34
|
function _saveTopo() {
|
35
35
|
_saveTopo = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(data) {
|
36
|
-
var topoId, template, layout, backgroundId, globalConfig, serialize, resources, groups, exportLinkIdList, relateTopoIdList, viewGroupId, groupInfo, viewResources;
|
36
|
+
var topoService, topoId, template, layout, backgroundId, globalConfig, serialize, resources, groups, exportLinkIdList, relateTopoIdList, viewGroupId, groupInfo, viewResources;
|
37
37
|
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
38
38
|
while (1) {
|
39
39
|
switch (_context.prev = _context.next) {
|
40
40
|
case 0:
|
41
|
-
topoId = data.id, template = data.template, layout = data.layout, backgroundId = data.backgroundId, globalConfig = data.globalConfig, serialize = data.serialize, resources = data.resources, groups = data.groups, exportLinkIdList = data.exportLinkIdList, relateTopoIdList = data.relateTopoIdList, viewGroupId = data.viewGroupId;
|
41
|
+
topoService = data.topoService, topoId = data.id, template = data.template, layout = data.layout, backgroundId = data.backgroundId, globalConfig = data.globalConfig, serialize = data.serialize, resources = data.resources, groups = data.groups, exportLinkIdList = data.exportLinkIdList, relateTopoIdList = data.relateTopoIdList, viewGroupId = data.viewGroupId;
|
42
42
|
rlog.debug("saveTopo", data); // 保存布局
|
43
43
|
|
44
44
|
if (!(template && layout)) {
|
@@ -33,9 +33,6 @@ export function isCrucialLink(link) {
|
|
33
33
|
export function isExitLink(link) {
|
34
34
|
return (link === null || link === void 0 ? void 0 : link.attributes) && !(link !== null && link !== void 0 && link.attributes['destination_id']);
|
35
35
|
}
|
36
|
-
export function isAggLink(link) {
|
37
|
-
return link.attributes["network_link.connect_type"] === "agg";
|
38
|
-
}
|
39
36
|
export var getInterfaceObject = /*#__PURE__*/function () {
|
40
37
|
var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(codes) {
|
41
38
|
var query, promises, result, ifDoc;
|
@@ -177,7 +177,7 @@ export default function (topoApp) {
|
|
177
177
|
switch (_context.prev = _context.next) {
|
178
178
|
case 0:
|
179
179
|
_context.next = 2;
|
180
|
-
return
|
180
|
+
return topoApp.serverApi.getConditions(topoApp.id);
|
181
181
|
|
182
182
|
case 2:
|
183
183
|
data = _context.sent;
|
@@ -325,7 +325,7 @@ export default function (topoApp) {
|
|
325
325
|
}); // rlog.debug("getTopoByConditions--------", viewConditions, groupInfo);
|
326
326
|
|
327
327
|
_context4.next = 5;
|
328
|
-
return
|
328
|
+
return topoApp.serverApi.getTopoDataByResource(topoId, viewConditions, groupInfo, exportLinkIdList);
|
329
329
|
|
330
330
|
case 5:
|
331
331
|
data = _context4.sent;
|
@@ -391,7 +391,7 @@ export default function (topoApp) {
|
|
391
391
|
};
|
392
392
|
rlog.debug('saveGlobalConfig', config);
|
393
393
|
_context5.next = 5;
|
394
|
-
return
|
394
|
+
return topoApp.serverApi.saveTopoSettings(topoApp.id, config);
|
395
395
|
|
396
396
|
case 5:
|
397
397
|
case "end":
|
@@ -414,7 +414,9 @@ export default function (topoApp) {
|
|
414
414
|
case 0:
|
415
415
|
currentBackground = topoApp.store.getModelState("background").current;
|
416
416
|
_context6.next = 3;
|
417
|
-
return _saveTopo(_extends({
|
417
|
+
return _saveTopo(_extends({
|
418
|
+
topoService: topoApp.serverApi
|
419
|
+
}, data, {
|
418
420
|
viewGroupId: (_state$topoConfig$vie = state.topoConfig.viewGroup) === null || _state$topoConfig$vie === void 0 ? void 0 : _state$topoConfig$vie.id,
|
419
421
|
template: state.topoMod.type,
|
420
422
|
// 背景图
|
@@ -442,7 +444,7 @@ export default function (topoApp) {
|
|
442
444
|
case 0:
|
443
445
|
topoId = data.id, ciIdList = data.ciIdList;
|
444
446
|
_context7.next = 3;
|
445
|
-
return
|
447
|
+
return topoApp.serverApi.addToBlocklist(topoId, ciIdList);
|
446
448
|
|
447
449
|
case 3:
|
448
450
|
case "end":
|
@@ -400,7 +400,7 @@ export default function (topoApp) {
|
|
400
400
|
|
401
401
|
case 29:
|
402
402
|
_context6.next = 31;
|
403
|
-
return topoApp.options.loadData(topoId);
|
403
|
+
return topoApp.options.loadData(topoId, topoApp.serverApi);
|
404
404
|
|
405
405
|
case 31:
|
406
406
|
result = _context6.sent;
|
@@ -606,15 +606,16 @@ export default function (topoApp) {
|
|
606
606
|
|
607
607
|
case 4:
|
608
608
|
topoPermission = _context11.sent;
|
609
|
-
|
609
|
+
rlog.debug('查询拓扑权限', topoPermission);
|
610
|
+
_context11.next = 11;
|
610
611
|
break;
|
611
612
|
|
612
|
-
case
|
613
|
-
_context11.prev =
|
613
|
+
case 8:
|
614
|
+
_context11.prev = 8;
|
614
615
|
_context11.t0 = _context11["catch"](1);
|
615
616
|
rlog.error("\u67E5\u8BE2\u62D3\u6251" + id + "\u7684\u6743\u9650\u5931\u8D25", _context11.t0); // 尚未区分拓扑图不存在还是接口请求报错
|
616
617
|
|
617
|
-
case
|
618
|
+
case 11:
|
618
619
|
if (update !== false) {
|
619
620
|
_this8.update({
|
620
621
|
topoPermission: topoPermission
|
@@ -623,12 +624,12 @@ export default function (topoApp) {
|
|
623
624
|
|
624
625
|
return _context11.abrupt("return", topoPermission);
|
625
626
|
|
626
|
-
case
|
627
|
+
case 13:
|
627
628
|
case "end":
|
628
629
|
return _context11.stop();
|
629
630
|
}
|
630
631
|
}
|
631
|
-
}, _callee11, null, [[1,
|
632
|
+
}, _callee11, null, [[1, 8]]);
|
632
633
|
}))();
|
633
634
|
}
|
634
635
|
};
|
@@ -1,12 +1,11 @@
|
|
1
1
|
import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
|
2
2
|
import _regeneratorRuntime from "@babel/runtime/regenerator";
|
3
|
-
|
3
|
+
|
4
4
|
/**
|
5
5
|
* 增加保存拓扑序列化数据方法,以便于拓扑中心和业务拓扑使用
|
6
6
|
*
|
7
7
|
* @param {*} topo
|
8
8
|
*/
|
9
|
-
|
10
9
|
export default function saveSerialize(_x) {
|
11
10
|
return _saveSerialize.apply(this, arguments);
|
12
11
|
}
|
@@ -21,7 +20,7 @@ function _saveSerialize() {
|
|
21
20
|
topoId = topo.getId();
|
22
21
|
serialize = topo.getHtTopo().serialize();
|
23
22
|
_context.next = 4;
|
24
|
-
return
|
23
|
+
return topo.serverApi.saveSerializeData(topoId, serialize);
|
25
24
|
|
26
25
|
case 4:
|
27
26
|
case "end":
|
@@ -196,9 +196,20 @@ function ResourceDetailDrawer(props) {
|
|
196
196
|
}
|
197
197
|
|
198
198
|
var renderContent = function renderContent() {
|
199
|
-
|
199
|
+
// 支持自定义概览
|
200
|
+
var _ref = (viewerProps === null || viewerProps === void 0 ? void 0 : viewerProps.resourceDetailProps) || {},
|
201
|
+
getResourceDetail = _ref.getResourceDetail;
|
202
|
+
|
203
|
+
var ResourceDetailWidget;
|
204
|
+
|
205
|
+
if (getResourceDetail) {
|
206
|
+
ResourceDetailWidget = getResourceDetail(resourceData);
|
207
|
+
}
|
208
|
+
|
209
|
+
if (!ResourceDetailWidget) {
|
210
|
+
ResourceDetailWidget = ResourceDetail;
|
211
|
+
}
|
200
212
|
|
201
|
-
var ResourceDetailWidget = (viewerProps === null || viewerProps === void 0 ? void 0 : (_viewerProps$resource = viewerProps.resourceDetailProps) === null || _viewerProps$resource === void 0 ? void 0 : _viewerProps$resource.ResourceDetailWidget) || ResourceDetail;
|
202
213
|
return /*#__PURE__*/React.createElement(ResourceDetailWidget, _extends({}, props, {
|
203
214
|
topo: topo,
|
204
215
|
userId: userId,
|
package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/EventsCard.js
CHANGED
@@ -1,7 +1,6 @@
|
|
1
1
|
import _Message from "@alifd/next/es/message";
|
2
2
|
import _Table from "@alifd/next/es/table";
|
3
3
|
import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
|
4
|
-
import _Button from "@alifd/next/es/button";
|
5
4
|
import _Icon from "@alifd/next/es/icon";
|
6
5
|
import _regeneratorRuntime from "@babel/runtime/regenerator";
|
7
6
|
import React from 'react';
|
@@ -56,30 +55,34 @@ function EventsCard(props) {
|
|
56
55
|
title: moment(value).format('YYYY-MM-DD HH:mm:ss')
|
57
56
|
}, moment(value).format('YYYY-MM-DD HH:mm:ss'));
|
58
57
|
}
|
59
|
-
}
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
58
|
+
} // 临时屏蔽告警操作列,后续版本按权限显示 2023-3-6 20:23:45
|
59
|
+
// {
|
60
|
+
// title: '操作',
|
61
|
+
// dataIndex: 'status',
|
62
|
+
// key: 'status',
|
63
|
+
// width: 64,
|
64
|
+
// cell: (status, index, record) => {
|
65
|
+
// if (record.type === 'alarm') {
|
66
|
+
// return status === 'toDeal' ? (
|
67
|
+
// <Button
|
68
|
+
// text
|
69
|
+
// type="primary"
|
70
|
+
// onClick={() => alarmRiskOperation(record.type, record.params)}
|
71
|
+
// >
|
72
|
+
// 受理
|
73
|
+
// </Button>
|
74
|
+
// ) : (
|
75
|
+
// <Button disabled text type="primary">
|
76
|
+
// 已受理
|
77
|
+
// </Button>
|
78
|
+
// );
|
79
|
+
// } else {
|
80
|
+
// // return <Button text type="primary" onClick={() => alarmRiskOperation(record.type, record)}>受理</Button>
|
81
|
+
// return '';
|
82
|
+
// }
|
83
|
+
// },
|
84
|
+
// },
|
85
|
+
]; // 告警/风险 操作 (受理)
|
83
86
|
|
84
87
|
function alarmRiskOperation(_x, _x2) {
|
85
88
|
return _alarmRiskOperation.apply(this, arguments);
|
@@ -912,6 +912,8 @@ export default function ResourceOverview(props) {
|
|
912
912
|
defaultDisabledCol: ['display_name'],
|
913
913
|
max: 6,
|
914
914
|
columns: baseInfoCol,
|
915
|
+
getOverviewConfig: resourceOverviewProps.getOverviewConfig,
|
916
|
+
saveOverviewConfig: resourceOverviewProps.saveOverviewConfig,
|
915
917
|
onChange: baseInfoColChange
|
916
918
|
}));
|
917
919
|
}
|
@@ -932,6 +934,8 @@ export default function ResourceOverview(props) {
|
|
932
934
|
defaultCol: defaultCols.keyIndicators,
|
933
935
|
max: 6,
|
934
936
|
columns: metricCol,
|
937
|
+
getOverviewConfig: resourceOverviewProps.getOverviewConfig,
|
938
|
+
saveOverviewConfig: resourceOverviewProps.saveOverviewConfig,
|
935
939
|
onChange: metricColChange
|
936
940
|
})
|
937
941
|
}, /*#__PURE__*/React.createElement(ResourceOverviewMetric, {
|
@@ -33,7 +33,9 @@ function Configurator(props) {
|
|
33
33
|
type = props.type,
|
34
34
|
max = props.max,
|
35
35
|
_props$btnStyle = props.btnStyle,
|
36
|
-
btnStyle = _props$btnStyle === void 0 ? {} : _props$btnStyle
|
36
|
+
btnStyle = _props$btnStyle === void 0 ? {} : _props$btnStyle,
|
37
|
+
getOverviewConfig = props.getOverviewConfig,
|
38
|
+
saveOverviewConfig = props.saveOverviewConfig; // console.log('Configurator props', props);
|
37
39
|
|
38
40
|
var buttonRef = useRef(null);
|
39
41
|
|
@@ -71,35 +73,33 @@ function Configurator(props) {
|
|
71
73
|
|
72
74
|
function _init() {
|
73
75
|
_init = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee3() {
|
76
|
+
var _overviewConfig;
|
77
|
+
|
74
78
|
var overviewConfig, newPrevCols, newNextCols, oldCols, newCols;
|
75
79
|
return _regeneratorRuntime.wrap(function _callee3$(_context3) {
|
76
80
|
while (1) {
|
77
81
|
switch (_context3.prev = _context3.next) {
|
78
82
|
case 0:
|
83
|
+
overviewConfig = {};
|
84
|
+
|
79
85
|
if (!(topoId && templateCode)) {
|
80
|
-
_context3.next =
|
86
|
+
_context3.next = 5;
|
81
87
|
break;
|
82
88
|
}
|
83
89
|
|
84
|
-
_context3.next =
|
85
|
-
return service.getOverviewConfig(topoId, templateCode);
|
90
|
+
_context3.next = 4;
|
91
|
+
return (getOverviewConfig || service.getOverviewConfig)(topoId, templateCode);
|
86
92
|
|
87
|
-
case
|
88
|
-
|
89
|
-
_context3.next = 7;
|
90
|
-
break;
|
93
|
+
case 4:
|
94
|
+
overviewConfig = _context3.sent;
|
91
95
|
|
92
|
-
case
|
93
|
-
_context3.t0 = {};
|
94
|
-
|
95
|
-
case 7:
|
96
|
-
overviewConfig = _context3.t0;
|
96
|
+
case 5:
|
97
97
|
// console.log('overviewConfig', overviewConfig);
|
98
98
|
// const overviewConfig = ''
|
99
99
|
newPrevCols = [];
|
100
100
|
newNextCols = [];
|
101
101
|
|
102
|
-
if (overviewConfig !== null &&
|
102
|
+
if ((_overviewConfig = overviewConfig) !== null && _overviewConfig !== void 0 && _overviewConfig[type]) {
|
103
103
|
oldCols = JSON.parse(overviewConfig[type]) || []; // 已设置
|
104
104
|
|
105
105
|
oldCols.forEach(function (old_item) {
|
@@ -149,7 +149,7 @@ function Configurator(props) {
|
|
149
149
|
setOrgColumns(newCols);
|
150
150
|
onChange(newCols);
|
151
151
|
|
152
|
-
case
|
152
|
+
case 12:
|
153
153
|
case "end":
|
154
154
|
return _context3.stop();
|
155
155
|
}
|
@@ -227,7 +227,7 @@ function Configurator(props) {
|
|
227
227
|
|
228
228
|
var onOk = /*#__PURE__*/function () {
|
229
229
|
var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2() {
|
230
|
-
var
|
230
|
+
var _ref3;
|
231
231
|
|
232
232
|
return _regeneratorRuntime.wrap(function _callee2$(_context2) {
|
233
233
|
while (1) {
|
@@ -242,7 +242,7 @@ function Configurator(props) {
|
|
242
242
|
}
|
243
243
|
|
244
244
|
_context2.next = 5;
|
245
|
-
return service.saveOverviewConfig(topoId, templateCode, (
|
245
|
+
return (saveOverviewConfig || service.saveOverviewConfig)(topoId, templateCode, (_ref3 = {}, _ref3[type] = JSON.stringify(columnsState), _ref3));
|
246
246
|
|
247
247
|
case 5:
|
248
248
|
case "end":
|
@@ -3,34 +3,21 @@ import _extends from "@babel/runtime/helpers/extends";
|
|
3
3
|
import React from "react";
|
4
4
|
import EditButton from "./widgets/EditButton";
|
5
5
|
import NodesDragSwitch from "./widgets/NodesDragSwitchWrapper";
|
6
|
-
import AlarmListShowButton from "./widgets/AlarmListShowButton";
|
7
6
|
import SettingButton from "./widgets/SettingButtonWidget";
|
8
|
-
import
|
7
|
+
import AlarmButton from "./widgets/AlarmButton";
|
9
8
|
export default function BasicTools(props) {
|
10
9
|
var topo = props.topo,
|
11
10
|
_props$showEditButton = props.showEditButton,
|
12
11
|
showEditButton = _props$showEditButton === void 0 ? true : _props$showEditButton,
|
13
12
|
children = props.children;
|
14
|
-
|
15
|
-
var _topo$store$useModel = topo.store.useModel("topoAlarm"),
|
16
|
-
alarmState = _topo$store$useModel[0],
|
17
|
-
alarmDispatchers = _topo$store$useModel[1];
|
18
|
-
|
19
|
-
var alarmPanelIsOpen = alarmState.alarmPanelIsOpen;
|
20
|
-
var alarmData = useEventData({
|
21
|
-
topo: topo
|
22
|
-
});
|
23
13
|
return /*#__PURE__*/React.createElement(_Box, {
|
24
14
|
direction: "row",
|
25
15
|
spacing: 8
|
26
16
|
}, showEditButton && /*#__PURE__*/React.createElement(EditButton, _extends({
|
27
17
|
topo: topo
|
28
|
-
}, props)), /*#__PURE__*/React.createElement(
|
18
|
+
}, props)), /*#__PURE__*/React.createElement(AlarmButton, _extends({
|
29
19
|
topo: topo
|
30
|
-
}, props, {
|
31
|
-
alarmPanelIsOpen: alarmPanelIsOpen,
|
32
|
-
alarmData: alarmData
|
33
|
-
})), /*#__PURE__*/React.createElement(SettingButton, props), /*#__PURE__*/React.createElement(NodesDragSwitch, _extends({
|
20
|
+
}, props)), /*#__PURE__*/React.createElement(SettingButton, props), /*#__PURE__*/React.createElement(NodesDragSwitch, _extends({
|
34
21
|
topo: topo
|
35
22
|
}, props)), children);
|
36
23
|
}
|
@@ -0,0 +1,25 @@
|
|
1
|
+
import _extends from "@babel/runtime/helpers/extends";
|
2
|
+
import React from 'react';
|
3
|
+
import AlarmListShowButton from "./AlarmListShowButton";
|
4
|
+
import useEventData from "../../../../hooks/useEventData";
|
5
|
+
|
6
|
+
function AlarmButton(props) {
|
7
|
+
var topo = props.topo;
|
8
|
+
|
9
|
+
var _topo$store$useModel = topo.store.useModel("topoAlarm"),
|
10
|
+
alarmState = _topo$store$useModel[0],
|
11
|
+
alarmDispatchers = _topo$store$useModel[1];
|
12
|
+
|
13
|
+
var alarmPanelIsOpen = alarmState.alarmPanelIsOpen;
|
14
|
+
var alarmData = useEventData({
|
15
|
+
topo: topo
|
16
|
+
});
|
17
|
+
return /*#__PURE__*/React.createElement(AlarmListShowButton, _extends({
|
18
|
+
topo: topo
|
19
|
+
}, props, {
|
20
|
+
alarmPanelIsOpen: alarmPanelIsOpen,
|
21
|
+
alarmData: alarmData
|
22
|
+
}));
|
23
|
+
}
|
24
|
+
|
25
|
+
export default AlarmButton;
|
@@ -9,7 +9,10 @@ export default function LinkDataTab(props) {
|
|
9
9
|
|
10
10
|
var topo = props.topo,
|
11
11
|
edge = props.edge,
|
12
|
-
link = props.link
|
12
|
+
link = props.link,
|
13
|
+
source = props.source,
|
14
|
+
target = props.target,
|
15
|
+
editorProps = props.editorProps;
|
13
16
|
|
14
17
|
var _topo$store$useModel = topo.store.useModel("topoConfig"),
|
15
18
|
editState = _topo$store$useModel[0],
|
@@ -26,8 +29,11 @@ export default function LinkDataTab(props) {
|
|
26
29
|
className: styles.panelFullHeight
|
27
30
|
}, /*#__PURE__*/React.createElement(LindInfoPreview, {
|
28
31
|
className: styles.lindInfoPreview,
|
32
|
+
topo: topo,
|
29
33
|
data: link,
|
30
|
-
|
34
|
+
source: source,
|
35
|
+
target: target,
|
36
|
+
isCmpTopo: (editorProps === null || editorProps === void 0 ? void 0 : editorProps.topoType) === 'cmpTopo'
|
31
37
|
}), /*#__PURE__*/React.createElement("div", {
|
32
38
|
className: styles.footer
|
33
39
|
}, /*#__PURE__*/React.createElement(_Button, {
|
package/es/networkTopo/components/editor/propertyViews/edge/LinkPropertyView/LinkPropertyView.js
CHANGED
@@ -4,14 +4,10 @@ import React from 'react';
|
|
4
4
|
import Data from "./Data";
|
5
5
|
export default function LinkPropertyView(props) {
|
6
6
|
var edge = props.edge,
|
7
|
-
topo = props.topo;
|
8
|
-
|
9
|
-
var
|
10
|
-
|
11
|
-
linkGroups = _topo$store$useModelS.linkGroups;
|
12
|
-
var link = [].concat(links, linkGroups).find(function (item) {
|
13
|
-
return item.id === edge.getTag();
|
14
|
-
});
|
7
|
+
topo = props.topo;
|
8
|
+
var link = topo.dataModel.useDataById(edge.getTag());
|
9
|
+
var source = topo.dataModel.useDataById(link.source);
|
10
|
+
var target = topo.dataModel.useDataById(link.target); // 无权限不显示数据页签
|
15
11
|
|
16
12
|
if (link) {
|
17
13
|
var readable = link.permission.readable;
|
@@ -26,6 +22,8 @@ export default function LinkPropertyView(props) {
|
|
26
22
|
}
|
27
23
|
|
28
24
|
return /*#__PURE__*/React.createElement(Data, _extends({}, props, {
|
29
|
-
link: link
|
25
|
+
link: link,
|
26
|
+
source: source,
|
27
|
+
target: target
|
30
28
|
}));
|
31
29
|
}
|