@riil-frontend/component-topology 11.0.34 → 11.0.35
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/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/hooks/useDisplaySetting.js +92 -108
- package/es/core/components/titlebar/widgets/TitleWidget.js +5 -3
- 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 +130 -142
- package/es/core/hooks/useResourceConfig.js +76 -100
- package/es/core/hooks/useTopoEdit.js +526 -619
- package/es/core/models/Alarm.js +319 -402
- 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 +279 -436
- package/es/core/models/TopoGraphView.js +28 -41
- package/es/core/models/cache/CiCache.js +34 -39
- package/es/core/models/cache/CiTypeCache.js +47 -61
- 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 +44 -58
- package/es/core/models/topoData.js +73 -77
- package/es/core/models/utils/linkUtils.js +46 -51
- package/es/core/models/utils/nodeNameVisibleUtil.js +4 -4
- 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 +37 -41
- 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 +9 -11
- package/es/core/store/models/topoConfig.js +215 -231
- package/es/core/store/models/topoGraphView.js +4 -6
- package/es/core/store/models/topoMod.js +373 -395
- 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.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 +251 -289
- 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/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/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/hooks/useDisplaySetting.js +92 -108
- package/lib/core/components/titlebar/widgets/TitleWidget.js +5 -3
- 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 +129 -141
- package/lib/core/hooks/useResourceConfig.js +76 -100
- package/lib/core/hooks/useTopoEdit.js +517 -610
- package/lib/core/models/Alarm.js +313 -396
- 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 +279 -436
- package/lib/core/models/TopoGraphView.js +28 -41
- package/lib/core/models/cache/CiCache.js +39 -44
- package/lib/core/models/cache/CiTypeCache.js +48 -62
- 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 +44 -58
- package/lib/core/models/topoData.js +73 -78
- package/lib/core/models/utils/linkUtils.js +45 -51
- package/lib/core/models/utils/nodeNameVisibleUtil.js +4 -4
- 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 +37 -41
- 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 +9 -11
- package/lib/core/store/models/topoConfig.js +222 -238
- package/lib/core/store/models/topoGraphView.js +4 -6
- package/lib/core/store/models/topoMod.js +375 -397
- 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.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 +252 -290
- 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/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 +4 -3
|
@@ -4,6 +4,8 @@ import React from 'react';
|
|
|
4
4
|
import NodeSizeInput from "../../common/NodeSizeInput/NodeSizeInput";
|
|
5
5
|
import useBackgroundSizeConfig from "./hooks/useBackgroundSizeConfig";
|
|
6
6
|
export default function BackgroundSize(props) {
|
|
7
|
+
var _ref;
|
|
8
|
+
|
|
7
9
|
var topo = props.topo,
|
|
8
10
|
backgroundConfig = props.backgroundConfig,
|
|
9
11
|
settingRuntimeState = props.settingRuntimeState;
|
|
@@ -12,31 +14,25 @@ export default function BackgroundSize(props) {
|
|
|
12
14
|
current: backgroundConfig.current
|
|
13
15
|
});
|
|
14
16
|
|
|
15
|
-
var setSize =
|
|
16
|
-
|
|
17
|
+
var setSize = function setSize(_x) {
|
|
18
|
+
return (_ref = _ref || _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(size) {
|
|
17
19
|
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
|
18
|
-
while (1) {
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
return backgroundSizeConfig.setSize(size);
|
|
20
|
+
while (1) switch (_context.prev = _context.next) {
|
|
21
|
+
case 0:
|
|
22
|
+
topo.historyManager.beginTransaction();
|
|
23
|
+
_context.next = 3;
|
|
24
|
+
return backgroundSizeConfig.setSize(size);
|
|
24
25
|
|
|
25
|
-
|
|
26
|
-
|
|
26
|
+
case 3:
|
|
27
|
+
topo.historyManager.endTransaction();
|
|
27
28
|
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
}
|
|
29
|
+
case 4:
|
|
30
|
+
case "end":
|
|
31
|
+
return _context.stop();
|
|
32
32
|
}
|
|
33
33
|
}, _callee);
|
|
34
|
-
}));
|
|
35
|
-
|
|
36
|
-
return function setSize(_x) {
|
|
37
|
-
return _ref.apply(this, arguments);
|
|
38
|
-
};
|
|
39
|
-
}();
|
|
34
|
+
}))).apply(this, arguments);
|
|
35
|
+
};
|
|
40
36
|
|
|
41
37
|
return /*#__PURE__*/React.createElement(NodeSizeInput, {
|
|
42
38
|
nodeId: backgroundSizeConfig.nodeId,
|
|
@@ -11,6 +11,8 @@ import styles from "../../../components/titlebar/TitleBar.module.scss";
|
|
|
11
11
|
import DebugTools from "./widgets/DebugTools";
|
|
12
12
|
import SettingButtonWidget from "../../../viewer/components/titlebar/widgets/SettingButtonWidget";
|
|
13
13
|
export default function TopoEditorTitleBar(props) {
|
|
14
|
+
var _ref;
|
|
15
|
+
|
|
14
16
|
var topo = props.topo,
|
|
15
17
|
topoEditApi = props.topoEditApi;
|
|
16
18
|
var store = topo.store;
|
|
@@ -25,30 +27,24 @@ export default function TopoEditorTitleBar(props) {
|
|
|
25
27
|
exitFlag = _useState[0],
|
|
26
28
|
setExitFlag = _useState[1];
|
|
27
29
|
|
|
28
|
-
var saveAndExit =
|
|
29
|
-
|
|
30
|
+
var saveAndExit = function saveAndExit() {
|
|
31
|
+
return (_ref = _ref || _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
|
|
30
32
|
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
|
31
|
-
while (1) {
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
return topo.save();
|
|
33
|
+
while (1) switch (_context.prev = _context.next) {
|
|
34
|
+
case 0:
|
|
35
|
+
_context.next = 2;
|
|
36
|
+
return topo.save();
|
|
36
37
|
|
|
37
|
-
|
|
38
|
-
|
|
38
|
+
case 2:
|
|
39
|
+
setExitFlag(true);
|
|
39
40
|
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
}
|
|
41
|
+
case 3:
|
|
42
|
+
case "end":
|
|
43
|
+
return _context.stop();
|
|
44
44
|
}
|
|
45
45
|
}, _callee);
|
|
46
|
-
}));
|
|
47
|
-
|
|
48
|
-
return function saveAndExit() {
|
|
49
|
-
return _ref.apply(this, arguments);
|
|
50
|
-
};
|
|
51
|
-
}();
|
|
46
|
+
}))).apply(this, arguments);
|
|
47
|
+
};
|
|
52
48
|
|
|
53
49
|
useEffect(function () {
|
|
54
50
|
if (!saving && exitFlag) {
|
|
@@ -77,53 +73,39 @@ export default function TopoEditorTitleBar(props) {
|
|
|
77
73
|
}, "\u4FDD\u5B58"), /*#__PURE__*/React.createElement(_Button, {
|
|
78
74
|
className: styles.button,
|
|
79
75
|
onClick: function onClick() {
|
|
76
|
+
var _onOk, _onCancel;
|
|
77
|
+
|
|
80
78
|
_Dialog.confirm({
|
|
81
79
|
title: '提示',
|
|
82
80
|
content: '若直接退出,图上修改的内容将不会保存!',
|
|
83
|
-
onOk: function () {
|
|
84
|
-
|
|
81
|
+
onOk: function onOk() {
|
|
82
|
+
return (_onOk = _onOk || _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2() {
|
|
85
83
|
return _regeneratorRuntime.wrap(function _callee2$(_context2) {
|
|
86
|
-
while (1) {
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
saveAndExit();
|
|
84
|
+
while (1) switch (_context2.prev = _context2.next) {
|
|
85
|
+
case 0:
|
|
86
|
+
saveAndExit();
|
|
90
87
|
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
}
|
|
88
|
+
case 1:
|
|
89
|
+
case "end":
|
|
90
|
+
return _context2.stop();
|
|
95
91
|
}
|
|
96
92
|
}, _callee2);
|
|
97
|
-
}));
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
}
|
|
102
|
-
|
|
103
|
-
return onOk;
|
|
104
|
-
}(),
|
|
105
|
-
onCancel: function () {
|
|
106
|
-
var _onCancel = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee3() {
|
|
93
|
+
}))).apply(this, arguments);
|
|
94
|
+
},
|
|
95
|
+
onCancel: function onCancel() {
|
|
96
|
+
return (_onCancel = _onCancel || _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee3() {
|
|
107
97
|
return _regeneratorRuntime.wrap(function _callee3$(_context3) {
|
|
108
|
-
while (1) {
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
topo.exitEditMode();
|
|
98
|
+
while (1) switch (_context3.prev = _context3.next) {
|
|
99
|
+
case 0:
|
|
100
|
+
topo.exitEditMode();
|
|
112
101
|
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
}
|
|
102
|
+
case 1:
|
|
103
|
+
case "end":
|
|
104
|
+
return _context3.stop();
|
|
117
105
|
}
|
|
118
106
|
}, _callee3);
|
|
119
|
-
}));
|
|
120
|
-
|
|
121
|
-
function onCancel() {
|
|
122
|
-
return _onCancel.apply(this, arguments);
|
|
123
|
-
}
|
|
124
|
-
|
|
125
|
-
return onCancel;
|
|
126
|
-
}(),
|
|
107
|
+
}))).apply(this, arguments);
|
|
108
|
+
},
|
|
127
109
|
cancelProps: {
|
|
128
110
|
children: '退出'
|
|
129
111
|
},
|
|
@@ -24,8 +24,8 @@ export default function useKeyboardShortcut(props) {
|
|
|
24
24
|
|
|
25
25
|
if (e.keyCode === 32 && e.target.nodeName !== 'TEXTAREA') {
|
|
26
26
|
// 空格
|
|
27
|
-
var _topo$store$
|
|
28
|
-
viewMouseMode = _topo$store$
|
|
27
|
+
var _topo$store$getModelS2 = topo.store.getModelState('topoEdit'),
|
|
28
|
+
viewMouseMode = _topo$store$getModelS2.viewMouseMode;
|
|
29
29
|
|
|
30
30
|
topoEdit.setViewMouseMode(viewMouseMode === 'select' ? 'move' : 'select');
|
|
31
31
|
}
|
|
@@ -28,10 +28,10 @@ function useNewElementTheme(props) {
|
|
|
28
28
|
return item.name === theme;
|
|
29
29
|
});
|
|
30
30
|
|
|
31
|
-
var
|
|
31
|
+
var _ThemeUtil2 = ThemeUtil({
|
|
32
32
|
topo: topo
|
|
33
33
|
}),
|
|
34
|
-
setElementTheme =
|
|
34
|
+
setElementTheme = _ThemeUtil2.setElementTheme;
|
|
35
35
|
|
|
36
36
|
setElementTheme(data, themeConfig); // 临时放这里,新加入节点按配置显示隐藏名称
|
|
37
37
|
|
|
@@ -36,17 +36,15 @@ export default {
|
|
|
36
36
|
|
|
37
37
|
return _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
|
|
38
38
|
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
|
39
|
-
while (1) {
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
});
|
|
39
|
+
while (1) switch (_context.prev = _context.next) {
|
|
40
|
+
case 0:
|
|
41
|
+
_this.update({
|
|
42
|
+
current: extraConfig.background
|
|
43
|
+
});
|
|
45
44
|
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
}
|
|
45
|
+
case 1:
|
|
46
|
+
case "end":
|
|
47
|
+
return _context.stop();
|
|
50
48
|
}
|
|
51
49
|
}, _callee);
|
|
52
50
|
}))();
|
|
@@ -37,12 +37,10 @@ export default function (topo) {
|
|
|
37
37
|
init: function init(payload, rootState) {
|
|
38
38
|
return _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
|
|
39
39
|
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
|
40
|
-
while (1) {
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
return _context.stop();
|
|
45
|
-
}
|
|
40
|
+
while (1) switch (_context.prev = _context.next) {
|
|
41
|
+
case 0:
|
|
42
|
+
case "end":
|
|
43
|
+
return _context.stop();
|
|
46
44
|
}
|
|
47
45
|
}, _callee);
|
|
48
46
|
}))();
|
|
@@ -68,14 +68,12 @@ export function isNodeAllEdges(topo) {
|
|
|
68
68
|
return nodeLineList[i]._id == edge._id;
|
|
69
69
|
}).length == 0) {
|
|
70
70
|
inEdges = true;
|
|
71
|
-
return
|
|
71
|
+
return 1; // break
|
|
72
72
|
}
|
|
73
73
|
};
|
|
74
74
|
|
|
75
75
|
for (var i = 0; i < nodeLineList.length; i++) {
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
if (_ret === "break") break;
|
|
76
|
+
if (_loop(i)) break;
|
|
79
77
|
}
|
|
80
78
|
});
|
|
81
79
|
return inEdges;
|
|
@@ -15,6 +15,8 @@ import useHtDataPropertyChangeListener from "./ht/useHtDataPropertyChangeListene
|
|
|
15
15
|
*/
|
|
16
16
|
|
|
17
17
|
var usePolling = function usePolling(props) {
|
|
18
|
+
var _fetchData, _refresh;
|
|
19
|
+
|
|
18
20
|
var topo = props.topo;
|
|
19
21
|
var store = topo.store;
|
|
20
22
|
useCiAttributeChange({
|
|
@@ -33,167 +35,153 @@ var usePolling = function usePolling(props) {
|
|
|
33
35
|
*/
|
|
34
36
|
|
|
35
37
|
function fetchData() {
|
|
36
|
-
return _fetchData.
|
|
37
|
-
}
|
|
38
|
-
/**
|
|
39
|
-
*
|
|
40
|
-
* @returns {{id, attributes: object[], metrics: object[]}[]} 属性和指标
|
|
41
|
-
*/
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
function _fetchData() {
|
|
45
|
-
_fetchData = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
|
|
38
|
+
return (_fetchData = _fetchData || _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
|
|
46
39
|
var _topo$store$getModelS, resIdsList, nodeIdsList, codes, param, _yield$Promise$all, ciMetricsResult, mergeData, transformLinkData, adapterIpv6;
|
|
47
40
|
|
|
48
41
|
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
|
49
|
-
while (1) {
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
var ipv6 = data.attributeMap.ipv6_address;
|
|
54
|
-
|
|
55
|
-
if (!ipv6 && data.attributeMap.ipv6_address_list) {
|
|
56
|
-
ipv6 = (data.attributeMap.ipv6_address_list || '').split(',')[0];
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
return _extends({}, data, {
|
|
60
|
-
attributeMap: _extends({}, data.attributeMap, {
|
|
61
|
-
ipv6_address: ipv6
|
|
62
|
-
})
|
|
63
|
-
});
|
|
64
|
-
};
|
|
42
|
+
while (1) switch (_context.prev = _context.next) {
|
|
43
|
+
case 0:
|
|
44
|
+
adapterIpv6 = function _adapterIpv(data) {
|
|
45
|
+
var ipv6 = data.attributeMap.ipv6_address;
|
|
65
46
|
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
linkGroups = _topo$dataModel$getDa2.linkGroups;
|
|
47
|
+
if (!ipv6 && data.attributeMap.ipv6_address_list) {
|
|
48
|
+
ipv6 = (data.attributeMap.ipv6_address_list || '').split(',')[0];
|
|
49
|
+
}
|
|
70
50
|
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
51
|
+
return _extends({}, data, {
|
|
52
|
+
attributeMap: _extends({}, data.attributeMap, {
|
|
53
|
+
ipv6_address: ipv6
|
|
54
|
+
})
|
|
55
|
+
});
|
|
56
|
+
};
|
|
74
57
|
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
58
|
+
transformLinkData = function _transformLinkData(data) {
|
|
59
|
+
var _topo$dataModel$getDa2 = topo.dataModel.getData(),
|
|
60
|
+
links = _topo$dataModel$getDa2.links,
|
|
61
|
+
linkGroups = _topo$dataModel$getDa2.linkGroups;
|
|
78
62
|
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
};
|
|
83
|
-
|
|
84
|
-
mergeData = function _mergeData(ciMetricsResult) {
|
|
85
|
-
// 合并属性、指标
|
|
86
|
-
var _topo$dataModel$getDa = topo.dataModel.getData(),
|
|
87
|
-
nodes = _topo$dataModel$getDa.nodes,
|
|
88
|
-
links = _topo$dataModel$getDa.links;
|
|
89
|
-
|
|
90
|
-
return [].concat(nodes, links).filter(function (item) {
|
|
91
|
-
return !!item.ciType;
|
|
92
|
-
}).map(function (ciData) {
|
|
93
|
-
var resultData = _extends({}, ciData, {
|
|
94
|
-
attributeMap: _extends({}, (ciData === null || ciData === void 0 ? void 0 : ciData.attributes) || {})
|
|
95
|
-
});
|
|
96
|
-
|
|
97
|
-
resultData = transformLinkData(resultData);
|
|
98
|
-
resultData = adapterIpv6(resultData);
|
|
99
|
-
return resultData;
|
|
100
|
-
}).map(function (ciData) {
|
|
101
|
-
var ciMetricResult = ciMetricsResult.find(function (item) {
|
|
102
|
-
return item.id === (ciData.ciId || ciData.id);
|
|
103
|
-
});
|
|
104
|
-
return _extends({}, ciData, {
|
|
105
|
-
metrics: (ciMetricResult === null || ciMetricResult === void 0 ? void 0 : ciMetricResult.metrics) || {}
|
|
106
|
-
});
|
|
107
|
-
});
|
|
108
|
-
};
|
|
63
|
+
var link = [].concat(links, linkGroups).find(function (item) {
|
|
64
|
+
return item.id === data.id;
|
|
65
|
+
});
|
|
109
66
|
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
if (resIdsList.length) {
|
|
114
|
-
_context.next = 6;
|
|
115
|
-
break;
|
|
67
|
+
if (!link) {
|
|
68
|
+
return data;
|
|
116
69
|
}
|
|
117
70
|
|
|
118
|
-
return
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
}
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
71
|
+
return _extends({}, data, {
|
|
72
|
+
attributeMap: link.attributes || {}
|
|
73
|
+
});
|
|
74
|
+
};
|
|
75
|
+
|
|
76
|
+
mergeData = function _mergeData(ciMetricsResult) {
|
|
77
|
+
// 合并属性、指标
|
|
78
|
+
var _topo$dataModel$getDa = topo.dataModel.getData(),
|
|
79
|
+
nodes = _topo$dataModel$getDa.nodes,
|
|
80
|
+
links = _topo$dataModel$getDa.links;
|
|
81
|
+
|
|
82
|
+
return [].concat(nodes, links).filter(function (item) {
|
|
83
|
+
return !!item.ciType;
|
|
84
|
+
}).map(function (ciData) {
|
|
85
|
+
var resultData = _extends({}, ciData, {
|
|
86
|
+
attributeMap: _extends({}, (ciData === null || ciData === void 0 ? void 0 : ciData.attributes) || {})
|
|
87
|
+
});
|
|
88
|
+
|
|
89
|
+
resultData = transformLinkData(resultData);
|
|
90
|
+
resultData = adapterIpv6(resultData);
|
|
91
|
+
return resultData;
|
|
92
|
+
}).map(function (ciData) {
|
|
93
|
+
var ciMetricResult = ciMetricsResult.find(function (item) {
|
|
94
|
+
return item.id === (ciData.ciId || ciData.id);
|
|
95
|
+
});
|
|
96
|
+
return _extends({}, ciData, {
|
|
97
|
+
metrics: (ciMetricResult === null || ciMetricResult === void 0 ? void 0 : ciMetricResult.metrics) || {}
|
|
98
|
+
});
|
|
99
|
+
});
|
|
100
|
+
};
|
|
101
|
+
|
|
102
|
+
_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);
|
|
103
|
+
// 无资源,不查询
|
|
104
|
+
|
|
105
|
+
if (resIdsList.length) {
|
|
106
|
+
_context.next = 6;
|
|
107
|
+
break;
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
return _context.abrupt("return", []);
|
|
111
|
+
|
|
112
|
+
case 6:
|
|
113
|
+
// 需要查询的指标列表
|
|
114
|
+
codes = topo.attributeMetricDisplay.getResourceMetricCodes();
|
|
115
|
+
param = {
|
|
116
|
+
ciId: nodeIdsList,
|
|
117
|
+
codes: codes,
|
|
118
|
+
// 过滤掉不需要查询的
|
|
119
|
+
relationId: topo.attributeMetricDisplay.getEdges().map(function (edge) {
|
|
120
|
+
return {
|
|
121
|
+
ciId: edge.id,
|
|
122
|
+
operation: edge.operation
|
|
123
|
+
};
|
|
124
|
+
})
|
|
125
|
+
};
|
|
126
|
+
_context.t0 = Promise;
|
|
127
|
+
_context.t1 = // 查询指标值
|
|
128
|
+
topo.serverApi.ciInfo.batchQueryCiInfo(param);
|
|
129
|
+
_context.next = 12;
|
|
130
|
+
return DictCache.init();
|
|
131
|
+
|
|
132
|
+
case 12:
|
|
133
|
+
_context.t2 = _context.sent;
|
|
134
|
+
_context.t3 = [_context.t1, _context.t2];
|
|
135
|
+
_context.next = 16;
|
|
136
|
+
return _context.t0.all.call(_context.t0, _context.t3);
|
|
137
|
+
|
|
138
|
+
case 16:
|
|
139
|
+
_yield$Promise$all = _context.sent;
|
|
140
|
+
ciMetricsResult = _yield$Promise$all[0];
|
|
141
|
+
return _context.abrupt("return", mergeData(ciMetricsResult));
|
|
142
|
+
|
|
143
|
+
case 19:
|
|
144
|
+
case "end":
|
|
145
|
+
return _context.stop();
|
|
155
146
|
}
|
|
156
147
|
}, _callee);
|
|
157
|
-
}));
|
|
158
|
-
return _fetchData.apply(this, arguments);
|
|
148
|
+
}))).apply(this, arguments);
|
|
159
149
|
}
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
150
|
+
/**
|
|
151
|
+
*
|
|
152
|
+
* @returns {{id, attributes: object[], metrics: object[]}[]} 属性和指标
|
|
153
|
+
*/
|
|
164
154
|
|
|
165
155
|
|
|
166
|
-
function
|
|
167
|
-
_refresh = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2() {
|
|
156
|
+
function refresh() {
|
|
157
|
+
return (_refresh = _refresh || _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2() {
|
|
168
158
|
var data;
|
|
169
159
|
return _regeneratorRuntime.wrap(function _callee2$(_context2) {
|
|
170
|
-
while (1) {
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
return _context2.stop();
|
|
191
|
-
}
|
|
160
|
+
while (1) switch (_context2.prev = _context2.next) {
|
|
161
|
+
case 0:
|
|
162
|
+
if (!(!pollingSwitch || !(resAndMetrics !== null && resAndMetrics !== void 0 && resAndMetrics.resIdsList.length))) {
|
|
163
|
+
_context2.next = 2;
|
|
164
|
+
break;
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
return _context2.abrupt("return");
|
|
168
|
+
|
|
169
|
+
case 2:
|
|
170
|
+
_context2.next = 4;
|
|
171
|
+
return fetchData();
|
|
172
|
+
|
|
173
|
+
case 4:
|
|
174
|
+
data = _context2.sent;
|
|
175
|
+
return _context2.abrupt("return", data);
|
|
176
|
+
|
|
177
|
+
case 6:
|
|
178
|
+
case "end":
|
|
179
|
+
return _context2.stop();
|
|
192
180
|
}
|
|
193
181
|
}, _callee2);
|
|
194
|
-
}));
|
|
195
|
-
|
|
196
|
-
|
|
182
|
+
}))).apply(this, arguments);
|
|
183
|
+
} // 轮询hooks
|
|
184
|
+
|
|
197
185
|
|
|
198
186
|
var _useRequest = useRequest(refresh, {
|
|
199
187
|
pollingInterval: 60 * 1000,
|