@riil-frontend/component-topology 3.1.13 → 3.4.0
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 +36 -36
- package/demo/CHANGELOG/CHANGELOG.md +5 -0
- package/es/components/MultiResourceDrawer/index.js +2 -2
- package/es/components/NetworkTopoResourceSelectDrawer/NetworkTopoResourceSelectDrawer.js +9 -0
- package/es/components/NetworkTopoResourceSelectDrawer/index.js +2 -0
- package/es/components/ResourceSelectDrawer/ResourceSelectDrawer.js +8 -3
- package/es/components/ResourceSelectDrawer/ResourceSelectList.js +9 -6
- package/es/components/SingleResourceDrawer/SelectDrawer.js +1 -1
- package/es/constants/ResourceTypeLimit.js +12 -1
- package/es/core/common/icons/icon.js +3 -28
- package/es/core/editor/components/GroupAddResourceDrawerPlugin/GroupAddResourceDrawer.js +1 -1
- package/es/core/editor/components/settings/propertyViews/edge/CommonEdgePropertyView.js +148 -10
- package/es/core/editor/components/settings/propertyViews/edge/EdgePropertyView.js +4 -5
- package/es/core/editor/components/settings/propertyViews/index.js +1 -5
- package/es/core/editor/components/settings/propertyViews/layer/DataTab/LayerAddResourceDrawer.js +1 -1
- package/es/core/editor/components/settings/propertyViews/node/data/BindResourceDrawer.js +2 -1
- package/es/core/models/TopoApp.js +1 -1
- package/es/core/models/topoData.js +21 -18
- package/es/core/models/utils/linkUtils.js +14 -14
- package/es/hooks/useResourceConfig.js +3 -2
- package/es/hooks/useSelection.js +16 -14
- package/es/models/topoConfig.js +20 -16
- package/es/models/topoMod.js +1 -0
- package/es/topoCenter/components/editor/propertyViews/edge/LinkPropertyView/Data/index.js +14 -8
- package/es/topoCenter/components/editor/propertyViews/edge/LinkPropertyView/LinkPropertyView.js +16 -3
- package/es/topoCenter/components/editor/propertyViews/edge/LinkPropertyView/Setting/index.js +3 -3
- package/es/topoCenter/components/editor/propertyViews/edge/addLinkDrawer/AddLinkDrawer.js +145 -97
- package/es/topoCenter/components/editor/propertyViews/edge/addLinkDrawer/components/editLinkInfo.js +61 -21
- package/es/topoCenter/components/editor/propertyViews/edge/link/LinkInfoPreview.js +26 -7
- package/es/topoCenter/event/index.js +1 -0
- package/es/topoCenter/hooks/editor/useDeleteEdges.js +46 -24
- package/es/topoCenter/services/link.js +51 -0
- package/es/topoCenter/utils/linPermissionUtil.js +24 -13
- package/es/utils/ResourceConfigUtil.js +38 -16
- package/es/utils/topoData.js +6 -7
- package/lib/components/MultiResourceDrawer/index.js +2 -2
- package/lib/components/NetworkTopoResourceSelectDrawer/NetworkTopoResourceSelectDrawer.js +20 -0
- package/lib/components/NetworkTopoResourceSelectDrawer/index.js +11 -0
- package/lib/components/ResourceSelectDrawer/ResourceSelectDrawer.js +8 -3
- package/lib/components/ResourceSelectDrawer/ResourceSelectList.js +10 -5
- package/lib/components/SingleResourceDrawer/SelectDrawer.js +2 -2
- package/lib/constants/ResourceTypeLimit.js +19 -2
- package/lib/core/common/icons/icon.js +3 -35
- package/lib/core/editor/components/GroupAddResourceDrawerPlugin/GroupAddResourceDrawer.js +2 -2
- package/lib/core/editor/components/settings/propertyViews/edge/CommonEdgePropertyView.js +160 -9
- package/lib/core/editor/components/settings/propertyViews/edge/EdgePropertyView.js +3 -5
- package/lib/core/editor/components/settings/propertyViews/index.js +1 -5
- package/lib/core/editor/components/settings/propertyViews/layer/DataTab/LayerAddResourceDrawer.js +2 -2
- package/lib/core/editor/components/settings/propertyViews/node/data/BindResourceDrawer.js +3 -2
- package/lib/core/models/TopoApp.js +1 -1
- package/lib/core/models/topoData.js +24 -17
- package/lib/core/models/utils/linkUtils.js +12 -12
- package/lib/hooks/useResourceConfig.js +3 -2
- package/lib/hooks/useSelection.js +15 -11
- package/lib/models/topoConfig.js +24 -16
- package/lib/models/topoMod.js +1 -0
- package/lib/topoCenter/components/editor/propertyViews/edge/LinkPropertyView/Data/index.js +19 -9
- package/lib/topoCenter/components/editor/propertyViews/edge/LinkPropertyView/LinkPropertyView.js +17 -2
- package/lib/topoCenter/components/editor/propertyViews/edge/LinkPropertyView/Setting/index.js +2 -2
- package/lib/topoCenter/components/editor/propertyViews/edge/addLinkDrawer/AddLinkDrawer.js +145 -113
- package/lib/topoCenter/components/editor/propertyViews/edge/addLinkDrawer/components/editLinkInfo.js +60 -22
- package/lib/topoCenter/components/editor/propertyViews/edge/link/LinkInfoPreview.js +27 -7
- package/lib/topoCenter/event/index.js +2 -1
- package/lib/topoCenter/hooks/editor/useDeleteEdges.js +46 -24
- package/lib/topoCenter/services/link.js +52 -0
- package/lib/topoCenter/utils/linPermissionUtil.js +24 -13
- package/lib/utils/ResourceConfigUtil.js +36 -14
- package/lib/utils/topoData.js +6 -7
- package/package.json +3 -3
- package/es/core/common/icons/defaultIcons.js +0 -44
- package/es/core/common/icons/networkTopoCiTypeIcons.js +0 -9
- package/lib/core/common/icons/defaultIcons.js +0 -53
- package/lib/core/common/icons/networkTopoCiTypeIcons.js +0 -22
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
|
|
2
2
|
import _regeneratorRuntime from "@babel/runtime/regenerator";
|
|
3
3
|
import React, { useRef } from 'react';
|
|
4
|
-
import
|
|
4
|
+
import NetworkTopoResourceSelectDrawer from "../NetworkTopoResourceSelectDrawer";
|
|
5
5
|
|
|
6
6
|
var MultiResourceDrawer = function MultiResourceDrawer(props) {
|
|
7
7
|
var visible = props.visible,
|
|
@@ -42,7 +42,7 @@ var MultiResourceDrawer = function MultiResourceDrawer(props) {
|
|
|
42
42
|
};
|
|
43
43
|
}();
|
|
44
44
|
|
|
45
|
-
return /*#__PURE__*/React.createElement(
|
|
45
|
+
return /*#__PURE__*/React.createElement(NetworkTopoResourceSelectDrawer, {
|
|
46
46
|
visible: visible,
|
|
47
47
|
getExcludeIds: getExcludeIds,
|
|
48
48
|
onOk: onDrawerSave,
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import _extends from "@babel/runtime/helpers/extends";
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { getNetworkTopoCommonResListProps } from "../../constants/ResourceTypeLimit";
|
|
4
|
+
import ResourceSelectDrawer from "../ResourceSelectDrawer/ResourceSelectDrawer";
|
|
5
|
+
export default function NetworkTopoResourceSelectDrawer(props) {
|
|
6
|
+
return /*#__PURE__*/React.createElement(ResourceSelectDrawer, _extends({
|
|
7
|
+
commonResListProps: getNetworkTopoCommonResListProps()
|
|
8
|
+
}, props));
|
|
9
|
+
}
|
|
@@ -15,12 +15,14 @@ import styles from "./ResourceSelectDrawer.module.scss";
|
|
|
15
15
|
|
|
16
16
|
function ResourceSelectDrawer(props) {
|
|
17
17
|
var visible = props.visible,
|
|
18
|
+
title = props.title,
|
|
18
19
|
selectionMode = props.selectionMode,
|
|
19
20
|
limitTypes = props.limitTypes,
|
|
20
21
|
excludeIds = props.excludeIds,
|
|
21
22
|
getExcludeIds = props.getExcludeIds,
|
|
22
23
|
onOk = props.onOk,
|
|
23
|
-
onClose = props.onClose
|
|
24
|
+
onClose = props.onClose,
|
|
25
|
+
commonResListProps = props.commonResListProps;
|
|
24
26
|
var resourceSelectRef = useRef();
|
|
25
27
|
|
|
26
28
|
var _useState = useState(false),
|
|
@@ -84,7 +86,7 @@ function ResourceSelectDrawer(props) {
|
|
|
84
86
|
}
|
|
85
87
|
|
|
86
88
|
return /*#__PURE__*/React.createElement(Drawer, {
|
|
87
|
-
title:
|
|
89
|
+
title: title,
|
|
88
90
|
visible: visible,
|
|
89
91
|
loading: loading,
|
|
90
92
|
onSave: handleOk,
|
|
@@ -98,12 +100,14 @@ function ResourceSelectDrawer(props) {
|
|
|
98
100
|
ref: resourceSelectRef,
|
|
99
101
|
selectionMode: selectionMode,
|
|
100
102
|
limitTypes: limitTypes,
|
|
101
|
-
excludeIds: finalExcludeIds
|
|
103
|
+
excludeIds: finalExcludeIds,
|
|
104
|
+
commonResListProps: commonResListProps
|
|
102
105
|
}));
|
|
103
106
|
}
|
|
104
107
|
|
|
105
108
|
ResourceSelectDrawer.propTypes = {
|
|
106
109
|
visible: PropTypes.bool,
|
|
110
|
+
title: PropTypes.string,
|
|
107
111
|
limitTypes: PropTypes.array,
|
|
108
112
|
excludeIds: PropTypes.array,
|
|
109
113
|
selectionMode: PropTypes.any,
|
|
@@ -112,6 +116,7 @@ ResourceSelectDrawer.propTypes = {
|
|
|
112
116
|
};
|
|
113
117
|
ResourceSelectDrawer.defaultProps = {
|
|
114
118
|
visible: true,
|
|
119
|
+
title: '添加资源',
|
|
115
120
|
excludeIds: [],
|
|
116
121
|
onOk: function onOk() {},
|
|
117
122
|
onClose: function onClose() {}
|
|
@@ -1,14 +1,18 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
|
+
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/objectWithoutPropertiesLoose";
|
|
3
|
+
var _excluded = ["selectionMode", "limitTypes", "excludeIds", "commonResListProps"];
|
|
2
4
|
import React, { useState, useEffect, useRef, useCallback } from 'react';
|
|
3
5
|
import { getRequest } from '@riil-frontend/component-topology-common';
|
|
4
6
|
import CommonResList from '@riil-frontend/component-common-res-list';
|
|
5
7
|
import NoDataPage from '@riil-frontend/component-no-data-page';
|
|
6
|
-
import {
|
|
8
|
+
import { filterCiTypes } from "../../constants/ResourceTypeLimit";
|
|
7
9
|
|
|
8
10
|
function ResourceSelectList(props, ref) {
|
|
9
11
|
var selectionMode = props.selectionMode,
|
|
10
12
|
limitTypes = props.limitTypes,
|
|
11
|
-
excludeIds = props.excludeIds
|
|
13
|
+
excludeIds = props.excludeIds,
|
|
14
|
+
commonResListProps = props.commonResListProps,
|
|
15
|
+
otherProps = _objectWithoutPropertiesLoose(props, _excluded);
|
|
12
16
|
|
|
13
17
|
var tableProps = _extends({}, selectionMode ? {
|
|
14
18
|
rowSelection: {
|
|
@@ -18,17 +22,16 @@ function ResourceSelectList(props, ref) {
|
|
|
18
22
|
emptyContent: /*#__PURE__*/React.createElement(NoDataPage, null)
|
|
19
23
|
});
|
|
20
24
|
|
|
21
|
-
return /*#__PURE__*/React.createElement(CommonResList, {
|
|
25
|
+
return /*#__PURE__*/React.createElement(CommonResList, _extends({
|
|
22
26
|
ref: ref,
|
|
23
|
-
|
|
24
|
-
limitTypes: limitTypes || RESOURCE_LIMIT_TYPES,
|
|
27
|
+
limitTypes: limitTypes,
|
|
25
28
|
defaultCondition: excludeIds.length ? "!id('" + excludeIds.join('\',\'') + "')" : undefined,
|
|
26
29
|
request: getRequest(),
|
|
27
30
|
tableProps: tableProps,
|
|
28
31
|
paginationProps: {
|
|
29
32
|
type: 'simple'
|
|
30
33
|
}
|
|
31
|
-
});
|
|
34
|
+
}, otherProps, commonResListProps || {}));
|
|
32
35
|
}
|
|
33
36
|
|
|
34
37
|
export default /*#__PURE__*/React.forwardRef(ResourceSelectList);
|
|
@@ -2,7 +2,7 @@ import _Message from "@alifd/next/es/message";
|
|
|
2
2
|
import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
|
|
3
3
|
import _regeneratorRuntime from "@babel/runtime/regenerator";
|
|
4
4
|
import React, { useRef } from 'react';
|
|
5
|
-
import ResourceSelectDrawer from "../
|
|
5
|
+
import ResourceSelectDrawer from "../NetworkTopoResourceSelectDrawer";
|
|
6
6
|
|
|
7
7
|
var SingleSelectDrawer = function SingleSelectDrawer(props) {
|
|
8
8
|
var visible = props.visible,
|
|
@@ -1,4 +1,15 @@
|
|
|
1
|
-
|
|
1
|
+
export var filterCiTypes = function filterCiTypes(tree) {
|
|
2
|
+
return tree.filter(function (item) {
|
|
3
|
+
return item.value !== 'data_center';
|
|
4
|
+
});
|
|
5
|
+
};
|
|
6
|
+
export var getNetworkTopoCommonResListProps = function getNetworkTopoCommonResListProps() {
|
|
7
|
+
return {
|
|
8
|
+
innerTreeFilters: ['monitorable', 'discoverable'],
|
|
9
|
+
filterCiRes: filterCiTypes
|
|
10
|
+
};
|
|
11
|
+
}; // 拓扑中心资源类型限制
|
|
12
|
+
|
|
2
13
|
export var RESOURCE_LIMIT_TYPES = [// 网络设备
|
|
3
14
|
'common_network', 'switch', 'switch_cluster', 'router', // 操作系统
|
|
4
15
|
'linux', 'windows', // 数据库
|
|
@@ -1,30 +1,5 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
|
-
import
|
|
3
|
-
import getNetworkTopoCiTypeIcons from "./networkTopoCiTypeIcons";
|
|
4
|
-
var groupDefaultIcons = [{
|
|
5
|
-
id: 'editor.icon.cloud.medium',
|
|
6
|
-
name: '区域',
|
|
7
|
-
url: '/img/topo/citype-icons/区域_平面.svg'
|
|
8
|
-
}];
|
|
9
|
-
export function getSystemIcons() {
|
|
10
|
-
var networkTopoCiTypeIcons = getNetworkTopoCiTypeIcons().filter(function (icon) {
|
|
11
|
-
return !DEFAULT_NODE_ICONS.filter(function (defaultIcon) {
|
|
12
|
-
return defaultIcon.id === icon.id;
|
|
13
|
-
}).length;
|
|
14
|
-
});
|
|
15
|
-
return [].concat(DEFAULT_NODE_ICONS, networkTopoCiTypeIcons);
|
|
16
|
-
}
|
|
17
|
-
export function getIconLibs() {
|
|
18
|
-
return [{
|
|
19
|
-
id: '1',
|
|
20
|
-
name: '默认图标库1',
|
|
21
|
-
icons: getSystemIcons()
|
|
22
|
-
}, {
|
|
23
|
-
id: '2',
|
|
24
|
-
name: '默认图标库2',
|
|
25
|
-
icons: getSystemIcons()
|
|
26
|
-
}];
|
|
27
|
-
}
|
|
2
|
+
import topoManager from '@riil-frontend/component-topology-graph/es/manager';
|
|
28
3
|
/**
|
|
29
4
|
* 获取默认图标
|
|
30
5
|
* @param {*} topo
|
|
@@ -32,10 +7,10 @@ export function getIconLibs() {
|
|
|
32
7
|
*/
|
|
33
8
|
|
|
34
9
|
export function getNodeDefaultIcons(topo) {
|
|
35
|
-
return [].concat(
|
|
10
|
+
return [].concat(topoManager.iconLibManager.getNodeIcons(), topo.options.icons || []);
|
|
36
11
|
}
|
|
37
12
|
export function getGroupDefaultIcons(topo) {
|
|
38
|
-
return [].concat(
|
|
13
|
+
return [].concat(topoManager.iconLibManager.getIcons());
|
|
39
14
|
}
|
|
40
15
|
/**
|
|
41
16
|
* 获取编辑模式左侧图片列表
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
|
|
2
2
|
import _regeneratorRuntime from "@babel/runtime/regenerator";
|
|
3
3
|
import React, { useState, useEffect } from 'react';
|
|
4
|
-
import ResourceSelectDrawer from "../../../../components/
|
|
4
|
+
import ResourceSelectDrawer from "../../../../components/NetworkTopoResourceSelectDrawer";
|
|
5
5
|
|
|
6
6
|
var GroupAddResourceDrawer = function GroupAddResourceDrawer(props) {
|
|
7
7
|
var group = props.group,
|
|
@@ -1,16 +1,21 @@
|
|
|
1
|
+
import _Select from "@alifd/next/es/select";
|
|
1
2
|
import _Form from "@alifd/next/es/form";
|
|
2
3
|
import _NumberPicker from "@alifd/next/es/number-picker";
|
|
3
4
|
import _Field from "@alifd/next/es/field";
|
|
5
|
+
import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
|
|
4
6
|
import _extends from "@babel/runtime/helpers/extends";
|
|
5
7
|
import _Collapse from "@alifd/next/es/collapse";
|
|
6
|
-
import
|
|
8
|
+
import _regeneratorRuntime from "@babel/runtime/regenerator";
|
|
9
|
+
import React, { useState, useEffect } from "react";
|
|
7
10
|
import ColorPicker from "../../../../../../common/components/ColorPicker";
|
|
8
11
|
import LineType from "../../common/LineType";
|
|
12
|
+
import service from "../../../../../../topoCenter/services/link";
|
|
13
|
+
import rlog from "@riil-frontend/component-topology-utils/es/rlog";
|
|
9
14
|
var CollapsePanel = _Collapse.Panel;
|
|
10
15
|
|
|
11
16
|
function parseValues(values, edge) {
|
|
12
17
|
return _extends({}, values, {
|
|
13
|
-
|
|
18
|
+
"styleMap.edge.width": edge.s("edge.width") // element.getStyleMap() 如果是默认值则不返回
|
|
14
19
|
|
|
15
20
|
});
|
|
16
21
|
}
|
|
@@ -21,43 +26,158 @@ export default function CommonEdgePropertyView(props) {
|
|
|
21
26
|
values = props.values,
|
|
22
27
|
_onChange = props.onChange,
|
|
23
28
|
editorProps = props.editorProps;
|
|
29
|
+
var store = topo.store;
|
|
30
|
+
|
|
31
|
+
var _store$useModel = store.useModel("topoConfig"),
|
|
32
|
+
editState = _store$useModel[0],
|
|
33
|
+
editDispatchers = _store$useModel[1]; // 可关联出口链路
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
var _useState = useState([]),
|
|
37
|
+
associatedlinks = _useState[0],
|
|
38
|
+
setAssociatedlinks = _useState[1]; // const [isLine, setIsLine] = useState(false);
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
var getLinkByNodes = /*#__PURE__*/function () {
|
|
42
|
+
var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(id) {
|
|
43
|
+
var result, hasLinkIds, axlink;
|
|
44
|
+
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
|
45
|
+
while (1) {
|
|
46
|
+
switch (_context.prev = _context.next) {
|
|
47
|
+
case 0:
|
|
48
|
+
_context.next = 2;
|
|
49
|
+
return service.queryAssociatedlinks(id);
|
|
50
|
+
|
|
51
|
+
case 2:
|
|
52
|
+
result = _context.sent;
|
|
53
|
+
hasLinkIds = topo.getLines().map(function (line) {
|
|
54
|
+
return line.id;
|
|
55
|
+
});
|
|
56
|
+
axlink = [];
|
|
57
|
+
result.data.map(function (exLink) {
|
|
58
|
+
if (hasLinkIds.indexOf(exLink.id) < 0) {
|
|
59
|
+
axlink.push(exLink);
|
|
60
|
+
}
|
|
61
|
+
});
|
|
62
|
+
rlog.debug("出口链路列表", result.data, axlink);
|
|
63
|
+
setAssociatedlinks(axlink);
|
|
64
|
+
|
|
65
|
+
case 8:
|
|
66
|
+
case "end":
|
|
67
|
+
return _context.stop();
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
}, _callee);
|
|
71
|
+
}));
|
|
72
|
+
|
|
73
|
+
return function getLinkByNodes(_x) {
|
|
74
|
+
return _ref.apply(this, arguments);
|
|
75
|
+
};
|
|
76
|
+
}();
|
|
24
77
|
|
|
25
78
|
var field = _Field.useField({
|
|
26
79
|
autoUnmount: false,
|
|
27
80
|
values: parseValues(values, edge),
|
|
28
81
|
onChange: function onChange(name, value) {
|
|
82
|
+
rlog.debug("CommonEdgePropertyView", name, value);
|
|
29
83
|
var newValues = field.getValues();
|
|
30
84
|
|
|
31
85
|
_onChange(name, value, newValues);
|
|
32
86
|
}
|
|
33
87
|
});
|
|
34
88
|
|
|
89
|
+
useEffect(function () {
|
|
90
|
+
console.log("CommonEdgePropertyView-edge", edge, edge.getSource().getTag(), edge.getTarget());
|
|
91
|
+
var ids = [edge.getSource().getTag(), edge.getTarget().getTag()];
|
|
92
|
+
getLinkByNodes(ids);
|
|
93
|
+
}, [edge]);
|
|
35
94
|
useEffect(function () {
|
|
36
95
|
field.setValues(parseValues(values, edge));
|
|
37
96
|
}, [values]);
|
|
38
97
|
|
|
39
98
|
var setLineColor = function setLineColor(color) {
|
|
40
|
-
var style = edge.a(
|
|
41
|
-
edge.s(
|
|
42
|
-
edge.a(
|
|
99
|
+
var style = edge.a("styles") || {};
|
|
100
|
+
edge.s("edge.color", color);
|
|
101
|
+
edge.a("styles", _extends({}, style, {
|
|
43
102
|
color: color
|
|
44
103
|
}));
|
|
45
104
|
};
|
|
46
105
|
|
|
106
|
+
var bindExitLink = /*#__PURE__*/function () {
|
|
107
|
+
var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2(value) {
|
|
108
|
+
var data, exitLink, aobj, config, exconfig, exportLinkIdList, _yield$editDispatcher, elements;
|
|
109
|
+
|
|
110
|
+
return _regeneratorRuntime.wrap(function _callee2$(_context2) {
|
|
111
|
+
while (1) {
|
|
112
|
+
switch (_context2.prev = _context2.next) {
|
|
113
|
+
case 0:
|
|
114
|
+
data = associatedlinks.find(function (link) {
|
|
115
|
+
return link.id === value;
|
|
116
|
+
});
|
|
117
|
+
rlog.debug("bindExitLink--- v, edge", data, edge);
|
|
118
|
+
exitLink = {
|
|
119
|
+
attributes: [],
|
|
120
|
+
ciType: "network_link",
|
|
121
|
+
dtype: "link",
|
|
122
|
+
id: data.id,
|
|
123
|
+
interfaceSource: data["network_link.source_device_id"],
|
|
124
|
+
interfaceTarget: data["network_link.destination_device_id"],
|
|
125
|
+
metrics: [],
|
|
126
|
+
name: data.name,
|
|
127
|
+
"network_link.connect_type": "exit",
|
|
128
|
+
"network_link.destination_ipv4": data["network_link.destination_ipv4"],
|
|
129
|
+
operation: "delete",
|
|
130
|
+
connect_type: "exit",
|
|
131
|
+
source: data.source_id,
|
|
132
|
+
target: data.destination_id,
|
|
133
|
+
type: "link"
|
|
134
|
+
};
|
|
135
|
+
aobj = edge.getAttrObject();
|
|
136
|
+
edge.setAttrObject(_extends({}, aobj, exitLink));
|
|
137
|
+
edge.setTag(data.id);
|
|
138
|
+
config = topo.resourceConfig.getConfigFromHt();
|
|
139
|
+
rlog.debug("getConfigFromHt", config, topo.resourceConfig);
|
|
140
|
+
exconfig = _extends({}, config);
|
|
141
|
+
exportLinkIdList = config.exportLinkIdList;
|
|
142
|
+
exportLinkIdList.push(data.id);
|
|
143
|
+
topo.resourceConfig.updateConfig(_extends({}, config, {
|
|
144
|
+
exportLinkIdList: exportLinkIdList
|
|
145
|
+
}));
|
|
146
|
+
_context2.next = 14;
|
|
147
|
+
return editDispatchers.fetchDataByConfig();
|
|
148
|
+
|
|
149
|
+
case 14:
|
|
150
|
+
_yield$editDispatcher = _context2.sent;
|
|
151
|
+
elements = _yield$editDispatcher.elements;
|
|
152
|
+
rlog.debug("fetchDataByConfig", elements);
|
|
153
|
+
|
|
154
|
+
case 17:
|
|
155
|
+
case "end":
|
|
156
|
+
return _context2.stop();
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
}, _callee2);
|
|
160
|
+
}));
|
|
161
|
+
|
|
162
|
+
return function bindExitLink(_x2) {
|
|
163
|
+
return _ref2.apply(this, arguments);
|
|
164
|
+
};
|
|
165
|
+
}();
|
|
166
|
+
|
|
47
167
|
return /*#__PURE__*/React.createElement(_Form, {
|
|
48
168
|
field: field,
|
|
49
169
|
labelAlign: "top"
|
|
50
170
|
}, /*#__PURE__*/React.createElement(_Form.Item, null, /*#__PURE__*/React.createElement(_Collapse, {
|
|
51
|
-
defaultExpandedKeys: [
|
|
171
|
+
defaultExpandedKeys: ["显示设置"],
|
|
52
172
|
style: {
|
|
53
|
-
border:
|
|
173
|
+
border: "none"
|
|
54
174
|
}
|
|
55
175
|
}, /*#__PURE__*/React.createElement(CollapsePanel, {
|
|
56
176
|
key: "\u663E\u793A\u8BBE\u7F6E",
|
|
57
177
|
title: "\u663E\u793A\u8BBE\u7F6E"
|
|
58
178
|
}, /*#__PURE__*/React.createElement("div", {
|
|
59
179
|
style: {
|
|
60
|
-
display:
|
|
180
|
+
display: "flex"
|
|
61
181
|
}
|
|
62
182
|
}, /*#__PURE__*/React.createElement("div", {
|
|
63
183
|
style: {
|
|
@@ -80,7 +200,7 @@ export default function CommonEdgePropertyView(props) {
|
|
|
80
200
|
max: 5,
|
|
81
201
|
placeholder: "\u8BF7\u8F93\u5165",
|
|
82
202
|
style: {
|
|
83
|
-
width:
|
|
203
|
+
width: "100%"
|
|
84
204
|
}
|
|
85
205
|
}))), /*#__PURE__*/React.createElement("div", {
|
|
86
206
|
style: {
|
|
@@ -92,8 +212,26 @@ export default function CommonEdgePropertyView(props) {
|
|
|
92
212
|
marginBottom: 0
|
|
93
213
|
}
|
|
94
214
|
}, /*#__PURE__*/React.createElement(ColorPicker, {
|
|
95
|
-
value: values[
|
|
215
|
+
value: values["styleMap.edge.color"],
|
|
96
216
|
align: "br",
|
|
97
217
|
onChange: setLineColor
|
|
218
|
+
})))), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(_Form.Item, {
|
|
219
|
+
label: "\u5173\u8054\u51FA\u53E3\u94FE\u8DEF",
|
|
220
|
+
style: {
|
|
221
|
+
marginBottom: 0
|
|
222
|
+
}
|
|
223
|
+
}, /*#__PURE__*/React.createElement(_Select, {
|
|
224
|
+
style: {
|
|
225
|
+
width: 232
|
|
226
|
+
},
|
|
227
|
+
disabled: associatedlinks.length < 1,
|
|
228
|
+
onChange: function onChange(v) {
|
|
229
|
+
bindExitLink(v);
|
|
230
|
+
}
|
|
231
|
+
}, associatedlinks.map(function (item, index) {
|
|
232
|
+
return /*#__PURE__*/React.createElement(_Select.Option, {
|
|
233
|
+
value: item.id,
|
|
234
|
+
key: index
|
|
235
|
+
}, item.attributes.display_name);
|
|
98
236
|
}))))))));
|
|
99
237
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
|
-
import React, { useState, useEffect, useRef, useCallback } from
|
|
2
|
+
import React, { useState, useEffect, useRef, useCallback } from "react";
|
|
3
3
|
import useHtElement from "../../../../../common/hooks/useHtElement";
|
|
4
4
|
import CommonEdgePropertyView from "./CommonEdgePropertyView";
|
|
5
5
|
import EdgeGroupPropertyView from "./EdgeGroupPropertyView";
|
|
@@ -28,7 +28,7 @@ export default function EdgePropertyViewMatch(props) {
|
|
|
28
28
|
}));
|
|
29
29
|
}
|
|
30
30
|
|
|
31
|
-
type = type ||
|
|
31
|
+
type = type || "edgeGroup";
|
|
32
32
|
} else {
|
|
33
33
|
if (editorProps.getEdgePropertyViewType) {
|
|
34
34
|
type = editorProps.getEdgePropertyViewType(_extends({}, props, {
|
|
@@ -36,7 +36,7 @@ export default function EdgePropertyViewMatch(props) {
|
|
|
36
36
|
}));
|
|
37
37
|
}
|
|
38
38
|
|
|
39
|
-
type = type ||
|
|
39
|
+
type = type || "edge";
|
|
40
40
|
}
|
|
41
41
|
|
|
42
42
|
var views = _extends({}, commonViews, editorProps.edgePropertyViews || {});
|
|
@@ -50,5 +50,4 @@ export default function EdgePropertyViewMatch(props) {
|
|
|
50
50
|
return /*#__PURE__*/React.createElement(View, _extends({}, props, {
|
|
51
51
|
edge: edge
|
|
52
52
|
}));
|
|
53
|
-
}
|
|
54
|
-
;
|
|
53
|
+
}
|
|
@@ -15,10 +15,6 @@ var propertyPanelMap = {
|
|
|
15
15
|
multiple: MultipleElementPropertyView
|
|
16
16
|
};
|
|
17
17
|
|
|
18
|
-
if (localStorage.getItem('topo.debug') === 'true') {
|
|
19
|
-
Object.assign(propertyPanelMap, {
|
|
20
|
-
view: ViewPropertyView
|
|
21
|
-
});
|
|
22
|
-
}
|
|
18
|
+
if (localStorage.getItem('topo.debug') === 'true') {}
|
|
23
19
|
|
|
24
20
|
export default propertyPanelMap;
|
package/es/core/editor/components/settings/propertyViews/layer/DataTab/LayerAddResourceDrawer.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
|
|
2
2
|
import _regeneratorRuntime from "@babel/runtime/regenerator";
|
|
3
3
|
import React, { useState, useEffect } from 'react';
|
|
4
|
-
import ResourceSelectDrawer from "../../../../../../../components/
|
|
4
|
+
import ResourceSelectDrawer from "../../../../../../../components/NetworkTopoResourceSelectDrawer";
|
|
5
5
|
|
|
6
6
|
var LayerAddResourceDrawer = function LayerAddResourceDrawer(props) {
|
|
7
7
|
var visible = props.visible,
|
|
@@ -2,7 +2,7 @@ import _Message from "@alifd/next/es/message";
|
|
|
2
2
|
import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
|
|
3
3
|
import _regeneratorRuntime from "@babel/runtime/regenerator";
|
|
4
4
|
import React, { useState, useEffect } from 'react';
|
|
5
|
-
import ResourceSelectDrawer from "../../../../../../../components/
|
|
5
|
+
import ResourceSelectDrawer from "../../../../../../../components/NetworkTopoResourceSelectDrawer";
|
|
6
6
|
/**
|
|
7
7
|
* 关联、重新关联资源
|
|
8
8
|
* @param props
|
|
@@ -60,6 +60,7 @@ var BindResourceDrawer = function BindResourceDrawer(props) {
|
|
|
60
60
|
|
|
61
61
|
return /*#__PURE__*/React.createElement(ResourceSelectDrawer, {
|
|
62
62
|
visible: visible,
|
|
63
|
+
title: "\u5173\u8054\u8D44\u6E90",
|
|
63
64
|
getExcludeIds: topoEditApi.getAllNodeResourceIds,
|
|
64
65
|
selectionMode: "single",
|
|
65
66
|
onOk: handleSave,
|
|
@@ -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 "3.
|
|
23
|
+
var version = typeof "3.4.0" === 'string' ? "3.4.0" : null;
|
|
24
24
|
console.info("\u62D3\u6251\u7248\u672C: " + version);
|
|
25
25
|
/**
|
|
26
26
|
* 拓扑显示和编辑
|
|
@@ -1,15 +1,16 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
2
|
import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
|
|
3
3
|
import _regeneratorRuntime from "@babel/runtime/regenerator";
|
|
4
|
-
import topoService, { TOPO_PARENT_ID } from
|
|
4
|
+
import topoService, { TOPO_PARENT_ID } from "@riil-frontend/component-topology-common/es/services/topo";
|
|
5
|
+
import rlog from "@riil-frontend/component-topology-utils/es/rlog";
|
|
5
6
|
export function getLayoutId(layout) {
|
|
6
|
-
if (!layout || typeof layout ===
|
|
7
|
+
if (!layout || typeof layout === "string") {
|
|
7
8
|
return layout;
|
|
8
9
|
}
|
|
9
10
|
|
|
10
11
|
var id = layout.id,
|
|
11
12
|
options = layout.options;
|
|
12
|
-
var layoutId = id + (options && options.subId ||
|
|
13
|
+
var layoutId = id + (options && options.subId || "");
|
|
13
14
|
return layoutId;
|
|
14
15
|
}
|
|
15
16
|
export function resToConditions(resources, persist) {
|
|
@@ -32,19 +33,20 @@ export function saveTopo(_x) {
|
|
|
32
33
|
|
|
33
34
|
function _saveTopo() {
|
|
34
35
|
_saveTopo = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(data) {
|
|
35
|
-
var topoId, template, layout, backgroundId, globalConfig, serialize, resources, groups, viewGroupId, groupInfo, viewResources;
|
|
36
|
+
var topoId, template, layout, backgroundId, exportLinkIdList, globalConfig, serialize, resources, groups, viewGroupId, groupInfo, viewResources;
|
|
36
37
|
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
|
37
38
|
while (1) {
|
|
38
39
|
switch (_context.prev = _context.next) {
|
|
39
40
|
case 0:
|
|
40
|
-
topoId = data.id, template = data.template, layout = data.layout, backgroundId = data.backgroundId, globalConfig = data.globalConfig, serialize = data.serialize, resources = data.resources, groups = data.groups, viewGroupId = data.viewGroupId;
|
|
41
|
+
topoId = data.id, template = data.template, layout = data.layout, backgroundId = data.backgroundId, exportLinkIdList = data.exportLinkIdList, globalConfig = data.globalConfig, serialize = data.serialize, resources = data.resources, groups = data.groups, viewGroupId = data.viewGroupId;
|
|
42
|
+
rlog.debug("saveTopo", data); // 保存布局
|
|
41
43
|
|
|
42
44
|
if (!(template && layout)) {
|
|
43
|
-
_context.next =
|
|
45
|
+
_context.next = 5;
|
|
44
46
|
break;
|
|
45
47
|
}
|
|
46
48
|
|
|
47
|
-
_context.next =
|
|
49
|
+
_context.next = 5;
|
|
48
50
|
return topoService.changeLayout({
|
|
49
51
|
id: topoId,
|
|
50
52
|
template: template,
|
|
@@ -52,18 +54,18 @@ function _saveTopo() {
|
|
|
52
54
|
backgroundId: backgroundId
|
|
53
55
|
});
|
|
54
56
|
|
|
55
|
-
case
|
|
57
|
+
case 5:
|
|
56
58
|
if (!globalConfig) {
|
|
57
|
-
_context.next =
|
|
59
|
+
_context.next = 8;
|
|
58
60
|
break;
|
|
59
61
|
}
|
|
60
62
|
|
|
61
|
-
_context.next =
|
|
63
|
+
_context.next = 8;
|
|
62
64
|
return topoService.saveTopoSettings(topoId, globalConfig);
|
|
63
65
|
|
|
64
|
-
case
|
|
66
|
+
case 8:
|
|
65
67
|
if (!(resources || groups)) {
|
|
66
|
-
_context.next =
|
|
68
|
+
_context.next = 15;
|
|
67
69
|
break;
|
|
68
70
|
}
|
|
69
71
|
|
|
@@ -85,19 +87,20 @@ function _saveTopo() {
|
|
|
85
87
|
});
|
|
86
88
|
}
|
|
87
89
|
|
|
88
|
-
|
|
89
|
-
|
|
90
|
+
rlog.debug("saveTopo-groupInfo", groupInfo);
|
|
91
|
+
_context.next = 15;
|
|
92
|
+
return topoService.bindResourceToTopo(topoId, null, groupInfo, exportLinkIdList);
|
|
90
93
|
|
|
91
|
-
case
|
|
94
|
+
case 15:
|
|
92
95
|
if (!serialize) {
|
|
93
|
-
_context.next =
|
|
96
|
+
_context.next = 18;
|
|
94
97
|
break;
|
|
95
98
|
}
|
|
96
99
|
|
|
97
|
-
_context.next =
|
|
100
|
+
_context.next = 18;
|
|
98
101
|
return topoService.saveSerializeData(topoId, serialize);
|
|
99
102
|
|
|
100
|
-
case
|
|
103
|
+
case 18:
|
|
101
104
|
case "end":
|
|
102
105
|
return _context.stop();
|
|
103
106
|
}
|