@riil-frontend/component-topology 2.15.44 → 2.15.45
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/index.css +1 -1
- package/build/index.js +2 -2
- package/es/components/Drawer/index.js +8 -2
- package/es/components/TemplateButton/index.module.scss +1 -0
- package/es/core/common/hooks/ht/useDataModelDataPropertyChange.js +13 -4
- package/es/core/common/icons/icon.js +1 -1
- package/es/core/common/icons/useIcons.js +1 -1
- package/es/core/components/TopoView/topoView.js +8 -18
- package/es/core/{models/createTopoApp.js → createTopoApp.js} +1 -1
- package/es/core/editor/components/BackgroundView/index.module.scss +1 -0
- package/es/core/editor/components/{iconManage/IconManage.js → CustomIconPlugin/CustomIconPlugin.js} +3 -3
- package/es/core/editor/components/{iconManage → CustomIconPlugin}/RenameDialog.js +1 -1
- package/es/core/editor/components/{iconManage → CustomIconPlugin}/UploadIconDialog.js +16 -2
- package/es/core/editor/components/{iconManage → CustomIconPlugin}/UploadIconDialog.module.scss +0 -0
- package/es/core/editor/components/{iconManage → CustomIconPlugin}/UploadIconDialog.scss +0 -0
- package/es/core/editor/components/{iconManage → CustomIconPlugin}/UploadIconDialogWrapper.js +1 -1
- package/es/core/editor/components/CustomIconPlugin/index.js +2 -0
- package/es/core/editor/components/{iconManage → CustomIconPlugin}/utils/svgToShape.js +0 -0
- package/es/core/editor/components/EditorPlugin.js +2 -2
- package/es/core/editor/components/settings/propertyViews/group/SettingTab/Setting.js +2 -0
- package/es/core/models/TopoApp.js +9 -5
- package/es/core/store/coreModels.js +32 -26
- package/es/core/store/createStore.js +1 -1
- package/es/core/test/Test.js +3 -1
- package/es/core/viewer/contextmenu/buildNodeContextmenu.js +65 -64
- package/es/createTopo.js +1 -1
- package/es/hooks/useAlarm.js +3 -6
- package/es/hooks/useResourceConfig.js +1 -1
- package/es/hooks/useTopoEdit.js +4 -8
- package/es/models/{iconManage.js → customIcon.js} +1 -1
- package/es/models/topoBizMod.js +22 -52
- package/es/models/{topoCreateMod.js → topoConfig.js} +8 -4
- package/es/models/topoMod.js +32 -69
- package/es/{components → topoCenter/components}/Link/form.js +0 -0
- package/es/{components → topoCenter/components}/Link/hook.js +0 -0
- package/es/{components → topoCenter/components}/Link/index copy.js +1 -1
- package/es/{components → topoCenter/components}/Link/index.js +1 -1
- package/es/{components → topoCenter/components}/Link/index.module.scss +0 -0
- package/es/{components → topoCenter/components}/Link/setting.js +0 -0
- package/es/topoCenter/components/TopoView.js +16 -3
- package/es/topoCenter/components/Topology.js +0 -5
- package/es/{core/editor/components → topoCenter/components/editor}/LinkDynamicStyleSettingDrawer/RuleSetting.js +0 -0
- package/es/{core/editor/components → topoCenter/components/editor}/LinkDynamicStyleSettingDrawer/RuleSetting.module.scss +0 -0
- package/es/{core/editor/components → topoCenter/components/editor}/LinkDynamicStyleSettingDrawer/index.js +0 -0
- package/es/{core/editor/components → topoCenter/components/editor}/LinkDynamicStyleSettingDrawer/rule/Rule.js +0 -0
- package/es/{core/editor/components → topoCenter/components/editor}/LinkDynamicStyleSettingDrawer/rule/Rule.module.scss +0 -0
- package/es/{core/editor/components → topoCenter/components/editor}/LinkDynamicStyleSettingDrawer/rule/RuleCondition.js +0 -0
- package/es/{core/editor/components → topoCenter/components/editor}/LinkDynamicStyleSettingDrawer/rule/RuleCondition.module.scss +0 -0
- package/es/{core/editor/components → topoCenter/components/editor}/LinkDynamicStyleSettingDrawer/rule/RuleCondition.scss +0 -0
- package/es/{core/editor/components → topoCenter/components/editor}/LinkDynamicStyleSettingDrawer/rule/RuleStyle.js +0 -0
- package/es/{core/editor/components → topoCenter/components/editor}/LinkDynamicStyleSettingDrawer/rule/RuleStyle.module.scss +0 -0
- package/es/topoCenter/components/editor/propertyViews/edge/EdgeGroupPropertyView.js +1 -1
- package/es/topoCenter/components/editor/propertyViews/edge/LinkPropertyView/Data/index.js +3 -3
- package/es/topoCenter/components/editor/propertyViews/edge/addLinkDrawer/AddLinkDrawer.js +1 -1
- package/es/topoCenter/components/editor/propertyViews/edge/addLinkDrawer/components/editLinkInfo.js +1 -1
- package/es/topoCenter/components/editor/propertyViews/edge/link/{LindInfoPreview.js → LinkInfoPreview.js} +1 -1
- package/es/topoCenter/components/editor/propertyViews/edge/link/{LindInfoPreview.module.scss → LinkInfoPreview.module.scss} +0 -0
- package/es/{hooks → topoCenter/hooks/viewer}/useRelateTopo.js +2 -2
- package/es/{models → topoCenter/store}/linkDynamicStyle.js +3 -3
- package/es/{models → topoCenter/store}/linkDynamicStyleConfig.js +2 -1
- package/es/{models → topoCenter/store}/linkManager.js +0 -0
- package/lib/components/Drawer/index.js +7 -2
- package/lib/components/TemplateButton/index.module.scss +1 -0
- package/lib/core/common/hooks/ht/useDataModelDataPropertyChange.js +13 -4
- package/lib/core/common/icons/icon.js +1 -1
- package/lib/core/common/icons/useIcons.js +1 -1
- package/lib/core/components/TopoView/topoView.js +9 -20
- package/lib/core/{models/createTopoApp.js → createTopoApp.js} +1 -1
- package/lib/core/editor/components/BackgroundView/index.module.scss +1 -0
- package/lib/core/editor/components/{iconManage/IconManage.js → CustomIconPlugin/CustomIconPlugin.js} +3 -3
- package/lib/core/editor/components/{iconManage → CustomIconPlugin}/RenameDialog.js +1 -1
- package/lib/core/editor/components/{iconManage → CustomIconPlugin}/UploadIconDialog.js +17 -2
- package/lib/core/editor/components/{iconManage → CustomIconPlugin}/UploadIconDialog.module.scss +0 -0
- package/lib/core/editor/components/{iconManage → CustomIconPlugin}/UploadIconDialog.scss +0 -0
- package/lib/core/editor/components/{iconManage → CustomIconPlugin}/UploadIconDialogWrapper.js +1 -1
- package/lib/core/editor/components/CustomIconPlugin/index.js +11 -0
- package/lib/core/editor/components/{iconManage → CustomIconPlugin}/utils/svgToShape.js +0 -0
- package/lib/core/editor/components/EditorPlugin.js +2 -2
- package/lib/core/editor/components/settings/propertyViews/group/SettingTab/Setting.js +2 -0
- package/lib/core/models/TopoApp.js +9 -5
- package/lib/core/store/coreModels.js +35 -26
- package/lib/core/store/createStore.js +2 -2
- package/lib/core/test/Test.js +3 -1
- package/lib/core/viewer/contextmenu/buildNodeContextmenu.js +65 -64
- package/lib/createTopo.js +1 -1
- package/lib/hooks/useAlarm.js +3 -6
- package/lib/hooks/useResourceConfig.js +1 -1
- package/lib/hooks/useTopoEdit.js +4 -8
- package/lib/models/{iconManage.js → customIcon.js} +1 -1
- package/lib/models/topoBizMod.js +22 -52
- package/lib/models/{topoCreateMod.js → topoConfig.js} +7 -4
- package/lib/models/topoMod.js +32 -69
- package/lib/{components → topoCenter/components}/Link/form.js +0 -0
- package/lib/{components → topoCenter/components}/Link/hook.js +0 -0
- package/lib/{components → topoCenter/components}/Link/index copy.js +1 -1
- package/lib/{components → topoCenter/components}/Link/index.js +1 -1
- package/lib/{components → topoCenter/components}/Link/index.module.scss +0 -0
- package/lib/{components → topoCenter/components}/Link/setting.js +0 -0
- package/lib/topoCenter/components/TopoView.js +19 -3
- package/lib/topoCenter/components/Topology.js +0 -7
- package/lib/{core/editor/components → topoCenter/components/editor}/LinkDynamicStyleSettingDrawer/RuleSetting.js +0 -0
- package/lib/{core/editor/components → topoCenter/components/editor}/LinkDynamicStyleSettingDrawer/RuleSetting.module.scss +0 -0
- package/lib/{core/editor/components → topoCenter/components/editor}/LinkDynamicStyleSettingDrawer/index.js +0 -0
- package/lib/{core/editor/components → topoCenter/components/editor}/LinkDynamicStyleSettingDrawer/rule/Rule.js +0 -0
- package/lib/{core/editor/components → topoCenter/components/editor}/LinkDynamicStyleSettingDrawer/rule/Rule.module.scss +0 -0
- package/lib/{core/editor/components → topoCenter/components/editor}/LinkDynamicStyleSettingDrawer/rule/RuleCondition.js +0 -0
- package/lib/{core/editor/components → topoCenter/components/editor}/LinkDynamicStyleSettingDrawer/rule/RuleCondition.module.scss +0 -0
- package/lib/{core/editor/components → topoCenter/components/editor}/LinkDynamicStyleSettingDrawer/rule/RuleCondition.scss +0 -0
- package/lib/{core/editor/components → topoCenter/components/editor}/LinkDynamicStyleSettingDrawer/rule/RuleStyle.js +0 -0
- package/lib/{core/editor/components → topoCenter/components/editor}/LinkDynamicStyleSettingDrawer/rule/RuleStyle.module.scss +0 -0
- package/lib/topoCenter/components/editor/propertyViews/edge/EdgeGroupPropertyView.js +2 -2
- package/lib/topoCenter/components/editor/propertyViews/edge/LinkPropertyView/Data/index.js +8 -8
- package/lib/topoCenter/components/editor/propertyViews/edge/addLinkDrawer/AddLinkDrawer.js +1 -1
- package/lib/topoCenter/components/editor/propertyViews/edge/addLinkDrawer/components/editLinkInfo.js +1 -1
- package/lib/topoCenter/components/editor/propertyViews/edge/link/{LindInfoPreview.js → LinkInfoPreview.js} +4 -4
- package/lib/topoCenter/components/editor/propertyViews/edge/link/{LindInfoPreview.module.scss → LinkInfoPreview.module.scss} +0 -0
- package/lib/{hooks → topoCenter/hooks/viewer}/useRelateTopo.js +2 -2
- package/lib/{models → topoCenter/store}/linkDynamicStyle.js +3 -3
- package/lib/{models → topoCenter/store}/linkDynamicStyleConfig.js +2 -1
- package/lib/{models → topoCenter/store}/linkManager.js +0 -0
- package/package.json +2 -2
- package/es/core/editor/LinkDynamicStyleConfig.js +0 -16
- package/es/core/store/getStoreModels.js +0 -40
- package/lib/core/editor/LinkDynamicStyleConfig.js +0 -21
- package/lib/core/store/getStoreModels.js +0 -67
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import _Drawer from "@alifd/next/es/drawer";
|
|
2
2
|
import _extends from "@babel/runtime/helpers/extends";
|
|
3
3
|
import _Button from "@alifd/next/es/button";
|
|
4
|
+
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/objectWithoutPropertiesLoose";
|
|
5
|
+
var _excluded = ["bodyClassName"];
|
|
4
6
|
import React from 'react';
|
|
5
7
|
import classnames from 'classnames';
|
|
6
8
|
import styles from "./index.module.scss";
|
|
@@ -24,6 +26,10 @@ var Drawer = function Drawer(props) {
|
|
|
24
26
|
onSave = props.onSave,
|
|
25
27
|
drawerProps = props.drawerProps,
|
|
26
28
|
children = props.children;
|
|
29
|
+
|
|
30
|
+
var bodyClassName = drawerProps.bodyClassName,
|
|
31
|
+
otherDrawerProps = _objectWithoutPropertiesLoose(drawerProps, _excluded);
|
|
32
|
+
|
|
27
33
|
return /*#__PURE__*/React.createElement(_Drawer, _extends({
|
|
28
34
|
title: title,
|
|
29
35
|
placement: "right",
|
|
@@ -31,12 +37,12 @@ var Drawer = function Drawer(props) {
|
|
|
31
37
|
headerStyle: headerStyle,
|
|
32
38
|
bodyStyle: bodyStyle,
|
|
33
39
|
closeMode: ['close', 'esc']
|
|
34
|
-
},
|
|
40
|
+
}, otherDrawerProps, {
|
|
35
41
|
className: classnames(styles.drawer, drawerProps.className),
|
|
36
42
|
visible: visible,
|
|
37
43
|
onClose: onClose
|
|
38
44
|
}), /*#__PURE__*/React.createElement("div", {
|
|
39
|
-
className: classnames(styles.content,
|
|
45
|
+
className: classnames(styles.content, bodyClassName)
|
|
40
46
|
}, children), footer && /*#__PURE__*/React.createElement("div", {
|
|
41
47
|
className: styles.footer
|
|
42
48
|
}, /*#__PURE__*/React.createElement(_Button, {
|
|
@@ -1,10 +1,19 @@
|
|
|
1
1
|
import { useEffect } from 'react';
|
|
2
2
|
export default (function (topo, fn) {
|
|
3
|
+
var topoModState = topo.store.useModelState('topoMod');
|
|
4
|
+
var graphLoaded = topoModState.graphLoaded;
|
|
3
5
|
useEffect(function () {
|
|
4
|
-
var dataModel
|
|
5
|
-
|
|
6
|
+
var dataModel;
|
|
7
|
+
|
|
8
|
+
if (graphLoaded) {
|
|
9
|
+
dataModel = topo.getDataModel();
|
|
10
|
+
dataModel.addDataPropertyChangeListener(fn);
|
|
11
|
+
}
|
|
12
|
+
|
|
6
13
|
return function () {
|
|
7
|
-
dataModel
|
|
14
|
+
if (dataModel) {
|
|
15
|
+
dataModel.removeDataPropertyChangeListener(fn);
|
|
16
|
+
}
|
|
8
17
|
};
|
|
9
|
-
}, [fn]);
|
|
18
|
+
}, [topo, graphLoaded, fn]);
|
|
10
19
|
});
|
|
@@ -67,7 +67,7 @@ export function transformCustomIcons2HtIcons(icons) {
|
|
|
67
67
|
*/
|
|
68
68
|
|
|
69
69
|
export function getUserCustomIcons(topo) {
|
|
70
|
-
var uploadIcons = topo.store.getModelState('
|
|
70
|
+
var uploadIcons = topo.store.getModelState('customIcon').icons;
|
|
71
71
|
return [].concat(transformCustomIcons2HtIcons(uploadIcons.node));
|
|
72
72
|
} // 获得节点图标列表
|
|
73
73
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { getGroupDefaultIcons, getNodeDefaultIcons, transformCustomIcon2HtIcon } from "./icon";
|
|
2
2
|
|
|
3
3
|
function useCustomIcons(topo) {
|
|
4
|
-
var _topo$store$useModelS = topo.store.useModelState('
|
|
4
|
+
var _topo$store$useModelS = topo.store.useModelState('customIcon'),
|
|
5
5
|
icons = _topo$store$useModelS.icons;
|
|
6
6
|
|
|
7
7
|
var customIcons = icons.node.map(transformCustomIcon2HtIcon);
|
|
@@ -7,7 +7,6 @@ import rlog from "@riil-frontend/component-topology-utils/es/rlog";
|
|
|
7
7
|
import { useEventListener, useCbbEventListener } from "@riil-frontend/component-riil-event-emitter";
|
|
8
8
|
import useTopoEdit from "../../../hooks/useTopoEdit";
|
|
9
9
|
import useSelection from "../../../hooks/useSelection";
|
|
10
|
-
import useRelateTopo from "../../../hooks/useRelateTopo";
|
|
11
10
|
import showMessage from "../../utils/showMessage";
|
|
12
11
|
import EditorPlugin from "../../editor/components/EditorPlugin";
|
|
13
12
|
import ViewerPlugin from "../../viewer/components/plugins/ViewerPlugin";
|
|
@@ -15,10 +14,10 @@ import TitleBar from "../titlebar/TitleBar";
|
|
|
15
14
|
import { TPL_TREE } from "../../../utils/template";
|
|
16
15
|
import PropertyView from "../../editor/components/settings/PropertyView";
|
|
17
16
|
import BackgroundView from "../../editor/components/BackgroundView";
|
|
18
|
-
import styles from "./TopoView.module.scss";
|
|
19
17
|
import { updateEdgeExpanded } from "../../utils/edgeUtil";
|
|
18
|
+
import styles from "./TopoView.module.scss";
|
|
20
19
|
|
|
21
|
-
var
|
|
20
|
+
var Topology = function Topology(props) {
|
|
22
21
|
var _classnames, _graphViewProps$creat;
|
|
23
22
|
|
|
24
23
|
var topo = props.topo,
|
|
@@ -34,6 +33,7 @@ var TopoView = function TopoView(props) {
|
|
|
34
33
|
nodeDeleteable = props.nodeDeleteable,
|
|
35
34
|
onNodeDelete = props.onNodeDelete,
|
|
36
35
|
onLineDelete = props.onLineDelete,
|
|
36
|
+
onEvent = props.onEvent,
|
|
37
37
|
_props$graphViewProps = props.graphViewProps,
|
|
38
38
|
graphViewProps = _props$graphViewProps === void 0 ? {} : _props$graphViewProps,
|
|
39
39
|
viewerProps = props.viewerProps,
|
|
@@ -80,10 +80,7 @@ var TopoView = function TopoView(props) {
|
|
|
80
80
|
var onExitEdit = topoEdit.onExitEdit,
|
|
81
81
|
onBindData = topoEdit.onBindData,
|
|
82
82
|
onDeleteElement = topoEdit.onDeleteElement,
|
|
83
|
-
onSaveTopo = topoEdit.onSaveTopo;
|
|
84
|
-
var relateTopo = useRelateTopo({
|
|
85
|
-
topo: topo
|
|
86
|
-
}); // useAlarm({
|
|
83
|
+
onSaveTopo = topoEdit.onSaveTopo; // useAlarm({
|
|
87
84
|
// topo,
|
|
88
85
|
// });
|
|
89
86
|
|
|
@@ -112,13 +109,6 @@ var TopoView = function TopoView(props) {
|
|
|
112
109
|
useEffect(function () {
|
|
113
110
|
// rlog.debug("TopoView.useEffect topoData", topoData);
|
|
114
111
|
setTData(buildLoadOptions ? buildLoadOptions(topoData) : topoData);
|
|
115
|
-
|
|
116
|
-
if (topoData) {
|
|
117
|
-
// TODO 移到模型中
|
|
118
|
-
topoDispatchers.update({
|
|
119
|
-
currentTopo: topoData.config
|
|
120
|
-
});
|
|
121
|
-
}
|
|
122
112
|
}, [topoData]);
|
|
123
113
|
useEffect(function () {
|
|
124
114
|
return function () {
|
|
@@ -172,7 +162,7 @@ var TopoView = function TopoView(props) {
|
|
|
172
162
|
|
|
173
163
|
var handleEvent = function handleEvent(event) {
|
|
174
164
|
rlog.debug("TopoView:onEvent", event);
|
|
175
|
-
|
|
165
|
+
onEvent(event);
|
|
176
166
|
topoEdit.onEvent(event);
|
|
177
167
|
|
|
178
168
|
switch (event.name) {
|
|
@@ -274,7 +264,7 @@ var TopoView = function TopoView(props) {
|
|
|
274
264
|
}));
|
|
275
265
|
};
|
|
276
266
|
|
|
277
|
-
|
|
267
|
+
Topology.propTypes = {
|
|
278
268
|
// 拓扑模型
|
|
279
269
|
topo: PropTypes.any.isRequired,
|
|
280
270
|
defaultEnterEditMode: PropTypes.bool,
|
|
@@ -294,10 +284,10 @@ TopoView.propTypes = {
|
|
|
294
284
|
*/
|
|
295
285
|
titleBar: PropTypes.oneOf([React.ReactNode, false])
|
|
296
286
|
};
|
|
297
|
-
|
|
287
|
+
Topology.defaultProps = {
|
|
298
288
|
defaultEnterEditMode: false,
|
|
299
289
|
viewerProps: {},
|
|
300
290
|
editorProps: {} // titleBar: false,
|
|
301
291
|
|
|
302
292
|
};
|
|
303
|
-
export default
|
|
293
|
+
export default Topology;
|
package/es/core/editor/components/{iconManage/IconManage.js → CustomIconPlugin/CustomIconPlugin.js}
RENAMED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import React, {
|
|
1
|
+
import React, { useEffect } from 'react';
|
|
2
2
|
import UploadIconDialogWrapper from "./UploadIconDialogWrapper";
|
|
3
3
|
import RenameDialog from "./RenameDialog";
|
|
4
|
-
export default function
|
|
4
|
+
export default function CustomIconPlugin(props) {
|
|
5
5
|
var topo = props.topo;
|
|
6
6
|
var store = topo.store;
|
|
7
|
-
var dispatchers = store.getModelDispatchers('
|
|
7
|
+
var dispatchers = store.getModelDispatchers('customIcon'); // 初始化时注册事件
|
|
8
8
|
|
|
9
9
|
useEffect(function () {
|
|
10
10
|
var notifier = topo.view.topoClient.notifier; // 测试代码
|
|
@@ -11,7 +11,7 @@ export default function RenameDialog(props) {
|
|
|
11
11
|
var topo = props.topo;
|
|
12
12
|
var store = topo.store;
|
|
13
13
|
|
|
14
|
-
var _store$useModel = store.useModel('
|
|
14
|
+
var _store$useModel = store.useModel('customIcon'),
|
|
15
15
|
state = _store$useModel[0],
|
|
16
16
|
dispatchers = _store$useModel[1];
|
|
17
17
|
|
|
@@ -13,6 +13,7 @@ import _ from 'lodash';
|
|
|
13
13
|
import _svgToShape from "./utils/svgToShape";
|
|
14
14
|
import styles from "./UploadIconDialog.module.scss";
|
|
15
15
|
import "./UploadIconDialog.scss";
|
|
16
|
+
import rlog from '@riil-frontend/component-topology-utils/es/rlog';
|
|
16
17
|
var config = _ConfigProvider.config;
|
|
17
18
|
|
|
18
19
|
function getFileName(file) {
|
|
@@ -98,7 +99,18 @@ var UploadIconDialog = /*#__PURE__*/function (_React$Component) {
|
|
|
98
99
|
|
|
99
100
|
_this.setState({
|
|
100
101
|
files: validFiles
|
|
101
|
-
});
|
|
102
|
+
}); // 上传接口报错后只会通知该回调,移除上传loading
|
|
103
|
+
|
|
104
|
+
|
|
105
|
+
if (_this.state.uploading && files.filter(function (file) {
|
|
106
|
+
return file.state === 'error';
|
|
107
|
+
}).length && !files.filter(function (file) {
|
|
108
|
+
return file.state === 'uploading';
|
|
109
|
+
}).length) {
|
|
110
|
+
_this.setState({
|
|
111
|
+
uploading: false
|
|
112
|
+
});
|
|
113
|
+
}
|
|
102
114
|
};
|
|
103
115
|
|
|
104
116
|
_this.submit = function () {
|
|
@@ -198,7 +210,9 @@ var UploadIconDialog = /*#__PURE__*/function (_React$Component) {
|
|
|
198
210
|
});
|
|
199
211
|
};
|
|
200
212
|
|
|
201
|
-
_this.handleUploadError = function () {
|
|
213
|
+
_this.handleUploadError = function () {
|
|
214
|
+
rlog.error('上传失败');
|
|
215
|
+
};
|
|
202
216
|
|
|
203
217
|
_this.onClose = function () {
|
|
204
218
|
var dispatchers = _this.props.dispatchers;
|
package/es/core/editor/components/{iconManage → CustomIconPlugin}/UploadIconDialog.module.scss
RENAMED
|
File without changes
|
|
File without changes
|
package/es/core/editor/components/{iconManage → CustomIconPlugin}/UploadIconDialogWrapper.js
RENAMED
|
@@ -4,7 +4,7 @@ export default function UploadIconDialogWrapper(props) {
|
|
|
4
4
|
var topo = props.topo;
|
|
5
5
|
var store = topo.store;
|
|
6
6
|
|
|
7
|
-
var _store$useModel = store.useModel('
|
|
7
|
+
var _store$useModel = store.useModel('customIcon'),
|
|
8
8
|
state = _store$useModel[0],
|
|
9
9
|
dispatchers = _store$useModel[1];
|
|
10
10
|
|
|
File without changes
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
2
|
import React from "react";
|
|
3
|
-
import
|
|
3
|
+
import CustomIconPlugin from "./CustomIconPlugin";
|
|
4
4
|
import SaveLoading from "./plugins/SaveLoading";
|
|
5
5
|
import MultipleResourceSelectPlugin from "./plugins/MultipleResourceSelectPlugin";
|
|
6
6
|
import GroupAddResourceDrawerPlugin from "./GroupAddResourceDrawerPlugin";
|
|
@@ -10,7 +10,7 @@ export default function TopoEditorPlugin(props) {
|
|
|
10
10
|
topoEdit = props.topoEdit,
|
|
11
11
|
editorProps = props.editorProps;
|
|
12
12
|
var store = topo.store;
|
|
13
|
-
var plugins = [SaveLoading, GroupAddResourceDrawerPlugin, MultipleResourceSelectPlugin,
|
|
13
|
+
var plugins = [SaveLoading, GroupAddResourceDrawerPlugin, MultipleResourceSelectPlugin, CustomIconPlugin].concat((editorProps === null || editorProps === void 0 ? void 0 : editorProps.plugins) || []);
|
|
14
14
|
return /*#__PURE__*/React.createElement(React.Fragment, null, plugins.map(function (Plugin, index) {
|
|
15
15
|
return /*#__PURE__*/React.createElement(Plugin, _extends({
|
|
16
16
|
key: index,
|
|
@@ -19,6 +19,7 @@ export default function GroupSetting(props) {
|
|
|
19
19
|
editorProps = props.editorProps,
|
|
20
20
|
group = props.group;
|
|
21
21
|
var expanded = values.expanded;
|
|
22
|
+
var id = values.id;
|
|
22
23
|
|
|
23
24
|
var field = _Field.useField({
|
|
24
25
|
autoUnmount: false,
|
|
@@ -93,6 +94,7 @@ export default function GroupSetting(props) {
|
|
|
93
94
|
maxLength: 30,
|
|
94
95
|
placeholder: "\u8BF7\u8F93\u5165"
|
|
95
96
|
})), expanded ? /*#__PURE__*/React.createElement(GroupExpandSetting, {
|
|
97
|
+
id: id,
|
|
96
98
|
group: group,
|
|
97
99
|
expanded: expanded,
|
|
98
100
|
topo: topo,
|
|
@@ -20,7 +20,7 @@ import { updateEdgeExpanded } from "../utils/edgeUtil";
|
|
|
20
20
|
import PluginManager from "./PluginManager";
|
|
21
21
|
import topoFactory from "./topoFactory"; // eslint-disable-next-line no-undef
|
|
22
22
|
|
|
23
|
-
var version = typeof "2.15.
|
|
23
|
+
var version = typeof "2.15.45" === 'string' ? "2.15.45" : null;
|
|
24
24
|
console.info("\u62D3\u6251\u7248\u672C: " + version);
|
|
25
25
|
/**
|
|
26
26
|
* 拓扑显示和编辑
|
|
@@ -75,6 +75,10 @@ var Topo = /*#__PURE__*/function () {
|
|
|
75
75
|
|
|
76
76
|
this.test = new Test(this);
|
|
77
77
|
this.uid = topoFactory.add(options.name, this);
|
|
78
|
+
};
|
|
79
|
+
|
|
80
|
+
_proto.destroy = function destroy() {
|
|
81
|
+
topoFactory.remove(this.uid);
|
|
78
82
|
}
|
|
79
83
|
/**
|
|
80
84
|
* TODO 移除
|
|
@@ -95,7 +99,7 @@ var Topo = /*#__PURE__*/function () {
|
|
|
95
99
|
return topoDispatchers.exit();
|
|
96
100
|
|
|
97
101
|
case 3:
|
|
98
|
-
|
|
102
|
+
this.destroy();
|
|
99
103
|
|
|
100
104
|
case 4:
|
|
101
105
|
case "end":
|
|
@@ -543,7 +547,7 @@ var Topo = /*#__PURE__*/function () {
|
|
|
543
547
|
|
|
544
548
|
case 7:
|
|
545
549
|
updateEdgeExpanded(this);
|
|
546
|
-
editDispatchers = this.store.getModelDispatchers('
|
|
550
|
+
editDispatchers = this.store.getModelDispatchers('topoConfig');
|
|
547
551
|
editDispatchers.switchToEditMode();
|
|
548
552
|
|
|
549
553
|
if (this.options.onSwitchToEditMode) {
|
|
@@ -551,7 +555,7 @@ var Topo = /*#__PURE__*/function () {
|
|
|
551
555
|
} // 加载自定义上传的图标
|
|
552
556
|
|
|
553
557
|
|
|
554
|
-
iconManageDispatchers = this.store.getModelDispatchers('
|
|
558
|
+
iconManageDispatchers = this.store.getModelDispatchers('customIcon');
|
|
555
559
|
iconManageDispatchers.loadEditorIcons();
|
|
556
560
|
|
|
557
561
|
case 13:
|
|
@@ -580,7 +584,7 @@ var Topo = /*#__PURE__*/function () {
|
|
|
580
584
|
return this.view.switchToViewMode();
|
|
581
585
|
|
|
582
586
|
case 2:
|
|
583
|
-
editDispatchers = this.store.getModelDispatchers('
|
|
587
|
+
editDispatchers = this.store.getModelDispatchers('topoConfig');
|
|
584
588
|
editDispatchers.switchToViewMode(this.id);
|
|
585
589
|
|
|
586
590
|
if (this.options.onSwitchToViewMode) {
|
|
@@ -1,32 +1,38 @@
|
|
|
1
|
-
import topoMod from "
|
|
2
|
-
import
|
|
3
|
-
import ciModel from "
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
import
|
|
11
|
-
import
|
|
12
|
-
import
|
|
13
|
-
import
|
|
14
|
-
import
|
|
15
|
-
import
|
|
1
|
+
import topoMod from "../../models/topoMod";
|
|
2
|
+
import customIcon from "../../models/customIcon";
|
|
3
|
+
import ciModel from "../../models/ciModel";
|
|
4
|
+
import selection from "../../models/selection";
|
|
5
|
+
import topoBizMod from "../../models/topoBizMod";
|
|
6
|
+
import topoConfig from "../../models/topoConfig";
|
|
7
|
+
import topoEdit from "../../models/topoEdit";
|
|
8
|
+
import topoView from "../../models/topoView";
|
|
9
|
+
import topoAlarm from "../../models/topoAlarm";
|
|
10
|
+
import topoGraphView from "../../models/topoGraphView";
|
|
11
|
+
import background from "../../models/background";
|
|
12
|
+
import displayConfig from "../../models/displayConfig";
|
|
13
|
+
import resourceWebControllUrlSetting from "../../models/resourceWebControllUrlSetting";
|
|
14
|
+
import topoBaseInfoOverview from "../../models/topoBaseInfoOverview";
|
|
15
|
+
import topoCenter from "../../topoCenter/store/topoCenter";
|
|
16
|
+
import functionAuth from "../../topoCenter/store/functionAuth";
|
|
17
|
+
import topoLinkMod from "../../topoCenter/store/topoLinkMod";
|
|
18
|
+
import topoTreeMod from "../../topoCenter/store/topoTreeMod";
|
|
16
19
|
export default {
|
|
17
20
|
topoMod: topoMod,
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
functionAuth: functionAuth,
|
|
21
|
-
linkDynamicStyle: linkDynamicStyle,
|
|
22
|
-
linkDynamicStyleConfig: linkDynamicStyleConfig,
|
|
23
|
-
permissionSetting: permissionSetting,
|
|
21
|
+
customIcon: customIcon,
|
|
22
|
+
selection: selection,
|
|
24
23
|
resourceWebControllUrlSetting: resourceWebControllUrlSetting,
|
|
25
24
|
topoBizMod: topoBizMod,
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
25
|
+
topoConfig: topoConfig,
|
|
26
|
+
topoLinkMod: topoLinkMod,
|
|
27
|
+
topoView: topoView,
|
|
28
|
+
background: background,
|
|
29
|
+
topoGraphView: topoGraphView,
|
|
30
|
+
topoAlarm: topoAlarm,
|
|
31
|
+
displayConfig: displayConfig,
|
|
32
|
+
topoBaseInfoOverview: topoBaseInfoOverview,
|
|
33
|
+
ciModel: ciModel,
|
|
34
|
+
functionAuth: functionAuth,
|
|
29
35
|
topoEdit: topoEdit,
|
|
30
|
-
|
|
31
|
-
|
|
36
|
+
topoCenter: topoCenter,
|
|
37
|
+
topoTreeMod: topoTreeMod
|
|
32
38
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
2
|
import { createStore } from '@ice/store';
|
|
3
|
-
import coreModels from "./
|
|
3
|
+
import coreModels from "./coreModels";
|
|
4
4
|
export default function (engine, extModels) {
|
|
5
5
|
if (extModels === void 0) {
|
|
6
6
|
extModels = {};
|
package/es/core/test/Test.js
CHANGED
|
@@ -8,9 +8,11 @@ var Test = /*#__PURE__*/function () {
|
|
|
8
8
|
var _proto = Test.prototype;
|
|
9
9
|
|
|
10
10
|
_proto.init = function init() {
|
|
11
|
+
var _this = this;
|
|
12
|
+
|
|
11
13
|
this.iconManage = {
|
|
12
14
|
openUpload: function openUpload(type) {
|
|
13
|
-
topo.store.getModelDispatchers('
|
|
15
|
+
_this.topo.store.getModelDispatchers('customIcon').open({
|
|
14
16
|
type: type || 'node'
|
|
15
17
|
});
|
|
16
18
|
}
|
|
@@ -6,70 +6,71 @@ export default function buildNodeContextmenu(topoApp) {
|
|
|
6
6
|
return {
|
|
7
7
|
enable: true,
|
|
8
8
|
items: [// {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
label: 'Web控制台',
|
|
18
|
-
icon: '/img/topo/contextmenu/Topology_resources_menu_icon_webconsole.svg',
|
|
19
|
-
visible:
|
|
20
|
-
|
|
21
|
-
},
|
|
22
|
-
items: [
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
},
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
9
|
+
// label: '概览',
|
|
10
|
+
// id: 'Resource.detail',
|
|
11
|
+
// icon: '/img/topo/contextmenu/Topology_resources_menu_icon_overview.svg',
|
|
12
|
+
// visible: (data) => {
|
|
13
|
+
// return isResource(data) && !!data.operation;
|
|
14
|
+
// }
|
|
15
|
+
// },
|
|
16
|
+
// {
|
|
17
|
+
// label: 'Web控制台',
|
|
18
|
+
// icon: '/img/topo/contextmenu/Topology_resources_menu_icon_webconsole.svg',
|
|
19
|
+
// visible: (data) => {
|
|
20
|
+
// return isResource(data) && !!data.operation;
|
|
21
|
+
// },
|
|
22
|
+
// items: [
|
|
23
|
+
// {
|
|
24
|
+
// label: '访问',
|
|
25
|
+
// id: 'Resource.WebConsole.open',
|
|
26
|
+
// disable: (data) => {
|
|
27
|
+
// const {resourceWebControllUrl} = topoApp.pluginManager.pluginMap;
|
|
28
|
+
// return !resourceWebControllUrl.getResourceUrl(data.id)
|
|
29
|
+
// },
|
|
30
|
+
// },
|
|
31
|
+
// { label: '设置', id: 'Resource.WebConsole.setting' },
|
|
32
|
+
// ]
|
|
33
|
+
// },
|
|
34
|
+
// {
|
|
35
|
+
// label: '资源操作',
|
|
36
|
+
// id: 'Resource.Operate',
|
|
37
|
+
// icon: '/img/topo/contextmenu/Topology_resources_menu_icon_operands.svg',
|
|
38
|
+
// visible: (data) => {
|
|
39
|
+
// if (!isResource(data)) {
|
|
40
|
+
// return false;
|
|
41
|
+
// }
|
|
42
|
+
// const {ciType} = data;
|
|
43
|
+
// const ciMeta = topoApp.ciTyeCache.getCiType(ciType);
|
|
44
|
+
// if (!ciMeta) {
|
|
45
|
+
// return false;
|
|
46
|
+
// }
|
|
47
|
+
// const {domain} = ciMeta;
|
|
48
|
+
// // 是否有该页签,与资源详情保持一致
|
|
49
|
+
// const hasTab = domain === 'network' || domain === 'server';
|
|
50
|
+
// return !!data.operation && hasTab;
|
|
51
|
+
// }
|
|
52
|
+
// },
|
|
53
|
+
// {
|
|
54
|
+
// label: 'Syslog',
|
|
55
|
+
// id: 'Resource.Syslog',
|
|
56
|
+
// icon: '/img/topo/contextmenu/Topology_resources_menu_icon_syslog.svg',
|
|
57
|
+
// visible: (data) => {
|
|
58
|
+
// if (!isResource(data)) {
|
|
59
|
+
// return false;
|
|
60
|
+
// }
|
|
61
|
+
// const {ciType} = data;
|
|
62
|
+
// const ciMeta = topoApp.ciTyeCache.getCiType(ciType);
|
|
63
|
+
// if (!ciMeta) {
|
|
64
|
+
// return false;
|
|
65
|
+
// }
|
|
66
|
+
// const {domain} = ciMeta;
|
|
67
|
+
// // 是否有该页签,与资源详情保持一致
|
|
68
|
+
// const hasTab = domain === 'network' || domain === 'server';
|
|
69
|
+
// return !!data.operation && hasTab;
|
|
70
|
+
// }
|
|
71
|
+
// },
|
|
72
|
+
// { label: '打开属性设置', id: 'openSet' },
|
|
73
|
+
// { label: '打开全局属性设置', id: 'openAllSet' },
|
|
73
74
|
]
|
|
74
75
|
};
|
|
75
76
|
}
|
package/es/createTopo.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
|
-
import { createTopoApp } from "./core/
|
|
2
|
+
import { createTopoApp } from "./core/createTopoApp";
|
|
3
3
|
import createMenuCommands from "./contextmenu/createMenuCommands";
|
|
4
4
|
import getTopoData from "./topoCenter/getTopoData";
|
|
5
5
|
export function createTopo(options) {
|
package/es/hooks/useAlarm.js
CHANGED
|
@@ -26,9 +26,7 @@ export default function useAlarm(options) {
|
|
|
26
26
|
|
|
27
27
|
var _store$useModel2 = store.useModel("topoBizMod"),
|
|
28
28
|
bizState = _store$useModel2[0],
|
|
29
|
-
bizDispatchers = _store$useModel2[1];
|
|
30
|
-
|
|
31
|
-
var linkDynamicStyleDispatcher = store.getModel("linkDynamicStyle")[1]; // rlog.debug(
|
|
29
|
+
bizDispatchers = _store$useModel2[1]; // rlog.debug(
|
|
32
30
|
// "useAlarm.useEffect 获取初始化告警----------init",
|
|
33
31
|
// topo,
|
|
34
32
|
// allData,
|
|
@@ -63,6 +61,7 @@ export default function useAlarm(options) {
|
|
|
63
61
|
// };
|
|
64
62
|
// }, [alarmIsOpened]);
|
|
65
63
|
|
|
64
|
+
|
|
66
65
|
function getAlarmByEE(_x) {
|
|
67
66
|
return _getAlarmByEE.apply(this, arguments);
|
|
68
67
|
}
|
|
@@ -110,9 +109,7 @@ export default function useAlarm(options) {
|
|
|
110
109
|
rlog.debug("useAlarm.getAlarmByEE 推送告警到ht", alarmList, bizState);
|
|
111
110
|
|
|
112
111
|
if (alarmIsOpened) {
|
|
113
|
-
topo.loadAlarm(alarmList);
|
|
114
|
-
|
|
115
|
-
linkDynamicStyleDispatcher.execute();
|
|
112
|
+
topo.loadAlarm(alarmList);
|
|
116
113
|
}
|
|
117
114
|
|
|
118
115
|
case 12:
|
|
@@ -9,7 +9,7 @@ import { getEdges, getNodes } from "../utils/htElementUtils";
|
|
|
9
9
|
export default function (props) {
|
|
10
10
|
var topo = props.topo;
|
|
11
11
|
var store = topo.store;
|
|
12
|
-
var editDispatchers = store.useModelDispatchers('
|
|
12
|
+
var editDispatchers = store.useModelDispatchers('topoConfig');
|
|
13
13
|
|
|
14
14
|
var loadConfig = /*#__PURE__*/function () {
|
|
15
15
|
var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
|