@riil-frontend/component-topology 10.0.58 → 10.0.59
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/1.js +2 -2
- package/build/2.js +1 -1
- package/build/index.css +4 -2
- package/build/index.js +52 -45
- package/es/components/IndexSettingDrawer/index.js +6 -5
- package/es/components/MultiResourceDrawer/index.js +22 -26
- package/es/components/ResourceList/ResourceSelect.js +55 -58
- package/es/components/ResourceSelectDrawer/ResourceSelectDrawer.js +30 -34
- package/es/components/SingleResourceDrawer/SelectDrawer.js +24 -28
- package/es/core/components/DisplaySettingDrawer/DisplaySettingDrawer.js +29 -33
- package/es/core/components/DisplaySettingDrawer/ResourceDisplay/useElementTagTipConfig.js +78 -100
- package/es/core/components/DisplaySettingDrawer/hooks/useDisplaySetting.js +92 -108
- package/es/core/components/titlebar/widgets/TitleWidget.js +5 -4
- package/es/core/editor/components/BackgroundView/UploadDialog/index.js +17 -18
- package/es/core/editor/components/BackgroundView/index.js +149 -178
- package/es/core/editor/components/CustomIconPlugin/RenameDialog.js +26 -30
- package/es/core/editor/components/CustomIconPlugin/UploadIconDialog.js +33 -34
- package/es/core/editor/components/CustomIconPlugin/utils/svgToShape.js +20 -24
- package/es/core/editor/components/GroupAddResourceDrawerPlugin/GroupAddResourceDrawer.js +13 -17
- package/es/core/editor/components/Sidebar/views/CanvasPanel/hooks/useCanvasThemeConfig.js +45 -56
- package/es/core/editor/components/Toolbar/widgets/BoxBackgroundButton/BoxBackgroundSetting.js +60 -70
- package/es/core/editor/components/Toolbar/widgets/FontColorButton.js +60 -70
- package/es/core/editor/components/settings/propertyViews/layer/DataTab/DefaultLayerAddResourceDrawer.js +17 -21
- package/es/core/editor/components/settings/propertyViews/node/data/BindResourceDrawer.js +27 -31
- package/es/core/editor/components/settings/propertyViews/node/data/Data.js +21 -25
- package/es/core/editor/components/settings/propertyViews/view/BackgroundSize.js +16 -20
- package/es/core/editor/components/titlebar/TopoEditorTitleBar.js +37 -55
- package/es/core/editor/hooks/useKeyboardShortcut.js +2 -2
- package/es/core/editor/hooks/useNewElementTheme.js +2 -2
- package/es/core/editor/store/background.js +8 -10
- package/es/core/editor/store/topoEdit.js +4 -6
- package/es/core/editor/utils/edgeTypeStyleUtil.js +2 -4
- package/es/core/hooks/usePolling.js +110 -122
- package/es/core/hooks/useResourceConfig.js +76 -100
- package/es/core/hooks/useTopoEdit.js +539 -638
- package/es/core/models/Alarm.js +311 -394
- package/es/core/models/AttributeMetricDisplay.js +115 -143
- package/es/core/models/PluginManager.js +4 -3
- package/es/core/models/SelectionModel.js +4 -5
- package/es/core/models/TopoApp.js +287 -454
- package/es/core/models/TopoGraphView.js +28 -41
- package/es/core/models/cache/CiCache.js +34 -39
- package/es/core/models/cache/CiTypeCache.js +70 -84
- package/es/core/models/cache/DictCache.js +36 -42
- package/es/core/models/graph/Background.js +21 -26
- package/es/core/models/plugins/resourceWebControllUrl.js +84 -103
- package/es/core/models/tagstips/ElementTagTipConfig.js +34 -40
- package/es/core/models/topoData.js +73 -77
- package/es/core/models/utils/linkUtils.js +46 -51
- package/es/core/services/alarm.js +14 -16
- package/es/core/services/background.js +59 -67
- package/es/core/services/cmdb/metric.js +14 -18
- package/es/core/services/cmdb.js +23 -27
- package/es/core/services/index.js +48 -68
- package/es/core/services/overview.js +131 -151
- package/es/core/services/topo/basic.js +11 -13
- package/es/core/services/topo/tagtip.js +15 -19
- package/es/core/store/models/ciModel.js +58 -62
- package/es/core/store/models/customIcon.js +126 -145
- package/es/core/store/models/displayConfig.js +15 -19
- package/es/core/store/models/selection.js +4 -6
- package/es/core/store/models/topoAlarm.js +162 -145
- package/es/core/store/models/topoBaseInfoOverview.js +4 -6
- package/es/core/store/models/topoBizMod.js +28 -32
- package/es/core/store/models/topoConfig.js +217 -233
- package/es/core/store/models/topoGraphView.js +4 -6
- package/es/core/store/models/topoMod.js +379 -401
- package/es/core/utils/imageUtil.js +23 -27
- package/es/core/utils/saveSerialize.js +14 -18
- package/es/core/viewer/components/plugins/ResourceDetail/components/ClusterMemberTable.js +62 -66
- package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/EventsCard.js +20 -25
- package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/ResourceOverview.js +363 -409
- package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/components/Configurator/index.js +112 -131
- package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/components/LinkTopo/LinkTopoCard.js +40 -46
- package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/components/LinkTopo/services/index.js +219 -275
- package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/hooks/useAlarmAndRiskData.js +113 -118
- package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/hooks/useMetricModels.js +63 -68
- package/es/core/viewer/components/plugins/ResourceDetail/components/WebConsole/WebConsoleForm/hooks/useWebConsole.js +45 -54
- package/es/core/viewer/components/plugins/ResourceDetail/getCiDisplayMetricModels.js +32 -44
- package/es/core/viewer/components/plugins/ResourceDetail/hooks/useUserId.js +36 -43
- package/es/core/viewer/components/plugins/ResourceWebControllUrlSettingDialog.js +23 -27
- package/es/networkTopo/components/Link/hook.js +85 -96
- package/es/networkTopo/components/Link/index copy.js +104 -126
- package/es/networkTopo/components/Link/index.js +104 -126
- package/es/networkTopo/components/Link/setting.js +48 -52
- package/es/networkTopo/getTopoData.js +73 -92
- package/es/networkTopo/hooks/viewer/useRelateTopo.js +34 -39
- package/es/networkTopo/models/LinkDynamicStyleExecutor.js +2 -2
- package/es/networkTopo/models/TopoCenter.js +28 -46
- package/es/networkTopo/services/alert.js +18 -22
- package/es/networkTopo/services/authorization.js +45 -55
- package/es/networkTopo/services/cmdb.js +548 -696
- package/es/networkTopo/services/funcAuth.js +22 -24
- package/es/networkTopo/services/link.js +107 -117
- package/es/networkTopo/services/mdc.js +33 -48
- package/es/networkTopo/services/metric.js +38 -47
- package/es/networkTopo/services/model.js +616 -809
- package/es/networkTopo/services/risk.js +9 -11
- package/es/networkTopo/services/topo/auth.js +27 -33
- package/es/networkTopo/services/topo/basic.js +274 -314
- package/es/networkTopo/services/topo/blacklist.js +20 -24
- package/es/networkTopo/services/topo/ciInfo.js +27 -31
- package/es/networkTopo/services/topo/icon.js +49 -59
- package/es/networkTopo/services/topo/networkLink.js +32 -36
- package/es/networkTopo/services/topo/relation.js +9 -11
- package/es/networkTopo/services/topo/resourceWebUrl.js +36 -42
- package/es/networkTopo/store/functionAuth.js +31 -37
- package/es/networkTopo/store/linkDynamicStyle.js +102 -108
- package/es/networkTopo/store/linkDynamicStyleConfig.js +42 -44
- package/es/networkTopo/store/linkManager.js +4 -6
- package/es/networkTopo/store/topoCenter.js +142 -152
- package/es/networkTopo/store/topoLinkMod.js +4 -6
- package/es/networkTopo/store/topoTreeMod.js +170 -182
- package/es/networkTopo/utils/exportData.js +57 -61
- package/lib/components/IndexSettingDrawer/index.js +6 -5
- package/lib/components/MultiResourceDrawer/index.js +22 -26
- package/lib/components/ResourceList/ResourceSelect.js +54 -58
- package/lib/components/ResourceSelectDrawer/ResourceSelectDrawer.js +33 -37
- package/lib/components/SingleResourceDrawer/SelectDrawer.js +24 -28
- package/lib/core/components/DisplaySettingDrawer/DisplaySettingDrawer.js +36 -40
- package/lib/core/components/DisplaySettingDrawer/ResourceDisplay/useElementTagTipConfig.js +82 -104
- package/lib/core/components/DisplaySettingDrawer/hooks/useDisplaySetting.js +92 -108
- package/lib/core/components/titlebar/widgets/TitleWidget.js +5 -4
- package/lib/core/editor/components/BackgroundView/UploadDialog/index.js +18 -18
- package/lib/core/editor/components/BackgroundView/index.js +148 -177
- package/lib/core/editor/components/CustomIconPlugin/RenameDialog.js +28 -32
- package/lib/core/editor/components/CustomIconPlugin/UploadIconDialog.js +34 -34
- package/lib/core/editor/components/CustomIconPlugin/utils/svgToShape.js +23 -28
- package/lib/core/editor/components/GroupAddResourceDrawerPlugin/GroupAddResourceDrawer.js +14 -18
- package/lib/core/editor/components/Sidebar/views/CanvasPanel/hooks/useCanvasThemeConfig.js +45 -56
- package/lib/core/editor/components/Toolbar/widgets/BoxBackgroundButton/BoxBackgroundSetting.js +60 -70
- package/lib/core/editor/components/Toolbar/widgets/FontColorButton.js +60 -70
- package/lib/core/editor/components/settings/propertyViews/layer/DataTab/DefaultLayerAddResourceDrawer.js +18 -22
- package/lib/core/editor/components/settings/propertyViews/node/data/BindResourceDrawer.js +32 -36
- package/lib/core/editor/components/settings/propertyViews/node/data/Data.js +21 -25
- package/lib/core/editor/components/settings/propertyViews/view/BackgroundSize.js +18 -22
- package/lib/core/editor/components/titlebar/TopoEditorTitleBar.js +41 -59
- package/lib/core/editor/hooks/useKeyboardShortcut.js +2 -2
- package/lib/core/editor/hooks/useNewElementTheme.js +2 -2
- package/lib/core/editor/store/background.js +8 -10
- package/lib/core/editor/store/topoEdit.js +4 -6
- package/lib/core/editor/utils/edgeTypeStyleUtil.js +2 -4
- package/lib/core/hooks/usePolling.js +108 -120
- package/lib/core/hooks/useResourceConfig.js +76 -100
- package/lib/core/hooks/useTopoEdit.js +530 -629
- package/lib/core/models/Alarm.js +308 -391
- package/lib/core/models/AttributeMetricDisplay.js +118 -146
- package/lib/core/models/PluginManager.js +4 -3
- package/lib/core/models/SelectionModel.js +4 -5
- package/lib/core/models/TopoApp.js +287 -454
- package/lib/core/models/TopoGraphView.js +28 -41
- package/lib/core/models/cache/CiCache.js +39 -44
- package/lib/core/models/cache/CiTypeCache.js +71 -85
- package/lib/core/models/cache/DictCache.js +39 -45
- package/lib/core/models/graph/Background.js +22 -27
- package/lib/core/models/plugins/resourceWebControllUrl.js +82 -101
- package/lib/core/models/tagstips/ElementTagTipConfig.js +34 -40
- package/lib/core/models/topoData.js +73 -78
- package/lib/core/models/utils/linkUtils.js +45 -51
- package/lib/core/services/alarm.js +18 -20
- package/lib/core/services/background.js +70 -78
- package/lib/core/services/cmdb/metric.js +14 -19
- package/lib/core/services/cmdb.js +24 -29
- package/lib/core/services/index.js +53 -72
- package/lib/core/services/overview.js +131 -151
- package/lib/core/services/topo/basic.js +13 -15
- package/lib/core/services/topo/tagtip.js +16 -21
- package/lib/core/store/models/ciModel.js +66 -70
- package/lib/core/store/models/customIcon.js +126 -145
- package/lib/core/store/models/displayConfig.js +15 -19
- package/lib/core/store/models/selection.js +4 -6
- package/lib/core/store/models/topoAlarm.js +163 -145
- package/lib/core/store/models/topoBaseInfoOverview.js +4 -6
- package/lib/core/store/models/topoBizMod.js +34 -38
- package/lib/core/store/models/topoConfig.js +224 -240
- package/lib/core/store/models/topoGraphView.js +4 -6
- package/lib/core/store/models/topoMod.js +381 -403
- package/lib/core/utils/imageUtil.js +26 -31
- package/lib/core/utils/saveSerialize.js +13 -18
- package/lib/core/viewer/components/plugins/ResourceDetail/components/ClusterMemberTable.js +62 -66
- package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/EventsCard.js +21 -26
- package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/ResourceOverview.js +364 -410
- package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/components/Configurator/index.js +114 -133
- package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/components/LinkTopo/LinkTopoCard.js +44 -50
- package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/components/LinkTopo/services/index.js +220 -274
- package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/hooks/useAlarmAndRiskData.js +113 -118
- package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/hooks/useMetricModels.js +63 -68
- package/lib/core/viewer/components/plugins/ResourceDetail/components/WebConsole/WebConsoleForm/hooks/useWebConsole.js +40 -50
- package/lib/core/viewer/components/plugins/ResourceDetail/getCiDisplayMetricModels.js +35 -47
- package/lib/core/viewer/components/plugins/ResourceDetail/hooks/useUserId.js +36 -43
- package/lib/core/viewer/components/plugins/ResourceWebControllUrlSettingDialog.js +24 -28
- package/lib/networkTopo/components/Link/hook.js +86 -98
- package/lib/networkTopo/components/Link/index copy.js +105 -127
- package/lib/networkTopo/components/Link/index.js +105 -127
- package/lib/networkTopo/components/Link/setting.js +48 -52
- package/lib/networkTopo/getTopoData.js +73 -92
- package/lib/networkTopo/hooks/viewer/useRelateTopo.js +35 -40
- package/lib/networkTopo/models/LinkDynamicStyleExecutor.js +2 -2
- package/lib/networkTopo/models/TopoCenter.js +28 -46
- package/lib/networkTopo/services/alert.js +18 -22
- package/lib/networkTopo/services/authorization.js +55 -65
- package/lib/networkTopo/services/cmdb.js +551 -700
- package/lib/networkTopo/services/funcAuth.js +24 -26
- package/lib/networkTopo/services/link.js +108 -118
- package/lib/networkTopo/services/mdc.js +35 -51
- package/lib/networkTopo/services/metric.js +37 -47
- package/lib/networkTopo/services/model.js +615 -809
- package/lib/networkTopo/services/risk.js +11 -13
- package/lib/networkTopo/services/topo/auth.js +27 -33
- package/lib/networkTopo/services/topo/basic.js +277 -317
- package/lib/networkTopo/services/topo/blacklist.js +20 -24
- package/lib/networkTopo/services/topo/ciInfo.js +34 -38
- package/lib/networkTopo/services/topo/icon.js +59 -69
- package/lib/networkTopo/services/topo/networkLink.js +32 -36
- package/lib/networkTopo/services/topo/relation.js +11 -13
- package/lib/networkTopo/services/topo/resourceWebUrl.js +44 -50
- package/lib/networkTopo/store/functionAuth.js +31 -37
- package/lib/networkTopo/store/linkDynamicStyle.js +103 -109
- package/lib/networkTopo/store/linkDynamicStyleConfig.js +42 -44
- package/lib/networkTopo/store/linkManager.js +4 -6
- package/lib/networkTopo/store/topoCenter.js +142 -152
- package/lib/networkTopo/store/topoLinkMod.js +4 -6
- package/lib/networkTopo/store/topoTreeMod.js +166 -178
- package/lib/networkTopo/utils/exportData.js +63 -68
- package/package.json +3 -3
@@ -62,6 +62,8 @@ function getBindType(values) {
|
|
62
62
|
}
|
63
63
|
|
64
64
|
function Data(props) {
|
65
|
+
var _ref;
|
66
|
+
|
65
67
|
var node = props.node,
|
66
68
|
topo = props.topo,
|
67
69
|
topoEditApi = props.topoEditApi,
|
@@ -100,34 +102,28 @@ function Data(props) {
|
|
100
102
|
}
|
101
103
|
};
|
102
104
|
|
103
|
-
var handleBindTopoChange =
|
104
|
-
|
105
|
+
var handleBindTopoChange = function handleBindTopoChange(_x, _x2) {
|
106
|
+
return (_ref = _ref || (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee(value, data) {
|
105
107
|
return _regenerator["default"].wrap(function _callee$(_context) {
|
106
|
-
while (1) {
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
return _context.stop();
|
122
|
-
}
|
108
|
+
while (1) switch (_context.prev = _context.next) {
|
109
|
+
case 0:
|
110
|
+
topo.historyManager.beginTransaction(); // 设置名称为拓扑名称,清空自定义名称
|
111
|
+
|
112
|
+
node.a('name', data.label);
|
113
|
+
node.a('customName', null);
|
114
|
+
_context.next = 5;
|
115
|
+
return topoEditApi.deleteExLink(node);
|
116
|
+
|
117
|
+
case 5:
|
118
|
+
topo.historyManager.endTransaction();
|
119
|
+
|
120
|
+
case 6:
|
121
|
+
case "end":
|
122
|
+
return _context.stop();
|
123
123
|
}
|
124
124
|
}, _callee);
|
125
|
-
}));
|
126
|
-
|
127
|
-
return function handleBindTopoChange(_x, _x2) {
|
128
|
-
return _ref.apply(this, arguments);
|
129
|
-
};
|
130
|
-
}();
|
125
|
+
}))).apply(this, arguments);
|
126
|
+
};
|
131
127
|
|
132
128
|
var RelateTopoTree = editorProps === null || editorProps === void 0 ? void 0 : editorProps.relateTopoTree;
|
133
129
|
return /*#__PURE__*/_react["default"].createElement(_collapse["default"], {
|
@@ -16,6 +16,8 @@ var _NodeSizeInput = _interopRequireDefault(require("../../common/NodeSizeInput/
|
|
16
16
|
var _useBackgroundSizeConfig = _interopRequireDefault(require("./hooks/useBackgroundSizeConfig"));
|
17
17
|
|
18
18
|
function BackgroundSize(props) {
|
19
|
+
var _ref;
|
20
|
+
|
19
21
|
var topo = props.topo,
|
20
22
|
backgroundConfig = props.backgroundConfig,
|
21
23
|
settingRuntimeState = props.settingRuntimeState;
|
@@ -24,31 +26,25 @@ function BackgroundSize(props) {
|
|
24
26
|
current: backgroundConfig.current
|
25
27
|
});
|
26
28
|
|
27
|
-
var setSize =
|
28
|
-
|
29
|
+
var setSize = function setSize(_x) {
|
30
|
+
return (_ref = _ref || (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee(size) {
|
29
31
|
return _regenerator["default"].wrap(function _callee$(_context) {
|
30
|
-
while (1) {
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
return _context.stop();
|
43
|
-
}
|
32
|
+
while (1) switch (_context.prev = _context.next) {
|
33
|
+
case 0:
|
34
|
+
topo.historyManager.beginTransaction();
|
35
|
+
_context.next = 3;
|
36
|
+
return backgroundSizeConfig.setSize(size);
|
37
|
+
|
38
|
+
case 3:
|
39
|
+
topo.historyManager.endTransaction();
|
40
|
+
|
41
|
+
case 4:
|
42
|
+
case "end":
|
43
|
+
return _context.stop();
|
44
44
|
}
|
45
45
|
}, _callee);
|
46
|
-
}));
|
47
|
-
|
48
|
-
return function setSize(_x) {
|
49
|
-
return _ref.apply(this, arguments);
|
50
|
-
};
|
51
|
-
}();
|
46
|
+
}))).apply(this, arguments);
|
47
|
+
};
|
52
48
|
|
53
49
|
return /*#__PURE__*/_react["default"].createElement(_NodeSizeInput["default"], {
|
54
50
|
nodeId: backgroundSizeConfig.nodeId,
|
@@ -34,6 +34,8 @@ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "functio
|
|
34
34
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
35
35
|
|
36
36
|
function TopoEditorTitleBar(props) {
|
37
|
+
var _ref;
|
38
|
+
|
37
39
|
var topo = props.topo,
|
38
40
|
topoEditApi = props.topoEditApi;
|
39
41
|
var store = topo.store;
|
@@ -48,30 +50,24 @@ function TopoEditorTitleBar(props) {
|
|
48
50
|
exitFlag = _useState[0],
|
49
51
|
setExitFlag = _useState[1];
|
50
52
|
|
51
|
-
var saveAndExit =
|
52
|
-
|
53
|
+
var saveAndExit = function saveAndExit() {
|
54
|
+
return (_ref = _ref || (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee() {
|
53
55
|
return _regenerator["default"].wrap(function _callee$(_context) {
|
54
|
-
while (1) {
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
return _context.stop();
|
66
|
-
}
|
56
|
+
while (1) switch (_context.prev = _context.next) {
|
57
|
+
case 0:
|
58
|
+
_context.next = 2;
|
59
|
+
return topo.save();
|
60
|
+
|
61
|
+
case 2:
|
62
|
+
setExitFlag(true);
|
63
|
+
|
64
|
+
case 3:
|
65
|
+
case "end":
|
66
|
+
return _context.stop();
|
67
67
|
}
|
68
68
|
}, _callee);
|
69
|
-
}));
|
70
|
-
|
71
|
-
return function saveAndExit() {
|
72
|
-
return _ref.apply(this, arguments);
|
73
|
-
};
|
74
|
-
}();
|
69
|
+
}))).apply(this, arguments);
|
70
|
+
};
|
75
71
|
|
76
72
|
(0, _react.useEffect)(function () {
|
77
73
|
if (!saving && exitFlag) {
|
@@ -100,53 +96,39 @@ function TopoEditorTitleBar(props) {
|
|
100
96
|
}, "\u4FDD\u5B58"), /*#__PURE__*/_react["default"].createElement(_button["default"], {
|
101
97
|
className: _TitleBarModule["default"].button,
|
102
98
|
onClick: function onClick() {
|
99
|
+
var _onOk, _onCancel;
|
100
|
+
|
103
101
|
_dialog["default"].confirm({
|
104
102
|
title: '提示',
|
105
103
|
content: '若直接退出,图上修改的内容将不会保存!',
|
106
|
-
onOk: function () {
|
107
|
-
|
104
|
+
onOk: function onOk() {
|
105
|
+
return (_onOk = _onOk || (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee2() {
|
108
106
|
return _regenerator["default"].wrap(function _callee2$(_context2) {
|
109
|
-
while (1) {
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
return _context2.stop();
|
117
|
-
}
|
107
|
+
while (1) switch (_context2.prev = _context2.next) {
|
108
|
+
case 0:
|
109
|
+
saveAndExit();
|
110
|
+
|
111
|
+
case 1:
|
112
|
+
case "end":
|
113
|
+
return _context2.stop();
|
118
114
|
}
|
119
115
|
}, _callee2);
|
120
|
-
}));
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
}
|
125
|
-
|
126
|
-
return onOk;
|
127
|
-
}(),
|
128
|
-
onCancel: function () {
|
129
|
-
var _onCancel = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee3() {
|
116
|
+
}))).apply(this, arguments);
|
117
|
+
},
|
118
|
+
onCancel: function onCancel() {
|
119
|
+
return (_onCancel = _onCancel || (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee3() {
|
130
120
|
return _regenerator["default"].wrap(function _callee3$(_context3) {
|
131
|
-
while (1) {
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
return _context3.stop();
|
139
|
-
}
|
121
|
+
while (1) switch (_context3.prev = _context3.next) {
|
122
|
+
case 0:
|
123
|
+
topo.exitEditMode();
|
124
|
+
|
125
|
+
case 1:
|
126
|
+
case "end":
|
127
|
+
return _context3.stop();
|
140
128
|
}
|
141
129
|
}, _callee3);
|
142
|
-
}));
|
143
|
-
|
144
|
-
function onCancel() {
|
145
|
-
return _onCancel.apply(this, arguments);
|
146
|
-
}
|
147
|
-
|
148
|
-
return onCancel;
|
149
|
-
}(),
|
130
|
+
}))).apply(this, arguments);
|
131
|
+
},
|
150
132
|
cancelProps: {
|
151
133
|
children: '退出'
|
152
134
|
},
|
@@ -34,8 +34,8 @@ function useKeyboardShortcut(props) {
|
|
34
34
|
|
35
35
|
if (e.keyCode === 32 && e.target.nodeName !== 'TEXTAREA') {
|
36
36
|
// 空格
|
37
|
-
var _topo$store$
|
38
|
-
viewMouseMode = _topo$store$
|
37
|
+
var _topo$store$getModelS2 = topo.store.getModelState('topoEdit'),
|
38
|
+
viewMouseMode = _topo$store$getModelS2.viewMouseMode;
|
39
39
|
|
40
40
|
topoEdit.setViewMouseMode(viewMouseMode === 'select' ? 'move' : 'select');
|
41
41
|
}
|
@@ -36,10 +36,10 @@ function useNewElementTheme(props) {
|
|
36
36
|
return item.name === theme;
|
37
37
|
});
|
38
38
|
|
39
|
-
var
|
39
|
+
var _ThemeUtil2 = (0, _themeUtil["default"])({
|
40
40
|
topo: topo
|
41
41
|
}),
|
42
|
-
setElementTheme =
|
42
|
+
setElementTheme = _ThemeUtil2.setElementTheme;
|
43
43
|
|
44
44
|
setElementTheme(data, themeConfig);
|
45
45
|
}
|
@@ -46,17 +46,15 @@ var _default = {
|
|
46
46
|
|
47
47
|
return (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee() {
|
48
48
|
return _regenerator["default"].wrap(function _callee$(_context) {
|
49
|
-
while (1) {
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
});
|
49
|
+
while (1) switch (_context.prev = _context.next) {
|
50
|
+
case 0:
|
51
|
+
_this.update({
|
52
|
+
current: extraConfig.background
|
53
|
+
});
|
55
54
|
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
}
|
55
|
+
case 1:
|
56
|
+
case "end":
|
57
|
+
return _context.stop();
|
60
58
|
}
|
61
59
|
}, _callee);
|
62
60
|
}))();
|
@@ -48,12 +48,10 @@ function _default(topo) {
|
|
48
48
|
init: function init(payload, rootState) {
|
49
49
|
return (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee() {
|
50
50
|
return _regenerator["default"].wrap(function _callee$(_context) {
|
51
|
-
while (1) {
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
return _context.stop();
|
56
|
-
}
|
51
|
+
while (1) switch (_context.prev = _context.next) {
|
52
|
+
case 0:
|
53
|
+
case "end":
|
54
|
+
return _context.stop();
|
57
55
|
}
|
58
56
|
}, _callee);
|
59
57
|
}))();
|
@@ -79,14 +79,12 @@ function isNodeAllEdges(topo) {
|
|
79
79
|
return nodeLineList[i]._id == edge._id;
|
80
80
|
}).length == 0) {
|
81
81
|
inEdges = true;
|
82
|
-
return
|
82
|
+
return 1; // break
|
83
83
|
}
|
84
84
|
};
|
85
85
|
|
86
86
|
for (var i = 0; i < nodeLineList.length; i++) {
|
87
|
-
|
88
|
-
|
89
|
-
if (_ret === "break") break;
|
87
|
+
if (_loop(i)) break;
|
90
88
|
}
|
91
89
|
});
|
92
90
|
return inEdges;
|
@@ -34,6 +34,8 @@ var _useHtDataPropertyChangeListener = _interopRequireDefault(require("./ht/useH
|
|
34
34
|
* @param {*} props
|
35
35
|
*/
|
36
36
|
var usePolling = function usePolling(props) {
|
37
|
+
var _fetchData, _refresh;
|
38
|
+
|
37
39
|
var topo = props.topo;
|
38
40
|
var store = topo.store;
|
39
41
|
(0, _useCiAttributeChange["default"])({
|
@@ -52,140 +54,126 @@ var usePolling = function usePolling(props) {
|
|
52
54
|
*/
|
53
55
|
|
54
56
|
function fetchData() {
|
55
|
-
return _fetchData
|
56
|
-
}
|
57
|
-
/**
|
58
|
-
*
|
59
|
-
* @returns {{id, attributes: object[], metrics: object[]}[]} 属性和指标
|
60
|
-
*/
|
61
|
-
|
62
|
-
|
63
|
-
function _fetchData() {
|
64
|
-
_fetchData = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee() {
|
57
|
+
return (_fetchData = _fetchData || (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee() {
|
65
58
|
var _topo$store$getModelS, resIdsList, nodeIdsList, codes, param, _yield$Promise$all, ciMetricResult, transformLinkData;
|
66
59
|
|
67
60
|
return _regenerator["default"].wrap(function _callee$(_context) {
|
68
|
-
while (1) {
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
61
|
+
while (1) switch (_context.prev = _context.next) {
|
62
|
+
case 0:
|
63
|
+
transformLinkData = function _transformLinkData(data) {
|
64
|
+
var _topo$dataModel$getDa = topo.dataModel.getData(),
|
65
|
+
links = _topo$dataModel$getDa.links,
|
66
|
+
linkGroups = _topo$dataModel$getDa.linkGroups;
|
67
|
+
|
68
|
+
var link = [].concat(links, linkGroups).find(function (item) {
|
69
|
+
return item.id === data.id;
|
70
|
+
});
|
71
|
+
|
72
|
+
if (!link) {
|
73
|
+
return data;
|
74
|
+
}
|
75
|
+
|
76
|
+
return (0, _extends2["default"])({}, data, {
|
77
|
+
attributeMap: link.attributes || {}
|
78
|
+
});
|
79
|
+
};
|
80
|
+
|
81
|
+
_topo$store$getModelS = topo.store.getModelState('topoBizMod').resAndMetrics, resIdsList = _topo$store$getModelS.resIdsList, nodeIdsList = _topo$store$getModelS.nodeIdsList; // rlog.debug('根据ci的id获取属性的值-getCiArrByIds', resIdsList, metrics);
|
82
|
+
// 无资源,不查询
|
83
|
+
|
84
|
+
if (resIdsList.length) {
|
85
|
+
_context.next = 4;
|
86
|
+
break;
|
87
|
+
}
|
88
|
+
|
89
|
+
return _context.abrupt("return", []);
|
90
|
+
|
91
|
+
case 4:
|
92
|
+
// 需要查询的指标列表
|
93
|
+
codes = topo.attributeMetricDisplay.getResourceMetricCodes();
|
94
|
+
param = {
|
95
|
+
ciId: nodeIdsList,
|
96
|
+
codes: codes,
|
97
|
+
// 过滤掉不需要查询的
|
98
|
+
relationId: topo.attributeMetricDisplay.getEdges().map(function (edge) {
|
99
|
+
return {
|
100
|
+
ciId: edge.id,
|
101
|
+
operation: edge.operation
|
102
|
+
};
|
103
|
+
})
|
104
|
+
};
|
105
|
+
_context.t0 = Promise;
|
106
|
+
_context.t1 = // 查询指标值
|
107
|
+
_topo["default"].ciInfo.batchQueryCiInfo(param);
|
108
|
+
_context.next = 10;
|
109
|
+
return _DictCache["default"].init();
|
110
|
+
|
111
|
+
case 10:
|
112
|
+
_context.t2 = _context.sent;
|
113
|
+
_context.t3 = [_context.t1, _context.t2];
|
114
|
+
_context.next = 14;
|
115
|
+
return _context.t0.all.call(_context.t0, _context.t3);
|
116
|
+
|
117
|
+
case 14:
|
118
|
+
_yield$Promise$all = _context.sent;
|
119
|
+
ciMetricResult = _yield$Promise$all[0];
|
120
|
+
return _context.abrupt("return", ciMetricResult.map(function (data) {
|
121
|
+
var ci = topo.dataModel.getDataById(data.id);
|
122
|
+
var resultData = (0, _extends2["default"])({}, data, ci, {
|
123
|
+
attributeMap: (0, _extends2["default"])({}, (ci === null || ci === void 0 ? void 0 : ci.attributes) || {})
|
124
|
+
});
|
125
|
+
resultData = transformLinkData(resultData); // 特殊处理:ipv6 从ipv6_address_list取第一个
|
126
|
+
|
127
|
+
// 特殊处理:ipv6 从ipv6_address_list取第一个
|
128
|
+
if (resultData.attributeMap.ipv6_address_list && !resultData.attributeMap.ipv6_address) {
|
129
|
+
resultData.attributeMap.ipv6_address = (resultData.attributeMap.ipv6_address_list || '').split(',')[0];
|
95
130
|
}
|
96
131
|
|
97
|
-
return
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
ciId: nodeIdsList,
|
104
|
-
codes: codes,
|
105
|
-
// 过滤掉不需要查询的
|
106
|
-
relationId: topo.attributeMetricDisplay.getEdges().map(function (edge) {
|
107
|
-
return {
|
108
|
-
ciId: edge.id,
|
109
|
-
operation: edge.operation
|
110
|
-
};
|
111
|
-
})
|
112
|
-
};
|
113
|
-
_context.t0 = Promise;
|
114
|
-
_context.t1 = // 查询指标值
|
115
|
-
_topo["default"].ciInfo.batchQueryCiInfo(param);
|
116
|
-
_context.next = 10;
|
117
|
-
return _DictCache["default"].init();
|
118
|
-
|
119
|
-
case 10:
|
120
|
-
_context.t2 = _context.sent;
|
121
|
-
_context.t3 = [_context.t1, _context.t2];
|
122
|
-
_context.next = 14;
|
123
|
-
return _context.t0.all.call(_context.t0, _context.t3);
|
124
|
-
|
125
|
-
case 14:
|
126
|
-
_yield$Promise$all = _context.sent;
|
127
|
-
ciMetricResult = _yield$Promise$all[0];
|
128
|
-
return _context.abrupt("return", ciMetricResult.map(function (data) {
|
129
|
-
var ci = topo.dataModel.getDataById(data.id);
|
130
|
-
var resultData = (0, _extends2["default"])({}, data, ci, {
|
131
|
-
attributeMap: (0, _extends2["default"])({}, (ci === null || ci === void 0 ? void 0 : ci.attributes) || {})
|
132
|
-
});
|
133
|
-
resultData = transformLinkData(resultData); // 特殊处理:ipv6 从ipv6_address_list取第一个
|
134
|
-
|
135
|
-
// 特殊处理:ipv6 从ipv6_address_list取第一个
|
136
|
-
if (resultData.attributeMap.ipv6_address_list && !resultData.attributeMap.ipv6_address) {
|
137
|
-
resultData.attributeMap.ipv6_address = (resultData.attributeMap.ipv6_address_list || '').split(',')[0];
|
138
|
-
}
|
139
|
-
|
140
|
-
return resultData;
|
141
|
-
}));
|
142
|
-
|
143
|
-
case 17:
|
144
|
-
case "end":
|
145
|
-
return _context.stop();
|
146
|
-
}
|
132
|
+
return resultData;
|
133
|
+
}));
|
134
|
+
|
135
|
+
case 17:
|
136
|
+
case "end":
|
137
|
+
return _context.stop();
|
147
138
|
}
|
148
139
|
}, _callee);
|
149
|
-
}));
|
150
|
-
return _fetchData.apply(this, arguments);
|
140
|
+
}))).apply(this, arguments);
|
151
141
|
}
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
|
142
|
+
/**
|
143
|
+
*
|
144
|
+
* @returns {{id, attributes: object[], metrics: object[]}[]} 属性和指标
|
145
|
+
*/
|
156
146
|
|
157
147
|
|
158
|
-
function
|
159
|
-
_refresh = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee2() {
|
148
|
+
function refresh() {
|
149
|
+
return (_refresh = _refresh || (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee2() {
|
160
150
|
var data;
|
161
151
|
return _regenerator["default"].wrap(function _callee2$(_context2) {
|
162
|
-
while (1) {
|
163
|
-
|
164
|
-
|
165
|
-
|
166
|
-
|
167
|
-
|
168
|
-
|
169
|
-
|
170
|
-
|
171
|
-
|
172
|
-
|
173
|
-
|
174
|
-
|
175
|
-
|
176
|
-
|
177
|
-
|
178
|
-
|
179
|
-
|
180
|
-
|
181
|
-
|
182
|
-
return _context2.stop();
|
183
|
-
}
|
152
|
+
while (1) switch (_context2.prev = _context2.next) {
|
153
|
+
case 0:
|
154
|
+
if (!(!pollingSwitch || !(resAndMetrics !== null && resAndMetrics !== void 0 && resAndMetrics.resIdsList.length))) {
|
155
|
+
_context2.next = 2;
|
156
|
+
break;
|
157
|
+
}
|
158
|
+
|
159
|
+
return _context2.abrupt("return");
|
160
|
+
|
161
|
+
case 2:
|
162
|
+
_context2.next = 4;
|
163
|
+
return fetchData();
|
164
|
+
|
165
|
+
case 4:
|
166
|
+
data = _context2.sent;
|
167
|
+
return _context2.abrupt("return", data);
|
168
|
+
|
169
|
+
case 6:
|
170
|
+
case "end":
|
171
|
+
return _context2.stop();
|
184
172
|
}
|
185
173
|
}, _callee2);
|
186
|
-
}));
|
187
|
-
|
188
|
-
|
174
|
+
}))).apply(this, arguments);
|
175
|
+
} // 轮询hooks
|
176
|
+
|
189
177
|
|
190
178
|
var _useRequest = (0, _ahooks.useRequest)(refresh, {
|
191
179
|
pollingInterval: 60 * 1000,
|