@riil-frontend/component-topology 11.0.35 → 11.0.36
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.js +37 -29
- package/es/components/MultiResourceDrawer/index.js +8 -6
- package/es/components/ResourceList/ResourceSelect.js +8 -7
- package/es/components/ResourceSelectDrawer/ResourceSelectDrawer.js +8 -6
- package/es/components/SingleResourceDrawer/SelectDrawer.js +8 -6
- package/es/core/components/DisplaySettingDrawer/DisplaySettingDrawer.js +8 -6
- package/es/core/components/DisplaySettingDrawer/hooks/useDisplaySetting.js +24 -14
- package/es/core/editor/components/BackgroundView/index.js +73 -54
- package/es/core/editor/components/CustomIconPlugin/RenameDialog.js +8 -6
- package/es/core/editor/components/CustomIconPlugin/utils/svgToShape.js +7 -5
- package/es/core/editor/components/GroupAddResourceDrawerPlugin/GroupAddResourceDrawer.js +8 -6
- package/es/core/editor/components/Sidebar/views/CanvasPanel/hooks/useCanvasThemeConfig.js +15 -8
- package/es/core/editor/components/Toolbar/widgets/BoxBackgroundButton/BoxBackgroundSetting.js +16 -10
- package/es/core/editor/components/Toolbar/widgets/FontColorButton.js +16 -10
- package/es/core/editor/components/settings/propertyViews/layer/DataTab/DefaultLayerAddResourceDrawer.js +8 -6
- package/es/core/editor/components/settings/propertyViews/node/data/BindResourceDrawer.js +8 -6
- package/es/core/editor/components/settings/propertyViews/node/data/Data.js +8 -6
- package/es/core/editor/components/settings/propertyViews/view/BackgroundSize.js +8 -6
- package/es/core/editor/components/titlebar/TopoEditorTitleBar.js +28 -16
- package/es/core/hooks/usePolling.js +21 -13
- package/es/core/hooks/useResourceConfig.js +37 -21
- package/es/core/hooks/useTopoEdit.js +202 -139
- package/es/core/models/Alarm.js +104 -38
- package/es/core/models/AttributeMetricDisplay.js +36 -14
- package/es/core/models/TopoApp.js +197 -75
- package/es/core/models/TopoGraphView.js +20 -10
- package/es/core/models/cache/CiCache.js +12 -6
- package/es/core/models/cache/CiTypeCache.js +20 -10
- package/es/core/models/cache/DictCache.js +10 -6
- package/es/core/models/graph/Background.js +9 -6
- package/es/core/models/plugins/resourceWebControllUrl.js +21 -8
- package/es/core/models/tagstips/ElementTagTipConfig.js +20 -10
- package/es/core/models/topoData.js +7 -5
- package/es/core/models/utils/linkUtils.js +8 -5
- package/es/core/services/cmdb/metric.js +7 -5
- package/es/core/services/cmdb.js +7 -5
- package/es/core/services/index.js +23 -9
- package/es/core/services/topo/tagtip.js +7 -5
- package/es/core/store/models/customIcon.js +11 -6
- package/es/core/utils/edgeUtil.js +2 -1
- package/es/core/utils/imageUtil.js +7 -5
- package/es/core/utils/saveSerialize.js +7 -5
- package/es/core/viewer/components/plugins/ResourceDetail/components/ClusterMemberTable.js +8 -6
- package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/EventsCard.js +8 -5
- package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/ResourceOverview.js +57 -25
- package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/components/Configurator/index.js +47 -34
- package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/components/LinkTopo/LinkTopoCard.js +9 -5
- package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/components/LinkTopo/services/index.js +74 -34
- package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/hooks/useAlarmAndRiskData.js +9 -6
- package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/hooks/useMetricModels.js +9 -6
- package/es/core/viewer/components/plugins/ResourceDetail/components/WebConsole/WebConsoleForm/hooks/useWebConsole.js +31 -26
- package/es/core/viewer/components/plugins/ResourceDetail/getCiDisplayMetricModels.js +15 -7
- package/es/core/viewer/components/plugins/ResourceDetail/hooks/useUserId.js +7 -4
- package/es/core/viewer/components/plugins/ResourceWebControllUrlSettingDialog.js +8 -6
- package/es/networkTopo/components/Link/hook.js +21 -14
- package/es/networkTopo/components/Link/index.js +32 -18
- package/es/networkTopo/components/Link/setting.js +8 -6
- package/es/networkTopo/getTopoData.js +23 -10
- package/es/networkTopo/hooks/viewer/useRelateTopo.js +7 -4
- package/es/networkTopo/models/TopoCenter.js +24 -10
- package/es/networkTopo/services/cmdb.js +333 -233
- package/es/networkTopo/services/mdc.js +24 -15
- package/es/networkTopo/services/metric.js +16 -11
- package/es/networkTopo/services/model.js +412 -283
- package/es/networkTopo/utils/exportData.js +7 -5
- package/lib/components/MultiResourceDrawer/index.js +8 -6
- package/lib/components/ResourceList/ResourceSelect.js +8 -6
- package/lib/components/ResourceSelectDrawer/ResourceSelectDrawer.js +8 -6
- package/lib/components/SingleResourceDrawer/SelectDrawer.js +8 -6
- package/lib/core/components/DisplaySettingDrawer/DisplaySettingDrawer.js +8 -6
- package/lib/core/components/DisplaySettingDrawer/hooks/useDisplaySetting.js +24 -14
- package/lib/core/editor/components/BackgroundView/index.js +74 -55
- package/lib/core/editor/components/CustomIconPlugin/RenameDialog.js +8 -6
- package/lib/core/editor/components/CustomIconPlugin/utils/svgToShape.js +7 -4
- package/lib/core/editor/components/GroupAddResourceDrawerPlugin/GroupAddResourceDrawer.js +8 -6
- package/lib/core/editor/components/Sidebar/views/CanvasPanel/hooks/useCanvasThemeConfig.js +15 -8
- package/lib/core/editor/components/Toolbar/widgets/BoxBackgroundButton/BoxBackgroundSetting.js +16 -10
- package/lib/core/editor/components/Toolbar/widgets/FontColorButton.js +16 -10
- package/lib/core/editor/components/settings/propertyViews/layer/DataTab/DefaultLayerAddResourceDrawer.js +8 -6
- package/lib/core/editor/components/settings/propertyViews/node/data/BindResourceDrawer.js +8 -6
- package/lib/core/editor/components/settings/propertyViews/node/data/Data.js +8 -6
- package/lib/core/editor/components/settings/propertyViews/view/BackgroundSize.js +8 -6
- package/lib/core/editor/components/titlebar/TopoEditorTitleBar.js +28 -16
- package/lib/core/hooks/usePolling.js +21 -13
- package/lib/core/hooks/useResourceConfig.js +37 -21
- package/lib/core/hooks/useTopoEdit.js +202 -139
- package/lib/core/models/Alarm.js +104 -38
- package/lib/core/models/AttributeMetricDisplay.js +36 -14
- package/lib/core/models/TopoApp.js +197 -75
- package/lib/core/models/TopoGraphView.js +20 -10
- package/lib/core/models/cache/CiCache.js +12 -6
- package/lib/core/models/cache/CiTypeCache.js +20 -10
- package/lib/core/models/cache/DictCache.js +10 -6
- package/lib/core/models/graph/Background.js +9 -6
- package/lib/core/models/plugins/resourceWebControllUrl.js +21 -8
- package/lib/core/models/tagstips/ElementTagTipConfig.js +20 -10
- package/lib/core/models/topoData.js +7 -4
- package/lib/core/models/utils/linkUtils.js +8 -4
- package/lib/core/services/cmdb/metric.js +7 -4
- package/lib/core/services/cmdb.js +7 -4
- package/lib/core/services/index.js +21 -8
- package/lib/core/services/topo/tagtip.js +7 -4
- package/lib/core/store/models/customIcon.js +11 -6
- package/lib/core/utils/edgeUtil.js +2 -1
- package/lib/core/utils/imageUtil.js +7 -4
- package/lib/core/utils/saveSerialize.js +7 -4
- package/lib/core/viewer/components/plugins/ResourceDetail/components/ClusterMemberTable.js +8 -6
- package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/EventsCard.js +9 -6
- package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/ResourceOverview.js +57 -25
- package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/components/Configurator/index.js +49 -36
- package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/components/LinkTopo/LinkTopoCard.js +9 -5
- package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/components/LinkTopo/services/index.js +73 -35
- package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/hooks/useAlarmAndRiskData.js +9 -6
- package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/hooks/useMetricModels.js +9 -6
- package/lib/core/viewer/components/plugins/ResourceDetail/components/WebConsole/WebConsoleForm/hooks/useWebConsole.js +31 -25
- package/lib/core/viewer/components/plugins/ResourceDetail/getCiDisplayMetricModels.js +14 -6
- package/lib/core/viewer/components/plugins/ResourceDetail/hooks/useUserId.js +7 -4
- package/lib/core/viewer/components/plugins/ResourceWebControllUrlSettingDialog.js +8 -6
- package/lib/networkTopo/components/Link/hook.js +23 -15
- package/lib/networkTopo/components/Link/index.js +32 -18
- package/lib/networkTopo/components/Link/setting.js +8 -6
- package/lib/networkTopo/getTopoData.js +23 -10
- package/lib/networkTopo/hooks/viewer/useRelateTopo.js +7 -4
- package/lib/networkTopo/models/TopoCenter.js +24 -10
- package/lib/networkTopo/services/cmdb.js +336 -235
- package/lib/networkTopo/services/mdc.js +24 -14
- package/lib/networkTopo/services/metric.js +16 -10
- package/lib/networkTopo/services/model.js +414 -284
- package/lib/networkTopo/utils/exportData.js +7 -4
- package/lib/utils/htElementDataUtil.js +4 -2
- package/package.json +2 -2
@@ -20,8 +20,6 @@ var _themes = _interopRequireDefault(require("../../../../../config/themes"));
|
|
20
20
|
var _themeUtil = _interopRequireDefault(require("../../../../../utils/themeUtil"));
|
21
21
|
|
22
22
|
function useCanvasThemeConfig(props) {
|
23
|
-
var _ref, _setGlobalTagTheme;
|
24
|
-
|
25
23
|
var topo = props.topo;
|
26
24
|
|
27
25
|
var _topo$store$useModel = topo.store.useModel('displayConfig'),
|
@@ -30,8 +28,8 @@ function useCanvasThemeConfig(props) {
|
|
30
28
|
|
31
29
|
var canvasThemeName = displayConfig.canvasTheme || 'white';
|
32
30
|
|
33
|
-
var setCanvasTheme = function
|
34
|
-
|
31
|
+
var setCanvasTheme = /*#__PURE__*/function () {
|
32
|
+
var _ref = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee(themeName) {
|
35
33
|
var themeConfig;
|
36
34
|
return _regenerator["default"].wrap(function _callee$(_context) {
|
37
35
|
while (1) switch (_context.prev = _context.next) {
|
@@ -58,12 +56,20 @@ function useCanvasThemeConfig(props) {
|
|
58
56
|
return _context.stop();
|
59
57
|
}
|
60
58
|
}, _callee);
|
61
|
-
}))
|
62
|
-
|
59
|
+
}));
|
60
|
+
|
61
|
+
return function setCanvasTheme(_x) {
|
62
|
+
return _ref.apply(this, arguments);
|
63
|
+
};
|
64
|
+
}(); // 设置资源/链路标注样式
|
63
65
|
|
64
66
|
|
65
67
|
function setGlobalTagTheme(_x2) {
|
66
|
-
return
|
68
|
+
return _setGlobalTagTheme.apply(this, arguments);
|
69
|
+
}
|
70
|
+
|
71
|
+
function _setGlobalTagTheme() {
|
72
|
+
_setGlobalTagTheme = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee2(themeConfig) {
|
67
73
|
var _topo$store$getModelS, nodeLabelStyle, defaultEdgeLabelStyle;
|
68
74
|
|
69
75
|
return _regenerator["default"].wrap(function _callee2$(_context2) {
|
@@ -84,7 +90,8 @@ function useCanvasThemeConfig(props) {
|
|
84
90
|
return _context2.stop();
|
85
91
|
}
|
86
92
|
}, _callee2);
|
87
|
-
}))
|
93
|
+
}));
|
94
|
+
return _setGlobalTagTheme.apply(this, arguments);
|
88
95
|
}
|
89
96
|
|
90
97
|
function setElementsTheme(themeConfig) {
|
package/lib/core/editor/components/Toolbar/widgets/BoxBackgroundButton/BoxBackgroundSetting.js
CHANGED
@@ -24,8 +24,6 @@ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "functio
|
|
24
24
|
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; }
|
25
25
|
|
26
26
|
function BoxBackgroundSetting(props) {
|
27
|
-
var _ref, _ref2;
|
28
|
-
|
29
27
|
var topo = props.topo,
|
30
28
|
fieldProps = props.fieldProps,
|
31
29
|
setStyle = props.setStyle,
|
@@ -53,8 +51,8 @@ function BoxBackgroundSetting(props) {
|
|
53
51
|
topo.historyManager.endTransaction();
|
54
52
|
};
|
55
53
|
|
56
|
-
var backgroundChang = function
|
57
|
-
|
54
|
+
var backgroundChang = /*#__PURE__*/function () {
|
55
|
+
var _ref = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee(value, type) {
|
58
56
|
return _regenerator["default"].wrap(function _callee$(_context) {
|
59
57
|
while (1) switch (_context.prev = _context.next) {
|
60
58
|
case 0:
|
@@ -84,8 +82,12 @@ function BoxBackgroundSetting(props) {
|
|
84
82
|
return _context.stop();
|
85
83
|
}
|
86
84
|
}, _callee);
|
87
|
-
}))
|
88
|
-
|
85
|
+
}));
|
86
|
+
|
87
|
+
return function backgroundChang(_x, _x2) {
|
88
|
+
return _ref.apply(this, arguments);
|
89
|
+
};
|
90
|
+
}();
|
89
91
|
|
90
92
|
var borderOpacityChange = function borderOpacityChange(value) {
|
91
93
|
topo.historyManager.beginTransaction();
|
@@ -103,8 +105,8 @@ function BoxBackgroundSetting(props) {
|
|
103
105
|
topo.historyManager.endTransaction();
|
104
106
|
};
|
105
107
|
|
106
|
-
var borderColorChang = function
|
107
|
-
|
108
|
+
var borderColorChang = /*#__PURE__*/function () {
|
109
|
+
var _ref2 = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee2(value, type) {
|
108
110
|
return _regenerator["default"].wrap(function _callee2$(_context2) {
|
109
111
|
while (1) switch (_context2.prev = _context2.next) {
|
110
112
|
case 0:
|
@@ -134,8 +136,12 @@ function BoxBackgroundSetting(props) {
|
|
134
136
|
return _context2.stop();
|
135
137
|
}
|
136
138
|
}, _callee2);
|
137
|
-
}))
|
138
|
-
|
139
|
+
}));
|
140
|
+
|
141
|
+
return function borderColorChang(_x3, _x4) {
|
142
|
+
return _ref2.apply(this, arguments);
|
143
|
+
};
|
144
|
+
}();
|
139
145
|
|
140
146
|
var leftInputChange = function leftInputChange(val) {
|
141
147
|
setLeftInputVal(val);
|
@@ -29,8 +29,6 @@ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj &&
|
|
29
29
|
|
30
30
|
/* eslint-disable jsx-a11y/alt-text */
|
31
31
|
function FontColorDropdown(props) {
|
32
|
-
var _ref, _ref2;
|
33
|
-
|
34
32
|
var color = props.color,
|
35
33
|
onChange = props.onChange,
|
36
34
|
topo = props.topo,
|
@@ -55,8 +53,8 @@ function FontColorDropdown(props) {
|
|
55
53
|
topo.historyManager.endTransaction();
|
56
54
|
};
|
57
55
|
|
58
|
-
var colorChang = function
|
59
|
-
|
56
|
+
var colorChang = /*#__PURE__*/function () {
|
57
|
+
var _ref = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee(value, type) {
|
60
58
|
return _regenerator["default"].wrap(function _callee$(_context) {
|
61
59
|
while (1) switch (_context.prev = _context.next) {
|
62
60
|
case 0:
|
@@ -86,11 +84,15 @@ function FontColorDropdown(props) {
|
|
86
84
|
return _context.stop();
|
87
85
|
}
|
88
86
|
}, _callee);
|
89
|
-
}))
|
90
|
-
|
87
|
+
}));
|
88
|
+
|
89
|
+
return function colorChang(_x, _x2) {
|
90
|
+
return _ref.apply(this, arguments);
|
91
|
+
};
|
92
|
+
}();
|
91
93
|
|
92
|
-
var backgroundChang = function
|
93
|
-
|
94
|
+
var backgroundChang = /*#__PURE__*/function () {
|
95
|
+
var _ref2 = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee2(value, type) {
|
94
96
|
return _regenerator["default"].wrap(function _callee2$(_context2) {
|
95
97
|
while (1) switch (_context2.prev = _context2.next) {
|
96
98
|
case 0:
|
@@ -120,8 +122,12 @@ function FontColorDropdown(props) {
|
|
120
122
|
return _context2.stop();
|
121
123
|
}
|
122
124
|
}, _callee2);
|
123
|
-
}))
|
124
|
-
|
125
|
+
}));
|
126
|
+
|
127
|
+
return function backgroundChang(_x3, _x4) {
|
128
|
+
return _ref2.apply(this, arguments);
|
129
|
+
};
|
130
|
+
}();
|
125
131
|
|
126
132
|
var onFocus = function onFocus() {// topo.historyManager.beginTransaction();
|
127
133
|
};
|
@@ -18,16 +18,14 @@ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "functio
|
|
18
18
|
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; }
|
19
19
|
|
20
20
|
var LayerAddResourceDrawer = function LayerAddResourceDrawer(props) {
|
21
|
-
var _ref;
|
22
|
-
|
23
21
|
var visible = props.visible,
|
24
22
|
layer = props.layer,
|
25
23
|
topo = props.topo,
|
26
24
|
topoEdit = props.topoEdit,
|
27
25
|
onClose = props.onClose;
|
28
26
|
|
29
|
-
var onOk = function
|
30
|
-
|
27
|
+
var onOk = /*#__PURE__*/function () {
|
28
|
+
var _ref = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee(selected) {
|
31
29
|
var layerData;
|
32
30
|
return _regenerator["default"].wrap(function _callee$(_context) {
|
33
31
|
while (1) switch (_context.prev = _context.next) {
|
@@ -44,8 +42,12 @@ var LayerAddResourceDrawer = function LayerAddResourceDrawer(props) {
|
|
44
42
|
return _context.stop();
|
45
43
|
}
|
46
44
|
}, _callee);
|
47
|
-
}))
|
48
|
-
|
45
|
+
}));
|
46
|
+
|
47
|
+
return function onOk(_x) {
|
48
|
+
return _ref.apply(this, arguments);
|
49
|
+
};
|
50
|
+
}();
|
49
51
|
|
50
52
|
return /*#__PURE__*/_react["default"].createElement(_NetworkTopoResourceSelectDrawer["default"], {
|
51
53
|
visible: visible,
|
@@ -26,16 +26,14 @@ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj &&
|
|
26
26
|
* @constructor
|
27
27
|
*/
|
28
28
|
var BindResourceDrawer = function BindResourceDrawer(props) {
|
29
|
-
var _ref;
|
30
|
-
|
31
29
|
var visible = props.visible,
|
32
30
|
topoEditApi = props.topoEditApi,
|
33
31
|
node = props.node,
|
34
32
|
currentResId = props.currentResId,
|
35
33
|
onClose = props.onClose;
|
36
34
|
|
37
|
-
var handleSave = function
|
38
|
-
|
35
|
+
var handleSave = /*#__PURE__*/function () {
|
36
|
+
var _ref = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee(selected) {
|
39
37
|
var result;
|
40
38
|
return _regenerator["default"].wrap(function _callee$(_context) {
|
41
39
|
while (1) switch (_context.prev = _context.next) {
|
@@ -66,8 +64,12 @@ var BindResourceDrawer = function BindResourceDrawer(props) {
|
|
66
64
|
return _context.stop();
|
67
65
|
}
|
68
66
|
}, _callee);
|
69
|
-
}))
|
70
|
-
|
67
|
+
}));
|
68
|
+
|
69
|
+
return function handleSave(_x) {
|
70
|
+
return _ref.apply(this, arguments);
|
71
|
+
};
|
72
|
+
}();
|
71
73
|
|
72
74
|
return /*#__PURE__*/_react["default"].createElement(_NetworkTopoResourceSelectDrawer["default"], {
|
73
75
|
visible: visible,
|
@@ -56,8 +56,6 @@ function getBindType(values) {
|
|
56
56
|
}
|
57
57
|
|
58
58
|
function Data(props) {
|
59
|
-
var _ref;
|
60
|
-
|
61
59
|
var node = props.node,
|
62
60
|
topo = props.topo,
|
63
61
|
topoEditApi = props.topoEditApi,
|
@@ -96,8 +94,8 @@ function Data(props) {
|
|
96
94
|
}
|
97
95
|
};
|
98
96
|
|
99
|
-
var handleBindTopoChange = function
|
100
|
-
|
97
|
+
var handleBindTopoChange = /*#__PURE__*/function () {
|
98
|
+
var _ref = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee(value, data) {
|
101
99
|
return _regenerator["default"].wrap(function _callee$(_context) {
|
102
100
|
while (1) switch (_context.prev = _context.next) {
|
103
101
|
case 0:
|
@@ -116,8 +114,12 @@ function Data(props) {
|
|
116
114
|
return _context.stop();
|
117
115
|
}
|
118
116
|
}, _callee);
|
119
|
-
}))
|
120
|
-
|
117
|
+
}));
|
118
|
+
|
119
|
+
return function handleBindTopoChange(_x, _x2) {
|
120
|
+
return _ref.apply(this, arguments);
|
121
|
+
};
|
122
|
+
}();
|
121
123
|
|
122
124
|
var RelateTopoTree = editorProps === null || editorProps === void 0 ? void 0 : editorProps.relateTopoTree;
|
123
125
|
return /*#__PURE__*/_react["default"].createElement(_collapse["default"], {
|
@@ -16,8 +16,6 @@ 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
|
-
|
21
19
|
var topo = props.topo,
|
22
20
|
backgroundConfig = props.backgroundConfig,
|
23
21
|
settingRuntimeState = props.settingRuntimeState;
|
@@ -26,8 +24,8 @@ function BackgroundSize(props) {
|
|
26
24
|
current: backgroundConfig.current
|
27
25
|
});
|
28
26
|
|
29
|
-
var setSize = function
|
30
|
-
|
27
|
+
var setSize = /*#__PURE__*/function () {
|
28
|
+
var _ref = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee(size) {
|
31
29
|
return _regenerator["default"].wrap(function _callee$(_context) {
|
32
30
|
while (1) switch (_context.prev = _context.next) {
|
33
31
|
case 0:
|
@@ -43,8 +41,12 @@ function BackgroundSize(props) {
|
|
43
41
|
return _context.stop();
|
44
42
|
}
|
45
43
|
}, _callee);
|
46
|
-
}))
|
47
|
-
|
44
|
+
}));
|
45
|
+
|
46
|
+
return function setSize(_x) {
|
47
|
+
return _ref.apply(this, arguments);
|
48
|
+
};
|
49
|
+
}();
|
48
50
|
|
49
51
|
return /*#__PURE__*/_react["default"].createElement(_NodeSizeInput["default"], {
|
50
52
|
nodeId: backgroundSizeConfig.nodeId,
|
@@ -34,8 +34,6 @@ 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
|
-
|
39
37
|
var topo = props.topo,
|
40
38
|
topoEditApi = props.topoEditApi;
|
41
39
|
var store = topo.store;
|
@@ -50,8 +48,8 @@ function TopoEditorTitleBar(props) {
|
|
50
48
|
exitFlag = _useState[0],
|
51
49
|
setExitFlag = _useState[1];
|
52
50
|
|
53
|
-
var saveAndExit = function
|
54
|
-
|
51
|
+
var saveAndExit = /*#__PURE__*/function () {
|
52
|
+
var _ref = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee() {
|
55
53
|
return _regenerator["default"].wrap(function _callee$(_context) {
|
56
54
|
while (1) switch (_context.prev = _context.next) {
|
57
55
|
case 0:
|
@@ -66,8 +64,12 @@ function TopoEditorTitleBar(props) {
|
|
66
64
|
return _context.stop();
|
67
65
|
}
|
68
66
|
}, _callee);
|
69
|
-
}))
|
70
|
-
|
67
|
+
}));
|
68
|
+
|
69
|
+
return function saveAndExit() {
|
70
|
+
return _ref.apply(this, arguments);
|
71
|
+
};
|
72
|
+
}();
|
71
73
|
|
72
74
|
(0, _react.useEffect)(function () {
|
73
75
|
if (!saving && exitFlag) {
|
@@ -96,13 +98,11 @@ function TopoEditorTitleBar(props) {
|
|
96
98
|
}, "\u4FDD\u5B58"), /*#__PURE__*/_react["default"].createElement(_button["default"], {
|
97
99
|
className: _TitleBarModule["default"].button,
|
98
100
|
onClick: function onClick() {
|
99
|
-
var _onOk, _onCancel;
|
100
|
-
|
101
101
|
_dialog["default"].confirm({
|
102
102
|
title: '提示',
|
103
103
|
content: '若直接退出,图上修改的内容将不会保存!',
|
104
|
-
onOk: function
|
105
|
-
|
104
|
+
onOk: function () {
|
105
|
+
var _onOk = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee2() {
|
106
106
|
return _regenerator["default"].wrap(function _callee2$(_context2) {
|
107
107
|
while (1) switch (_context2.prev = _context2.next) {
|
108
108
|
case 0:
|
@@ -113,10 +113,16 @@ function TopoEditorTitleBar(props) {
|
|
113
113
|
return _context2.stop();
|
114
114
|
}
|
115
115
|
}, _callee2);
|
116
|
-
}))
|
117
|
-
|
118
|
-
|
119
|
-
|
116
|
+
}));
|
117
|
+
|
118
|
+
function onOk() {
|
119
|
+
return _onOk.apply(this, arguments);
|
120
|
+
}
|
121
|
+
|
122
|
+
return onOk;
|
123
|
+
}(),
|
124
|
+
onCancel: function () {
|
125
|
+
var _onCancel = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee3() {
|
120
126
|
return _regenerator["default"].wrap(function _callee3$(_context3) {
|
121
127
|
while (1) switch (_context3.prev = _context3.next) {
|
122
128
|
case 0:
|
@@ -127,8 +133,14 @@ function TopoEditorTitleBar(props) {
|
|
127
133
|
return _context3.stop();
|
128
134
|
}
|
129
135
|
}, _callee3);
|
130
|
-
}))
|
131
|
-
|
136
|
+
}));
|
137
|
+
|
138
|
+
function onCancel() {
|
139
|
+
return _onCancel.apply(this, arguments);
|
140
|
+
}
|
141
|
+
|
142
|
+
return onCancel;
|
143
|
+
}(),
|
132
144
|
cancelProps: {
|
133
145
|
children: '退出'
|
134
146
|
},
|
@@ -32,8 +32,6 @@ var _useHtDataPropertyChangeListener = _interopRequireDefault(require("./ht/useH
|
|
32
32
|
* @param {*} props
|
33
33
|
*/
|
34
34
|
var usePolling = function usePolling(props) {
|
35
|
-
var _fetchData, _refresh;
|
36
|
-
|
37
35
|
var topo = props.topo;
|
38
36
|
var store = topo.store;
|
39
37
|
(0, _useCiAttributeChange["default"])({
|
@@ -52,7 +50,16 @@ var usePolling = function usePolling(props) {
|
|
52
50
|
*/
|
53
51
|
|
54
52
|
function fetchData() {
|
55
|
-
return
|
53
|
+
return _fetchData.apply(this, arguments);
|
54
|
+
}
|
55
|
+
/**
|
56
|
+
*
|
57
|
+
* @returns {{id, attributes: object[], metrics: object[]}[]} 属性和指标
|
58
|
+
*/
|
59
|
+
|
60
|
+
|
61
|
+
function _fetchData() {
|
62
|
+
_fetchData = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee() {
|
56
63
|
var _topo$store$getModelS, resIdsList, nodeIdsList, codes, param, _yield$Promise$all, ciMetricsResult, mergeData, transformLinkData, adapterIpv6;
|
57
64
|
|
58
65
|
return _regenerator["default"].wrap(function _callee$(_context) {
|
@@ -161,16 +168,17 @@ var usePolling = function usePolling(props) {
|
|
161
168
|
return _context.stop();
|
162
169
|
}
|
163
170
|
}, _callee);
|
164
|
-
}))
|
171
|
+
}));
|
172
|
+
return _fetchData.apply(this, arguments);
|
165
173
|
}
|
166
|
-
/**
|
167
|
-
*
|
168
|
-
* @returns {{id, attributes: object[], metrics: object[]}[]} 属性和指标
|
169
|
-
*/
|
170
|
-
|
171
174
|
|
172
175
|
function refresh() {
|
173
|
-
return
|
176
|
+
return _refresh.apply(this, arguments);
|
177
|
+
} // 轮询hooks
|
178
|
+
|
179
|
+
|
180
|
+
function _refresh() {
|
181
|
+
_refresh = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee2() {
|
174
182
|
var data;
|
175
183
|
return _regenerator["default"].wrap(function _callee2$(_context2) {
|
176
184
|
while (1) switch (_context2.prev = _context2.next) {
|
@@ -195,9 +203,9 @@ var usePolling = function usePolling(props) {
|
|
195
203
|
return _context2.stop();
|
196
204
|
}
|
197
205
|
}, _callee2);
|
198
|
-
}))
|
199
|
-
|
200
|
-
|
206
|
+
}));
|
207
|
+
return _refresh.apply(this, arguments);
|
208
|
+
}
|
201
209
|
|
202
210
|
var _useRequest = (0, _ahooks.useRequest)(refresh, {
|
203
211
|
pollingInterval: 60 * 1000,
|
@@ -20,14 +20,12 @@ var _ResourceConfigUtil = _interopRequireDefault(require("../../utils/ResourceCo
|
|
20
20
|
var _template = require("../../utils/template");
|
21
21
|
|
22
22
|
function _default(props) {
|
23
|
-
var _ref, _ref2, _updateGroupResources, _addLayerStaticResources;
|
24
|
-
|
25
23
|
var topo = props.topo;
|
26
24
|
var store = topo.store;
|
27
25
|
var editDispatchers = store.useModelDispatchers('topoConfig');
|
28
26
|
|
29
|
-
var loadConfig = function
|
30
|
-
|
27
|
+
var loadConfig = /*#__PURE__*/function () {
|
28
|
+
var _ref = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee() {
|
31
29
|
return _regenerator["default"].wrap(function _callee$(_context) {
|
32
30
|
while (1) switch (_context.prev = _context.next) {
|
33
31
|
case 0:
|
@@ -39,8 +37,12 @@ function _default(props) {
|
|
39
37
|
return _context.stop();
|
40
38
|
}
|
41
39
|
}, _callee);
|
42
|
-
}))
|
43
|
-
|
40
|
+
}));
|
41
|
+
|
42
|
+
return function loadConfig() {
|
43
|
+
return _ref.apply(this, arguments);
|
44
|
+
};
|
45
|
+
}();
|
44
46
|
/**
|
45
47
|
* 获取拓扑资源配置
|
46
48
|
*
|
@@ -68,8 +70,8 @@ function _default(props) {
|
|
68
70
|
return getConfig().groups;
|
69
71
|
}
|
70
72
|
|
71
|
-
var updateConfig = function
|
72
|
-
|
73
|
+
var updateConfig = /*#__PURE__*/function () {
|
74
|
+
var _ref2 = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee2(config) {
|
73
75
|
return _regenerator["default"].wrap(function _callee2$(_context2) {
|
74
76
|
while (1) switch (_context2.prev = _context2.next) {
|
75
77
|
case 0:
|
@@ -81,8 +83,12 @@ function _default(props) {
|
|
81
83
|
return _context2.stop();
|
82
84
|
}
|
83
85
|
}, _callee2);
|
84
|
-
}))
|
85
|
-
|
86
|
+
}));
|
87
|
+
|
88
|
+
return function updateConfig(_x) {
|
89
|
+
return _ref2.apply(this, arguments);
|
90
|
+
};
|
91
|
+
}(); // 查找分组
|
86
92
|
|
87
93
|
|
88
94
|
var getGroupById = function getGroupById(groupId) {
|
@@ -179,7 +185,11 @@ function _default(props) {
|
|
179
185
|
function addGroupAt(group, index) {}
|
180
186
|
|
181
187
|
function updateGroupResources(_x2, _x3) {
|
182
|
-
return
|
188
|
+
return _updateGroupResources.apply(this, arguments);
|
189
|
+
}
|
190
|
+
|
191
|
+
function _updateGroupResources() {
|
192
|
+
_updateGroupResources = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee3(groupData, resources) {
|
183
193
|
var config;
|
184
194
|
return _regenerator["default"].wrap(function _callee3$(_context3) {
|
185
195
|
while (1) switch (_context3.prev = _context3.next) {
|
@@ -204,7 +214,8 @@ function _default(props) {
|
|
204
214
|
return _context3.stop();
|
205
215
|
}
|
206
216
|
}, _callee3);
|
207
|
-
}))
|
217
|
+
}));
|
218
|
+
return _updateGroupResources.apply(this, arguments);
|
208
219
|
}
|
209
220
|
|
210
221
|
function matchGroup(group, data) {
|
@@ -212,7 +223,18 @@ function _default(props) {
|
|
212
223
|
}
|
213
224
|
|
214
225
|
function addLayerStaticResources(_x4, _x5) {
|
215
|
-
return
|
226
|
+
return _addLayerStaticResources.apply(this, arguments);
|
227
|
+
}
|
228
|
+
/**
|
229
|
+
* 从拓扑图解析出拓扑资源配置
|
230
|
+
*
|
231
|
+
* @param {ht.DataModel} dataModel
|
232
|
+
* @returns {{layers, groups, resources}}
|
233
|
+
*/
|
234
|
+
|
235
|
+
|
236
|
+
function _addLayerStaticResources() {
|
237
|
+
_addLayerStaticResources = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee4(data, newResourceIds) {
|
216
238
|
var config;
|
217
239
|
return _regenerator["default"].wrap(function _callee4$(_context4) {
|
218
240
|
while (1) switch (_context4.prev = _context4.next) {
|
@@ -239,15 +261,9 @@ function _default(props) {
|
|
239
261
|
return _context4.stop();
|
240
262
|
}
|
241
263
|
}, _callee4);
|
242
|
-
}))
|
264
|
+
}));
|
265
|
+
return _addLayerStaticResources.apply(this, arguments);
|
243
266
|
}
|
244
|
-
/**
|
245
|
-
* 从拓扑图解析出拓扑资源配置
|
246
|
-
*
|
247
|
-
* @param {ht.DataModel} dataModel
|
248
|
-
* @returns {{layers, groups, resources}}
|
249
|
-
*/
|
250
|
-
|
251
267
|
|
252
268
|
function getConfigFromHt() {
|
253
269
|
return _ResourceConfigUtil["default"].getResourceConfigFromHt(topo);
|