@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
@@ -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
|
}
|
@@ -26,10 +26,10 @@ function useNewElementTheme(props) {
|
|
26
26
|
return item.name === theme;
|
27
27
|
});
|
28
28
|
|
29
|
-
var
|
29
|
+
var _ThemeUtil2 = ThemeUtil({
|
30
30
|
topo: topo
|
31
31
|
}),
|
32
|
-
setElementTheme =
|
32
|
+
setElementTheme = _ThemeUtil2.setElementTheme;
|
33
33
|
|
34
34
|
setElementTheme(data, themeConfig);
|
35
35
|
}
|
@@ -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;
|
@@ -16,6 +16,8 @@ import useHtDataPropertyChangeListener from "./ht/useHtDataPropertyChangeListene
|
|
16
16
|
*/
|
17
17
|
|
18
18
|
var usePolling = function usePolling(props) {
|
19
|
+
var _fetchData, _refresh;
|
20
|
+
|
19
21
|
var topo = props.topo;
|
20
22
|
var store = topo.store;
|
21
23
|
useCiAttributeChange({
|
@@ -34,142 +36,128 @@ var usePolling = function usePolling(props) {
|
|
34
36
|
*/
|
35
37
|
|
36
38
|
function fetchData() {
|
37
|
-
return _fetchData.
|
38
|
-
}
|
39
|
-
/**
|
40
|
-
*
|
41
|
-
* @returns {{id, attributes: object[], metrics: object[]}[]} 属性和指标
|
42
|
-
*/
|
43
|
-
|
44
|
-
|
45
|
-
function _fetchData() {
|
46
|
-
_fetchData = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
|
39
|
+
return (_fetchData = _fetchData || _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
|
47
40
|
var _topo$store$getModelS, resIdsList, nodeIdsList, codes, param, _yield$Promise$all, ciMetricResult, transformLinkData;
|
48
41
|
|
49
42
|
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
50
|
-
while (1) {
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
43
|
+
while (1) switch (_context.prev = _context.next) {
|
44
|
+
case 0:
|
45
|
+
transformLinkData = function _transformLinkData(data) {
|
46
|
+
var _topo$dataModel$getDa = topo.dataModel.getData(),
|
47
|
+
links = _topo$dataModel$getDa.links,
|
48
|
+
linkGroups = _topo$dataModel$getDa.linkGroups;
|
49
|
+
|
50
|
+
var link = [].concat(links, linkGroups).find(function (item) {
|
51
|
+
return item.id === data.id;
|
52
|
+
});
|
53
|
+
|
54
|
+
if (!link) {
|
55
|
+
return data;
|
56
|
+
}
|
57
|
+
|
58
|
+
return _extends({}, data, {
|
59
|
+
attributeMap: link.attributes || {}
|
60
|
+
});
|
61
|
+
};
|
62
|
+
|
63
|
+
_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);
|
64
|
+
// 无资源,不查询
|
65
|
+
|
66
|
+
if (resIdsList.length) {
|
67
|
+
_context.next = 4;
|
68
|
+
break;
|
69
|
+
}
|
70
|
+
|
71
|
+
return _context.abrupt("return", []);
|
72
|
+
|
73
|
+
case 4:
|
74
|
+
// 需要查询的指标列表
|
75
|
+
codes = topo.attributeMetricDisplay.getResourceMetricCodes();
|
76
|
+
param = {
|
77
|
+
ciId: nodeIdsList,
|
78
|
+
codes: codes,
|
79
|
+
// 过滤掉不需要查询的
|
80
|
+
relationId: topo.attributeMetricDisplay.getEdges().map(function (edge) {
|
81
|
+
return {
|
82
|
+
ciId: edge.id,
|
83
|
+
operation: edge.operation
|
84
|
+
};
|
85
|
+
})
|
86
|
+
};
|
87
|
+
_context.t0 = Promise;
|
88
|
+
_context.t1 = // 查询指标值
|
89
|
+
topoServer.ciInfo.batchQueryCiInfo(param);
|
90
|
+
_context.next = 10;
|
91
|
+
return DictCache.init();
|
92
|
+
|
93
|
+
case 10:
|
94
|
+
_context.t2 = _context.sent;
|
95
|
+
_context.t3 = [_context.t1, _context.t2];
|
96
|
+
_context.next = 14;
|
97
|
+
return _context.t0.all.call(_context.t0, _context.t3);
|
98
|
+
|
99
|
+
case 14:
|
100
|
+
_yield$Promise$all = _context.sent;
|
101
|
+
ciMetricResult = _yield$Promise$all[0];
|
102
|
+
return _context.abrupt("return", ciMetricResult.map(function (data) {
|
103
|
+
var ci = topo.dataModel.getDataById(data.id);
|
104
|
+
|
105
|
+
var resultData = _extends({}, data, ci, {
|
106
|
+
attributeMap: _extends({}, (ci === null || ci === void 0 ? void 0 : ci.attributes) || {})
|
107
|
+
});
|
108
|
+
|
109
|
+
resultData = transformLinkData(resultData); // 特殊处理:ipv6 从ipv6_address_list取第一个
|
110
|
+
|
111
|
+
// 特殊处理:ipv6 从ipv6_address_list取第一个
|
112
|
+
if (resultData.attributeMap.ipv6_address_list && !resultData.attributeMap.ipv6_address) {
|
113
|
+
resultData.attributeMap.ipv6_address = (resultData.attributeMap.ipv6_address_list || '').split(',')[0];
|
77
114
|
}
|
78
115
|
|
79
|
-
return
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
ciId: nodeIdsList,
|
86
|
-
codes: codes,
|
87
|
-
// 过滤掉不需要查询的
|
88
|
-
relationId: topo.attributeMetricDisplay.getEdges().map(function (edge) {
|
89
|
-
return {
|
90
|
-
ciId: edge.id,
|
91
|
-
operation: edge.operation
|
92
|
-
};
|
93
|
-
})
|
94
|
-
};
|
95
|
-
_context.t0 = Promise;
|
96
|
-
_context.t1 = // 查询指标值
|
97
|
-
topoServer.ciInfo.batchQueryCiInfo(param);
|
98
|
-
_context.next = 10;
|
99
|
-
return DictCache.init();
|
100
|
-
|
101
|
-
case 10:
|
102
|
-
_context.t2 = _context.sent;
|
103
|
-
_context.t3 = [_context.t1, _context.t2];
|
104
|
-
_context.next = 14;
|
105
|
-
return _context.t0.all.call(_context.t0, _context.t3);
|
106
|
-
|
107
|
-
case 14:
|
108
|
-
_yield$Promise$all = _context.sent;
|
109
|
-
ciMetricResult = _yield$Promise$all[0];
|
110
|
-
return _context.abrupt("return", ciMetricResult.map(function (data) {
|
111
|
-
var ci = topo.dataModel.getDataById(data.id);
|
112
|
-
|
113
|
-
var resultData = _extends({}, data, ci, {
|
114
|
-
attributeMap: _extends({}, (ci === null || ci === void 0 ? void 0 : ci.attributes) || {})
|
115
|
-
});
|
116
|
-
|
117
|
-
resultData = transformLinkData(resultData); // 特殊处理:ipv6 从ipv6_address_list取第一个
|
118
|
-
|
119
|
-
// 特殊处理:ipv6 从ipv6_address_list取第一个
|
120
|
-
if (resultData.attributeMap.ipv6_address_list && !resultData.attributeMap.ipv6_address) {
|
121
|
-
resultData.attributeMap.ipv6_address = (resultData.attributeMap.ipv6_address_list || '').split(',')[0];
|
122
|
-
}
|
123
|
-
|
124
|
-
return resultData;
|
125
|
-
}));
|
126
|
-
|
127
|
-
case 17:
|
128
|
-
case "end":
|
129
|
-
return _context.stop();
|
130
|
-
}
|
116
|
+
return resultData;
|
117
|
+
}));
|
118
|
+
|
119
|
+
case 17:
|
120
|
+
case "end":
|
121
|
+
return _context.stop();
|
131
122
|
}
|
132
123
|
}, _callee);
|
133
|
-
}));
|
134
|
-
return _fetchData.apply(this, arguments);
|
124
|
+
}))).apply(this, arguments);
|
135
125
|
}
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
126
|
+
/**
|
127
|
+
*
|
128
|
+
* @returns {{id, attributes: object[], metrics: object[]}[]} 属性和指标
|
129
|
+
*/
|
140
130
|
|
141
131
|
|
142
|
-
function
|
143
|
-
_refresh = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2() {
|
132
|
+
function refresh() {
|
133
|
+
return (_refresh = _refresh || _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2() {
|
144
134
|
var data;
|
145
135
|
return _regeneratorRuntime.wrap(function _callee2$(_context2) {
|
146
|
-
while (1) {
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
|
157
|
-
|
158
|
-
|
159
|
-
|
160
|
-
|
161
|
-
|
162
|
-
|
163
|
-
|
164
|
-
|
165
|
-
|
166
|
-
return _context2.stop();
|
167
|
-
}
|
136
|
+
while (1) switch (_context2.prev = _context2.next) {
|
137
|
+
case 0:
|
138
|
+
if (!(!pollingSwitch || !(resAndMetrics !== null && resAndMetrics !== void 0 && resAndMetrics.resIdsList.length))) {
|
139
|
+
_context2.next = 2;
|
140
|
+
break;
|
141
|
+
}
|
142
|
+
|
143
|
+
return _context2.abrupt("return");
|
144
|
+
|
145
|
+
case 2:
|
146
|
+
_context2.next = 4;
|
147
|
+
return fetchData();
|
148
|
+
|
149
|
+
case 4:
|
150
|
+
data = _context2.sent;
|
151
|
+
return _context2.abrupt("return", data);
|
152
|
+
|
153
|
+
case 6:
|
154
|
+
case "end":
|
155
|
+
return _context2.stop();
|
168
156
|
}
|
169
157
|
}, _callee2);
|
170
|
-
}));
|
171
|
-
|
172
|
-
|
158
|
+
}))).apply(this, arguments);
|
159
|
+
} // 轮询hooks
|
160
|
+
|
173
161
|
|
174
162
|
var _useRequest = useRequest(refresh, {
|
175
163
|
pollingInterval: 60 * 1000,
|