@riil-frontend/component-topology 7.0.0-dev.2 → 7.0.0-dev.21

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.
Files changed (170) hide show
  1. package/build/1.js +2 -2
  2. package/build/2.js +1 -1
  3. package/build/index.css +1 -1
  4. package/build/index.js +31 -31
  5. package/es/core/components/TopoView/topoView.js +2 -19
  6. package/es/core/components/titlebar/index.js +2 -1
  7. package/es/core/editor/components/EditorPlugin.js +1 -2
  8. package/es/core/editor/components/Toolbar/buttons.js +2 -2
  9. package/es/core/editor/components/Toolbar/widgets/components/textStyleSetting/ElementTextStyleSetting/elements/edgeTag.js +11 -3
  10. package/es/core/editor/components/Toolbar/widgets/components/textStyleSetting/ElementTextStyleSetting/elements/nodeTag.js +6 -1
  11. package/es/core/editor/components/Toolbar/widgets/components/textStyleSetting/ElementTextStyleSetting/textStyleUtil.js +5 -0
  12. package/es/core/editor/components/settings/PropertyView.js +11 -10
  13. package/es/core/editor/components/settings/Settings.js +8 -1
  14. package/es/core/editor/components/settings/core/PropertyViewManager.js +4 -3
  15. package/es/core/editor/components/settings/core/edgePropertyViewAdapter.js +1 -7
  16. package/es/core/editor/components/settings/propertyViews/node/data/Data.js +6 -3
  17. package/es/core/editor/components/settings/propertyViews/node/data/NodeRelateResourceButton.js +4 -2
  18. package/es/core/editor/components/settings/propertyViews/node/data/PlatformDisplay.js +10 -0
  19. package/es/core/editor/hooks/useKeyboardShortcut.js +1 -1
  20. package/es/core/hooks/usePolling.js +1 -6
  21. package/es/core/hooks/useTopoEdit.js +134 -170
  22. package/es/core/models/Alarm.js +12 -24
  23. package/es/core/models/TopoApp.js +1 -1
  24. package/es/core/models/topoData.js +3 -3
  25. package/es/core/models/utils/linkUtils.js +0 -3
  26. package/es/core/store/models/topoConfig.js +7 -5
  27. package/es/core/store/models/topoMod.js +8 -7
  28. package/es/core/utils/saveSerialize.js +2 -3
  29. package/es/core/viewer/components/plugins/ResourceDetail/ResourceDetailDrawer.js +13 -2
  30. package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/EventsCard.js +28 -25
  31. package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/ResourceOverview.js +4 -0
  32. package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/components/Configurator/index.js +17 -17
  33. package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/index.module.scss +1 -0
  34. package/es/core/viewer/components/titlebar/BasicTools.js +3 -16
  35. package/es/core/viewer/components/titlebar/widgets/AlarmButton.js +25 -0
  36. package/es/networkTopo/getTopoData.js +18 -30
  37. package/es/networkTopo/index.js +1 -2
  38. package/es/networkTopo/services/alert.js +55 -0
  39. package/es/networkTopo/services/authorization.js +135 -0
  40. package/es/networkTopo/services/cmdb.js +897 -0
  41. package/es/networkTopo/services/index.js +2 -26
  42. package/es/networkTopo/services/mdc.js +74 -0
  43. package/es/networkTopo/services/metric.js +68 -0
  44. package/es/networkTopo/services/model.js +1283 -0
  45. package/es/networkTopo/services/risk.js +29 -0
  46. package/es/networkTopo/services/topo/auth.js +67 -0
  47. package/es/networkTopo/services/topo/basic.js +727 -0
  48. package/es/networkTopo/services/topo/blacklist.js +60 -0
  49. package/es/networkTopo/services/topo/ciInfo.js +69 -0
  50. package/es/networkTopo/services/topo/constants.js +1 -0
  51. package/es/networkTopo/services/topo/icon.js +131 -0
  52. package/es/networkTopo/services/topo/index.js +18 -0
  53. package/es/networkTopo/services/topo/networkLink.js +33 -0
  54. package/es/networkTopo/services/topo/relation.js +27 -0
  55. package/es/networkTopo/services/topo/resourceWebUrl.js +84 -0
  56. package/es/networkTopo/store/topoTreeMod.js +5 -1
  57. package/es/networkTopo/utils/storage.js +38 -0
  58. package/es/style.js +21 -21
  59. package/es/utils/tree.js +1 -0
  60. package/lib/core/components/TopoView/topoView.js +2 -20
  61. package/lib/core/components/titlebar/index.js +5 -1
  62. package/lib/core/editor/components/EditorPlugin.js +1 -3
  63. package/lib/core/editor/components/Toolbar/buttons.js +2 -2
  64. package/lib/core/editor/components/Toolbar/widgets/components/textStyleSetting/ElementTextStyleSetting/elements/edgeTag.js +11 -4
  65. package/lib/core/editor/components/Toolbar/widgets/components/textStyleSetting/ElementTextStyleSetting/elements/nodeTag.js +6 -1
  66. package/lib/core/editor/components/Toolbar/widgets/components/textStyleSetting/ElementTextStyleSetting/textStyleUtil.js +5 -0
  67. package/lib/core/editor/components/settings/PropertyView.js +10 -10
  68. package/lib/core/editor/components/settings/Settings.js +9 -1
  69. package/lib/core/editor/components/settings/core/PropertyViewManager.js +4 -3
  70. package/lib/core/editor/components/settings/core/edgePropertyViewAdapter.js +1 -10
  71. package/lib/core/editor/components/settings/propertyViews/node/data/Data.js +7 -4
  72. package/lib/core/editor/components/settings/propertyViews/node/data/NodeRelateResourceButton.js +4 -2
  73. package/lib/core/editor/components/settings/propertyViews/node/data/PlatformDisplay.js +18 -0
  74. package/lib/core/editor/hooks/useKeyboardShortcut.js +1 -1
  75. package/lib/core/hooks/usePolling.js +1 -6
  76. package/lib/core/hooks/useTopoEdit.js +134 -170
  77. package/lib/core/models/Alarm.js +12 -24
  78. package/lib/core/models/TopoApp.js +1 -1
  79. package/lib/core/models/topoData.js +7 -11
  80. package/lib/core/models/utils/linkUtils.js +0 -5
  81. package/lib/core/store/models/topoConfig.js +7 -5
  82. package/lib/core/store/models/topoMod.js +10 -7
  83. package/lib/core/utils/saveSerialize.js +1 -3
  84. package/lib/core/viewer/components/plugins/ResourceDetail/ResourceDetailDrawer.js +13 -2
  85. package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/EventsCard.js +28 -26
  86. package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/ResourceOverview.js +4 -0
  87. package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/components/Configurator/index.js +17 -17
  88. package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/index.module.scss +1 -0
  89. package/lib/core/viewer/components/titlebar/BasicTools.js +3 -17
  90. package/lib/core/viewer/components/titlebar/widgets/AlarmButton.js +36 -0
  91. package/lib/networkTopo/getTopoData.js +19 -33
  92. package/lib/networkTopo/index.js +1 -5
  93. package/lib/networkTopo/services/alert.js +66 -0
  94. package/lib/networkTopo/services/authorization.js +145 -0
  95. package/lib/networkTopo/services/cmdb.js +977 -0
  96. package/lib/networkTopo/services/index.js +3 -29
  97. package/lib/networkTopo/services/mdc.js +91 -0
  98. package/lib/networkTopo/services/metric.js +82 -0
  99. package/lib/networkTopo/services/model.js +1387 -0
  100. package/lib/networkTopo/services/risk.js +40 -0
  101. package/lib/networkTopo/services/topo/auth.js +79 -0
  102. package/lib/networkTopo/services/topo/basic.js +753 -0
  103. package/lib/networkTopo/services/topo/blacklist.js +72 -0
  104. package/lib/networkTopo/services/topo/ciInfo.js +82 -0
  105. package/lib/networkTopo/services/topo/constants.js +6 -0
  106. package/lib/networkTopo/services/topo/icon.js +144 -0
  107. package/lib/networkTopo/{components/editor/plugins/LayerConfigPlugin.js → services/topo/index.js} +33 -23
  108. package/lib/networkTopo/services/topo/networkLink.js +45 -0
  109. package/lib/networkTopo/services/topo/relation.js +39 -0
  110. package/lib/networkTopo/services/topo/resourceWebUrl.js +95 -0
  111. package/lib/networkTopo/store/topoTreeMod.js +5 -1
  112. package/lib/networkTopo/utils/storage.js +46 -0
  113. package/lib/style.js +21 -21
  114. package/lib/utils/tree.js +1 -0
  115. package/package.json +3 -3
  116. package/es/core/editor/components/plugins/MultipleResourceSelectPlugin.js +0 -15
  117. package/es/core/editor/components/settings/propertyViews/edge/addEdgeProps.js +0 -10
  118. package/es/networkTopo/components/Topology.js +0 -28
  119. package/es/networkTopo/components/editor/plugins/LayerConfigPlugin.js +0 -22
  120. package/es/networkTopo/components/editor/propertyViews/LayerRelatedResourceList.js +0 -48
  121. package/es/networkTopo/components/editor/propertyViews/edge/EdgeGroupPropertyView.js +0 -35
  122. package/es/networkTopo/components/editor/propertyViews/edge/EdgePropertyView.js +0 -43
  123. package/es/networkTopo/components/editor/propertyViews/edge/LinkPropertyView/Data/index.js +0 -39
  124. package/es/networkTopo/components/editor/propertyViews/edge/LinkPropertyView/LinkPropertyView.js +0 -31
  125. package/es/networkTopo/components/editor/propertyViews/edge/LinkPropertyView/LinkPropertyViewV1.js +0 -37
  126. package/es/networkTopo/components/editor/propertyViews/edge/LinkPropertyView/Setting/index.js +0 -49
  127. package/es/networkTopo/components/editor/propertyViews/edge/LinkPropertyView/index.js +0 -2
  128. package/es/networkTopo/components/editor/propertyViews/edge/addLinkDrawer/AddLinkDrawer.js +0 -630
  129. package/es/networkTopo/components/editor/propertyViews/edge/addLinkDrawer/components/NetworkLinkForm.js +0 -4
  130. package/es/networkTopo/components/editor/propertyViews/edge/addLinkDrawer/components/editLinkInfo.js +0 -458
  131. package/es/networkTopo/components/editor/propertyViews/edge/addLinkDrawer/components/index.module.scss +0 -34
  132. package/es/networkTopo/components/editor/propertyViews/edge/addLinkDrawer/hooks/useAddLink.js +0 -104
  133. package/es/networkTopo/components/editor/propertyViews/edge/addLinkDrawer/index.module.scss +0 -12
  134. package/es/networkTopo/components/editor/propertyViews/edge/addLinkDrawer/mock.js +0 -55
  135. package/es/networkTopo/components/editor/propertyViews/edge/addLinkDrawer/server.js +0 -187
  136. package/es/networkTopo/components/editor/propertyViews/edge/link/BindExitLinkSelect.js +0 -178
  137. package/es/networkTopo/components/editor/propertyViews/edge/link/LinkInfoPreview.js +0 -103
  138. package/es/networkTopo/components/editor/propertyViews/edge/link/LinkInfoPreview.module.scss +0 -65
  139. package/es/networkTopo/components/editor/useEditorProps.js +0 -32
  140. package/es/networkTopo/event/index.js +0 -6
  141. package/es/networkTopo/hooks/editor/useDeleteEdges.js +0 -200
  142. package/es/networkTopo/hooks/editor/useGroupSortResources.js +0 -16
  143. package/es/networkTopo/hooks/useTopoEdit.js +0 -26
  144. package/lib/core/editor/components/plugins/MultipleResourceSelectPlugin.js +0 -25
  145. package/lib/core/editor/components/settings/propertyViews/edge/addEdgeProps.js +0 -19
  146. package/lib/networkTopo/components/Topology.js +0 -40
  147. package/lib/networkTopo/components/editor/propertyViews/LayerRelatedResourceList.js +0 -63
  148. package/lib/networkTopo/components/editor/propertyViews/edge/EdgeGroupPropertyView.js +0 -51
  149. package/lib/networkTopo/components/editor/propertyViews/edge/EdgePropertyView.js +0 -60
  150. package/lib/networkTopo/components/editor/propertyViews/edge/LinkPropertyView/Data/index.js +0 -54
  151. package/lib/networkTopo/components/editor/propertyViews/edge/LinkPropertyView/LinkPropertyView.js +0 -42
  152. package/lib/networkTopo/components/editor/propertyViews/edge/LinkPropertyView/LinkPropertyViewV1.js +0 -50
  153. package/lib/networkTopo/components/editor/propertyViews/edge/LinkPropertyView/Setting/index.js +0 -66
  154. package/lib/networkTopo/components/editor/propertyViews/edge/LinkPropertyView/index.js +0 -11
  155. package/lib/networkTopo/components/editor/propertyViews/edge/addLinkDrawer/AddLinkDrawer.js +0 -661
  156. package/lib/networkTopo/components/editor/propertyViews/edge/addLinkDrawer/components/NetworkLinkForm.js +0 -12
  157. package/lib/networkTopo/components/editor/propertyViews/edge/addLinkDrawer/components/editLinkInfo.js +0 -486
  158. package/lib/networkTopo/components/editor/propertyViews/edge/addLinkDrawer/components/index.module.scss +0 -34
  159. package/lib/networkTopo/components/editor/propertyViews/edge/addLinkDrawer/hooks/useAddLink.js +0 -120
  160. package/lib/networkTopo/components/editor/propertyViews/edge/addLinkDrawer/index.module.scss +0 -12
  161. package/lib/networkTopo/components/editor/propertyViews/edge/addLinkDrawer/mock.js +0 -60
  162. package/lib/networkTopo/components/editor/propertyViews/edge/addLinkDrawer/server.js +0 -207
  163. package/lib/networkTopo/components/editor/propertyViews/edge/link/BindExitLinkSelect.js +0 -205
  164. package/lib/networkTopo/components/editor/propertyViews/edge/link/LinkInfoPreview.js +0 -121
  165. package/lib/networkTopo/components/editor/propertyViews/edge/link/LinkInfoPreview.module.scss +0 -65
  166. package/lib/networkTopo/components/editor/useEditorProps.js +0 -46
  167. package/lib/networkTopo/event/index.js +0 -11
  168. package/lib/networkTopo/hooks/editor/useDeleteEdges.js +0 -218
  169. package/lib/networkTopo/hooks/editor/useGroupSortResources.js +0 -21
  170. package/lib/networkTopo/hooks/useTopoEdit.js +0 -40
package/lib/utils/tree.js CHANGED
@@ -46,6 +46,7 @@ function formatTree(json, funcPermissions) {
46
46
  }
47
47
 
48
48
  return {
49
+ data: node,
49
50
  id: "" + id,
50
51
  label: name,
51
52
  parentId: parentId,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@riil-frontend/component-topology",
3
- "version": "7.0.0-dev.2",
3
+ "version": "7.0.0-dev.21",
4
4
  "description": "拓扑",
5
5
  "scripts": {
6
6
  "start": "build-scripts start",
@@ -60,7 +60,7 @@
60
60
  "@formily/next-components": "1.3.13",
61
61
  "@iceworks/spec": "^1.0.0",
62
62
  "@riil-frontend/component-action-tree": "^1.0.13",
63
- "@riil-frontend/component-common-res-list": "^1.0.13",
63
+ "@riil-frontend/component-common-res-list": "^1.0.26",
64
64
  "@riil-frontend/component-condition-res-list": "^1.0.18",
65
65
  "@riil-frontend/component-crucial-link-topo": "0.1.0",
66
66
  "@riil-frontend/component-extra-title": "^1.0.3",
@@ -116,6 +116,6 @@
116
116
  "access": "public"
117
117
  },
118
118
  "license": "MIT",
119
- "homepage": "https://unpkg.com/@riil-frontend/component-topology@7.0.0-dev.2/build/index.html",
119
+ "homepage": "https://unpkg.com/@riil-frontend/component-topology@7.0.0-dev.21/build/index.html",
120
120
  "gitHead": "2da19ffccbb7ca60a8acf396e39f542c68bb33f5"
121
121
  }
@@ -1,15 +0,0 @@
1
- import React from 'react';
2
- import ComboResDrawer from "../../../../components/MultiResourceDrawer";
3
- export default function MultipleResourceSelectPlugin(props) {
4
- var topoEdit = props.topoEdit;
5
- return /*#__PURE__*/React.createElement(ComboResDrawer, {
6
- visible: topoEdit.showComboResDrawer,
7
- loading: topoEdit.topoLoading,
8
- initialData: topoEdit.initialComboRes,
9
- getExcludeIds: topoEdit.getAllNodeResourceIds,
10
- mode: topoEdit.getAddResourceDrawerMode(),
11
- onSave: topoEdit.onSaveComboRes,
12
- onClose: topoEdit.onCloseComboResDrawer
13
- });
14
- }
15
- ;
@@ -1,10 +0,0 @@
1
- import _extends from "@babel/runtime/helpers/extends";
2
- import React from 'react';
3
- export default function addEdgeProps(Component) {
4
- return function AdapterEdgeProps(props) {
5
- var selectionElement = props.selectionElement;
6
- return /*#__PURE__*/React.createElement(Component, _extends({}, props, {
7
- edge: selectionElement
8
- }));
9
- };
10
- }
@@ -1,28 +0,0 @@
1
- import _extends from "@babel/runtime/helpers/extends";
2
- import React from "react";
3
- import TopoView from "./TopoView";
4
- import useTopoEdit from "../hooks/useTopoEdit";
5
- import useEditorProps from "./editor/useEditorProps";
6
- export default function NetworkTopologyFull(props) {
7
- var topo = props.topo,
8
- showTools = props.showTools;
9
- var topoEdit = useTopoEdit({
10
- topo: topo
11
- });
12
- var editorProps = useEditorProps(props);
13
- return /*#__PURE__*/React.createElement(TopoView, _extends({}, props, {
14
- editorProps: editorProps,
15
- graphViewProps: _extends({}, props.graphViewProps, {
16
- onElementsDelete: topoEdit.onElementsDelete,
17
- createHtTopoProps: {
18
- showTools: showTools,
19
- elementChangeLayerByDrag: true,
20
- editor: {
21
- useNewElementsDeleteEvent: true,
22
- // 通过数仓【添加资源】权限控制 是否启用新建链路功能,
23
- enableRelateResource: topoEdit.canAddLink
24
- }
25
- }
26
- })
27
- }));
28
- }
@@ -1,22 +0,0 @@
1
- import React, { useState, useEffect, useRef, useCallback } from 'react';
2
- /**
3
- * 分层拓扑:横向分层、纵向分层
4
- * @param {*} props
5
- * @returns
6
- */
7
-
8
- export default function LayerConfigPlugin(props) {
9
- var topo = props.topo,
10
- topoContext = props.topoContext,
11
- topoEdit = props.topoEdit,
12
- editorProps = props.editorProps;
13
- useEffect(function () {
14
- var notifier = topo.view.topoClient.notifier;
15
- notifier.on('topo_layer_add', topoEdit.onLayerAdded);
16
- return function () {
17
- notifier.off('topo_layer_add', topoEdit.onLayerAdded);
18
- };
19
- }, []);
20
- return null;
21
- }
22
- ;
@@ -1,48 +0,0 @@
1
- import React, { useState, useEffect, useRef, useCallback } from 'react';
2
- import { iconFactory } from '@riil-frontend/component-topology-graph';
3
- import ResourceList from "../../../../core/editor/components/settings/common/GroupNodeList/ResourceList";
4
- import { getLayerChildren } from "../../../../utils/htElementUtils";
5
-
6
- function getResourceNodes(store, htNodes) {
7
- var _store$getModelState = store.getModelState('topoMod'),
8
- data = _store$getModelState.data;
9
-
10
- var list = [];
11
- ((data === null || data === void 0 ? void 0 : data.nodes) || []).forEach(function (resource) {
12
- var htNode = htNodes.filter(function (node) {
13
- return node.getTag() === resource.id;
14
- })[0];
15
-
16
- if (htNode) {
17
- list.push({
18
- resource: resource,
19
- node: htNode
20
- });
21
- }
22
- });
23
- return list;
24
- }
25
- /**
26
- * 分层关联资源列表
27
- */
28
-
29
-
30
- export default function LayerResourceList(props) {
31
- var topo = props.topo,
32
- layer = props.layer;
33
- var nodes = getLayerChildren(layer);
34
- var resourceNodes = getResourceNodes(topo.store, nodes);
35
- var data = resourceNodes.map(function (_ref) {
36
- var node = _ref.node,
37
- resource = _ref.resource;
38
- return {
39
- title: resource.name,
40
- img: iconFactory.getIconImageUrl(node.getImage())
41
- };
42
- }); // rlog.debug('LayerResourceList', {nodes, resourceNodes, data});
43
-
44
- return /*#__PURE__*/React.createElement(ResourceList, {
45
- data: data
46
- });
47
- }
48
- ;
@@ -1,35 +0,0 @@
1
- import _Tab from "@alifd/next/es/tab";
2
- import React, { useState, useEffect } from 'react';
3
- import TabView from "../../../../../core/editor/components/settings/common/tab/TabView";
4
- import EdgeGroupSetting from "../../../../../core/editor/components/settings/propertyViews/edge/edgeGroup/EdgeGroupSetting";
5
- import LindInfoPreview from "./link/LinkInfoPreview"; // V1.2 废弃
6
-
7
- export default function EdgeGroupPropertyView(props) {
8
- var topo = props.topo,
9
- edge = props.edge,
10
- values = props.values,
11
- onChange = props.onChange,
12
- editorProps = props.editorProps; // 查询是否有聚合链路
13
-
14
- var source = edge.getSource().getTag();
15
- var target = edge.getTarget().getTag();
16
- var linkGroups = topo.store.useModelState('topoMod').data.linkGroups;
17
- var aggLink = linkGroups.find(function (link) {
18
- return link.source === source && link.target === target || link.target === source && link.source === target;
19
- });
20
-
21
- if (aggLink) {
22
- return /*#__PURE__*/React.createElement(TabView, null, /*#__PURE__*/React.createElement(_Tab.Item, {
23
- title: "\u6570\u636E",
24
- key: "1"
25
- }, /*#__PURE__*/React.createElement(LindInfoPreview, {
26
- data: aggLink,
27
- topo: topo
28
- })), /*#__PURE__*/React.createElement(_Tab.Item, {
29
- title: "\u8BBE\u7F6E",
30
- key: "2"
31
- }, /*#__PURE__*/React.createElement(EdgeGroupSetting, props)));
32
- }
33
-
34
- return /*#__PURE__*/React.createElement(EdgeGroupSetting, props);
35
- }
@@ -1,43 +0,0 @@
1
- import _Form from "@alifd/next/es/form";
2
- import _Field from "@alifd/next/es/field";
3
- import _extends from "@babel/runtime/helpers/extends";
4
- import rlog from '@riil-frontend/component-topology-utils/es/rlog';
5
- import React, { useEffect } from 'react';
6
- import BindExitLinkSelect from "./link/BindExitLinkSelect";
7
-
8
- function parseValues(values, edge) {
9
- return _extends({}, values);
10
- }
11
-
12
- export default function EdgePropertyView(props) {
13
- var topo = props.topo,
14
- edge = props.edge,
15
- values = props.values,
16
- _onChange = props.onChange,
17
- editorProps = props.editorProps,
18
- extraDisplaySetting = props.extraDisplaySetting;
19
- var store = topo.store;
20
-
21
- var field = _Field.useField({
22
- autoUnmount: false,
23
- values: parseValues(values, edge),
24
- onChange: function onChange(name, value) {
25
- rlog.debug('CommonEdgePropertyView', name, value);
26
- var newValues = field.getValues();
27
-
28
- _onChange(name, value, newValues);
29
- }
30
- });
31
-
32
- useEffect(function () {
33
- field.setValues(parseValues(values, edge));
34
- }, [values]);
35
- return /*#__PURE__*/React.createElement("div", {
36
- style: {
37
- margin: '12px 0 0 32px'
38
- }
39
- }, /*#__PURE__*/React.createElement(_Form, {
40
- field: field,
41
- labelAlign: "top"
42
- }, /*#__PURE__*/React.createElement(_Form.Item, null, /*#__PURE__*/React.createElement(BindExitLinkSelect, props))));
43
- }
@@ -1,39 +0,0 @@
1
- import _Button from "@alifd/next/es/button";
2
- import React from "react";
3
- import LindInfoPreview from "../../link/LinkInfoPreview";
4
- import styles from "../../link/LinkInfoPreview.module.scss";
5
- import rlog from "@riil-frontend/component-topology-utils/es/rlog";
6
- import { useState, useEffect } from "react";
7
- export default function LinkDataTab(props) {
8
- var _link$permission;
9
-
10
- var topo = props.topo,
11
- edge = props.edge,
12
- link = props.link;
13
-
14
- var _topo$store$useModel = topo.store.useModel("topoConfig"),
15
- editState = _topo$store$useModel[0],
16
- editDispatchers = _topo$store$useModel[1];
17
-
18
- var openEditLinkDrawer = function openEditLinkDrawer() {
19
- editDispatchers.update({
20
- addLinkIsOpen: true,
21
- currentLink: link
22
- });
23
- };
24
-
25
- return /*#__PURE__*/React.createElement("div", {
26
- className: styles.panelFullHeight
27
- }, /*#__PURE__*/React.createElement(LindInfoPreview, {
28
- className: styles.lindInfoPreview,
29
- data: link,
30
- topo: topo
31
- }), /*#__PURE__*/React.createElement("div", {
32
- className: styles.footer
33
- }, /*#__PURE__*/React.createElement(_Button, {
34
- className: styles.button,
35
- type: "primary",
36
- disabled: !(link !== null && link !== void 0 && (_link$permission = link.permission) !== null && _link$permission !== void 0 && _link$permission.writeable),
37
- onClick: openEditLinkDrawer
38
- }, "\u7F16\u8F91")));
39
- }
@@ -1,31 +0,0 @@
1
- import _extends from "@babel/runtime/helpers/extends";
2
- import NoDataPage from '@riil-frontend/component-no-data-page';
3
- import React from 'react';
4
- import Data from "./Data";
5
- export default function LinkPropertyView(props) {
6
- var edge = props.edge,
7
- topo = props.topo; // 无权限不显示数据页签
8
-
9
- var _topo$store$useModelS = topo.store.useModelState('topoMod').data,
10
- links = _topo$store$useModelS.links,
11
- linkGroups = _topo$store$useModelS.linkGroups;
12
- var link = [].concat(links, linkGroups).find(function (item) {
13
- return item.id === edge.getTag();
14
- });
15
-
16
- if (link) {
17
- var readable = link.permission.readable;
18
-
19
- if (!readable) {
20
- return /*#__PURE__*/React.createElement(NoDataPage, {
21
- statusCode: "\u6CA1\u6709\u67E5\u770B\u6743\u9650"
22
- });
23
- }
24
- } else {
25
- return null;
26
- }
27
-
28
- return /*#__PURE__*/React.createElement(Data, _extends({}, props, {
29
- link: link
30
- }));
31
- }
@@ -1,37 +0,0 @@
1
- import _Tab from "@alifd/next/es/tab";
2
- import _extends from "@babel/runtime/helpers/extends";
3
- import React from 'react';
4
- import TabView from "../../../../../../core/editor/components/settings/common/tab/TabView";
5
- import Data from "./Data";
6
- import Setting from "./Setting";
7
- export default function LinkPropertyView(props) {
8
- var edge = props.edge,
9
- topo = props.topo; // 无权限不显示数据页签
10
-
11
- var _topo$store$useModelS = topo.store.useModelState('topoMod').data,
12
- links = _topo$store$useModelS.links,
13
- linkGroups = _topo$store$useModelS.linkGroups;
14
- var link = [].concat(links, linkGroups).find(function (item) {
15
- return item.id === edge.getTag();
16
- }); // console.log('LinkPropertyView',link)
17
-
18
- if (link) {
19
- var readable = link.permission.readable;
20
-
21
- if (!readable) {
22
- return /*#__PURE__*/React.createElement(Setting, props);
23
- }
24
- } else {
25
- return /*#__PURE__*/React.createElement(Setting, props);
26
- }
27
-
28
- return /*#__PURE__*/React.createElement(TabView, null, /*#__PURE__*/React.createElement(_Tab.Item, {
29
- title: "\u6570\u636E",
30
- key: "1"
31
- }, /*#__PURE__*/React.createElement(Data, _extends({}, props, {
32
- link: link
33
- }))), /*#__PURE__*/React.createElement(_Tab.Item, {
34
- title: "\u8BBE\u7F6E",
35
- key: "2"
36
- }, /*#__PURE__*/React.createElement(Setting, props)));
37
- }
@@ -1,49 +0,0 @@
1
- import _Form from "@alifd/next/es/form";
2
- import _Field from "@alifd/next/es/field";
3
- import _extends from "@babel/runtime/helpers/extends";
4
- import _Collapse from "@alifd/next/es/collapse";
5
- import React, { useEffect } from "react";
6
- import LineType from "../../../../../../../core/editor/components/settings/common/LineType";
7
- var CollapsePanel = _Collapse.Panel;
8
-
9
- function parseValues(values) {
10
- return _extends({}, values);
11
- }
12
-
13
- export default function LinkSetting(props) {
14
- var topo = props.topo,
15
- values = props.values,
16
- _onChange = props.onChange,
17
- edge = props.edge;
18
-
19
- var field = _Field.useField({
20
- autoUnmount: false,
21
- values: parseValues(values),
22
- onChange: function onChange(name, value) {
23
- var newValues = field.getValues();
24
-
25
- _onChange(name, value, newValues);
26
- }
27
- });
28
-
29
- useEffect(function () {
30
- field.setValues(parseValues(values));
31
- }, [values]);
32
- return /*#__PURE__*/React.createElement(_Form, {
33
- field: field,
34
- labelAlign: "top"
35
- }, /*#__PURE__*/React.createElement(_Form.Item, null, /*#__PURE__*/React.createElement(_Collapse, {
36
- defaultExpandedKeys: ["线形"],
37
- style: {
38
- border: "none"
39
- }
40
- }, /*#__PURE__*/React.createElement(CollapsePanel, {
41
- key: "\u7EBF\u5F62",
42
- title: "\u7EBF\u5F62"
43
- }, /*#__PURE__*/React.createElement(LineType, {
44
- topo: topo,
45
- getEdges: function getEdges() {
46
- return [edge];
47
- }
48
- })))));
49
- }
@@ -1,2 +0,0 @@
1
- import LinkPropertyView from "./LinkPropertyView";
2
- export default LinkPropertyView;