@riil-frontend/component-topology 5.0.18 → 6.0.0-alpha.2

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 (202) 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 +29 -29
  5. package/es/components/VerticalIconTab/VerticalIconTab.js +58 -0
  6. package/es/components/VerticalIconTab/VerticalIconTab.module.scss +63 -0
  7. package/es/components/VerticalIconTab/index.js +2 -0
  8. package/es/components/collapse/Collapse.js +7 -0
  9. package/es/components/collapse/Collapse.module.scss +33 -0
  10. package/es/components/collapse/CollapseFullheight.module.scss +20 -0
  11. package/es/components/collapse/Panel.js +3 -0
  12. package/es/core/common/icons/icon.js +18 -5
  13. package/es/core/components/AlarmListPanel/components/AlarmListItem.js +41 -10
  14. package/es/core/components/AlarmListPanel/components/index.module.scss +26 -0
  15. package/es/core/components/AlarmListPanel/index.js +9 -5
  16. package/es/core/components/ResourceViewAttributeSetting/Setting.js +5 -19
  17. package/es/core/components/TopoView/TopoView.module.scss +0 -4
  18. package/es/core/components/TopoView/editor.module.scss +3 -0
  19. package/es/core/components/TopoView/topoView.js +67 -33
  20. package/es/core/editor/components/Sidebar/Sidebar.js +75 -0
  21. package/es/core/editor/components/Sidebar/Sidebar.module.scss +15 -0
  22. package/es/core/editor/components/Sidebar/views/BackgroundPanel/BackgroundPanel.js +10 -0
  23. package/es/core/editor/components/Sidebar/views/BackgroundPanel/index.js +2 -0
  24. package/es/core/editor/components/Sidebar/views/CanvasPanel/ImagePanel.js +4 -0
  25. package/es/core/editor/components/Sidebar/views/CanvasPanel/index.js +2 -0
  26. package/es/core/editor/components/Sidebar/views/ComponentPanel.js +41 -0
  27. package/es/core/editor/components/Sidebar/views/ImagePanel/CiTypeImagePanel.js +20 -0
  28. package/es/core/editor/components/Sidebar/views/ImagePanel/CustomImagePanel.js +45 -0
  29. package/es/core/editor/components/Sidebar/views/ImagePanel/ImagePalette.js +44 -0
  30. package/es/core/editor/components/Sidebar/views/ImagePanel/ImagePanel.js +28 -0
  31. package/es/core/editor/components/Sidebar/views/ImagePanel/index.js +2 -0
  32. package/es/core/editor/components/Sidebar/views/LinkPanel.js +43 -0
  33. package/es/core/editor/components/Toolbar/EditorToolbar.js +40 -0
  34. package/es/core/editor/components/Toolbar/Toolbar.js +10 -0
  35. package/es/core/editor/components/Toolbar/Toolbar.module.scss +21 -0
  36. package/es/core/editor/components/Toolbar/buttons.js +36 -0
  37. package/es/core/editor/components/Toolbar/widgets/AddResourceButton.js +23 -0
  38. package/es/core/editor/components/Toolbar/widgets/AddResourceWidget.js +17 -0
  39. package/es/core/editor/components/Toolbar/widgets/BoxBackgroundButton/BoxBackgroundButton.js +46 -0
  40. package/es/core/editor/components/Toolbar/widgets/BoxBackgroundButton/BoxBackgroundSetting.js +8 -0
  41. package/es/core/editor/components/Toolbar/widgets/BoxBackgroundButton/index.js +2 -0
  42. package/es/core/editor/components/Toolbar/widgets/CanvasMoveWidget.js +17 -0
  43. package/es/core/editor/components/Toolbar/widgets/CanvasSelectWidget.js +19 -0
  44. package/es/core/editor/components/Toolbar/widgets/Divider.js +10 -0
  45. package/es/core/editor/components/Toolbar/widgets/Divider.module.scss +6 -0
  46. package/es/core/editor/components/Toolbar/widgets/Dropdown.js +14 -0
  47. package/es/core/editor/components/Toolbar/widgets/EdgeColorButton/Content.js +8 -0
  48. package/es/core/editor/components/Toolbar/widgets/EdgeColorButton/EdgeColorButton.js +46 -0
  49. package/es/core/editor/components/Toolbar/widgets/EdgeColorButton/index.js +2 -0
  50. package/es/core/editor/components/Toolbar/widgets/EdgeTypeButton/EdgeType.js +8 -0
  51. package/es/core/editor/components/Toolbar/widgets/EdgeTypeButton/index.js +44 -0
  52. package/es/core/editor/components/Toolbar/widgets/FontColorButton.js +44 -0
  53. package/es/core/editor/components/Toolbar/widgets/FontFamilyWidget.js +40 -0
  54. package/es/core/editor/components/Toolbar/widgets/FontSizeWidget.js +35 -0
  55. package/es/core/editor/components/Toolbar/widgets/FontStyleButton.js +62 -0
  56. package/es/core/editor/components/Toolbar/widgets/HistoryRedoButton.js +22 -0
  57. package/es/core/editor/components/Toolbar/widgets/HistoryUndoButton.js +29 -0
  58. package/es/core/editor/components/Toolbar/widgets/Layout/index.js +28 -0
  59. package/es/core/editor/components/Toolbar/widgets/NodeAlignWidget.js +47 -0
  60. package/es/core/editor/components/Toolbar/widgets/NodeImageButton/BoxBackgroundSetting.js +8 -0
  61. package/es/core/editor/components/Toolbar/widgets/NodeImageButton/NodeImageButton.js +46 -0
  62. package/es/core/editor/components/Toolbar/widgets/NodeImageButton/index.js +2 -0
  63. package/es/core/editor/components/Toolbar/widgets/NodeSizeButton/BoxBackgroundSetting.js +8 -0
  64. package/es/core/editor/components/Toolbar/widgets/NodeSizeButton/NodeSizeButton.js +42 -0
  65. package/es/core/editor/components/Toolbar/widgets/NodeSizeButton/index.js +2 -0
  66. package/es/core/editor/components/Toolbar/widgets/SearchWidget.js +40 -0
  67. package/es/core/editor/components/Toolbar/widgets/WidgetBox.js +49 -0
  68. package/es/core/editor/components/Toolbar/widgets/WidgetBox.module.scss +64 -0
  69. package/es/core/editor/components/Toolbar/widgets/components/ArrowButton.js +19 -0
  70. package/es/core/editor/components/Toolbar/widgets/components/ArrowButton.module.scss +8 -0
  71. package/es/core/editor/components/Toolbar/widgets/components/ArrowPopup.js +27 -0
  72. package/es/core/editor/components/Toolbar/widgets/components/ArrowPopup.module.scss +10 -0
  73. package/es/core/editor/components/Toolbar/widgets/components/ButtonBox.js +34 -0
  74. package/es/core/editor/components/Toolbar/widgets/components/ButtonBox.module.scss +30 -0
  75. package/es/core/editor/components/Toolbar/widgets/components/DropdownButton.js +47 -0
  76. package/es/core/editor/components/Toolbar/widgets/components/DropdownButton.module.scss +10 -0
  77. package/es/core/editor/components/Toolbar/widgets/components/DropdownMenu.js +30 -0
  78. package/es/core/editor/components/Toolbar/widgets/components/MenuSelect.js +20 -0
  79. package/es/core/editor/components/Toolbar/widgets.js +0 -0
  80. package/es/core/editor/components/settings/common/SizeInput/NodeSizeInput.js +24 -8
  81. package/es/core/editor/components/settings/common/SizeInput/NodeSizeInput.module.scss +4 -3
  82. package/es/core/editor/components/settings/propertyViews/view/BatchSetNodeSize.js +4 -2
  83. package/es/core/editor/components/titlebar/TopoEditorTitleBar.js +9 -15
  84. package/es/core/models/HistoryManager.js +32 -6
  85. package/es/core/models/SelectionManager.js +7 -0
  86. package/es/core/models/TopoApp.js +4 -2
  87. package/es/core/store/coreModels.js +5 -5
  88. package/es/core/store/models/displayConfig.js +2 -2
  89. package/es/core/store/models/historyManager.js +31 -0
  90. package/es/core/viewer/components/titlebar/widgets/SearchWidget.js +3 -1
  91. package/es/networkTopo/components/TopoView.js +2 -98
  92. package/es/networkTopo/components/Topology.js +3 -33
  93. package/es/networkTopo/components/editor/useEditorProps.js +34 -0
  94. package/es/networkTopo/hooks/useLinkDynamicStyle.js +1 -1
  95. package/es/style.js +1 -1
  96. package/lib/components/VerticalIconTab/VerticalIconTab.js +74 -0
  97. package/lib/components/VerticalIconTab/VerticalIconTab.module.scss +63 -0
  98. package/lib/components/VerticalIconTab/index.js +11 -0
  99. package/lib/components/collapse/Collapse.js +15 -0
  100. package/lib/components/collapse/Collapse.module.scss +33 -0
  101. package/lib/components/collapse/CollapseFullheight.module.scss +20 -0
  102. package/lib/components/collapse/Panel.js +3 -0
  103. package/lib/core/common/icons/icon.js +20 -5
  104. package/lib/core/components/AlarmListPanel/components/AlarmListItem.js +40 -9
  105. package/lib/core/components/AlarmListPanel/components/index.module.scss +26 -0
  106. package/lib/core/components/AlarmListPanel/index.js +10 -6
  107. package/lib/core/components/ResourceViewAttributeSetting/Setting.js +5 -19
  108. package/lib/core/components/TopoView/TopoView.module.scss +0 -4
  109. package/lib/core/components/TopoView/editor.module.scss +3 -0
  110. package/lib/core/components/TopoView/topoView.js +69 -32
  111. package/lib/core/editor/components/Sidebar/Sidebar.js +95 -0
  112. package/lib/core/editor/components/Sidebar/Sidebar.module.scss +15 -0
  113. package/lib/core/editor/components/Sidebar/views/BackgroundPanel/BackgroundPanel.js +19 -0
  114. package/lib/core/editor/components/Sidebar/views/BackgroundPanel/index.js +11 -0
  115. package/lib/core/editor/components/Sidebar/views/CanvasPanel/ImagePanel.js +12 -0
  116. package/lib/core/editor/components/Sidebar/views/CanvasPanel/index.js +11 -0
  117. package/lib/core/editor/components/Sidebar/views/ComponentPanel.js +53 -0
  118. package/lib/core/editor/components/Sidebar/views/ImagePanel/CiTypeImagePanel.js +34 -0
  119. package/lib/core/editor/components/Sidebar/views/ImagePanel/CustomImagePanel.js +58 -0
  120. package/lib/core/editor/components/Sidebar/views/ImagePanel/ImagePalette.js +56 -0
  121. package/lib/core/editor/components/Sidebar/views/ImagePanel/ImagePanel.js +43 -0
  122. package/lib/core/editor/components/Sidebar/views/ImagePanel/index.js +11 -0
  123. package/lib/core/editor/components/Sidebar/views/LinkPanel.js +56 -0
  124. package/lib/{networkTopo/components/viewer/titlebar/MoreButtonMenu.js → core/editor/components/Toolbar/EditorToolbar.js} +36 -29
  125. package/lib/core/editor/components/Toolbar/Toolbar.js +19 -0
  126. package/lib/core/editor/components/Toolbar/Toolbar.module.scss +21 -0
  127. package/lib/core/editor/components/Toolbar/buttons.js +62 -0
  128. package/lib/core/editor/components/Toolbar/widgets/AddResourceButton.js +33 -0
  129. package/lib/core/editor/components/Toolbar/widgets/AddResourceWidget.js +27 -0
  130. package/lib/core/editor/components/Toolbar/widgets/BoxBackgroundButton/BoxBackgroundButton.js +63 -0
  131. package/lib/core/editor/components/Toolbar/widgets/BoxBackgroundButton/BoxBackgroundSetting.js +16 -0
  132. package/lib/core/editor/components/Toolbar/widgets/BoxBackgroundButton/index.js +11 -0
  133. package/lib/core/editor/components/Toolbar/widgets/CanvasMoveWidget.js +27 -0
  134. package/lib/core/editor/components/Toolbar/widgets/CanvasSelectWidget.js +29 -0
  135. package/lib/core/editor/components/Toolbar/widgets/Divider.js +19 -0
  136. package/lib/core/editor/components/Toolbar/widgets/Divider.module.scss +6 -0
  137. package/lib/core/editor/components/Toolbar/widgets/Dropdown.js +26 -0
  138. package/lib/core/editor/components/Toolbar/widgets/EdgeColorButton/Content.js +16 -0
  139. package/lib/core/editor/components/Toolbar/widgets/EdgeColorButton/EdgeColorButton.js +63 -0
  140. package/lib/core/editor/components/Toolbar/widgets/EdgeColorButton/index.js +11 -0
  141. package/lib/core/editor/components/Toolbar/widgets/EdgeTypeButton/EdgeType.js +16 -0
  142. package/lib/core/editor/components/Toolbar/widgets/EdgeTypeButton/index.js +61 -0
  143. package/lib/core/editor/components/Toolbar/widgets/FontColorButton.js +58 -0
  144. package/lib/core/editor/components/Toolbar/widgets/FontFamilyWidget.js +54 -0
  145. package/lib/core/editor/components/Toolbar/widgets/FontSizeWidget.js +49 -0
  146. package/lib/core/editor/components/Toolbar/widgets/FontStyleButton.js +76 -0
  147. package/lib/core/editor/components/Toolbar/widgets/HistoryRedoButton.js +31 -0
  148. package/lib/core/editor/components/Toolbar/widgets/HistoryUndoButton.js +38 -0
  149. package/lib/core/editor/components/Toolbar/widgets/Layout/index.js +40 -0
  150. package/lib/core/editor/components/Toolbar/widgets/NodeAlignWidget.js +64 -0
  151. package/lib/core/editor/components/Toolbar/widgets/NodeImageButton/BoxBackgroundSetting.js +16 -0
  152. package/lib/core/editor/components/Toolbar/widgets/NodeImageButton/NodeImageButton.js +63 -0
  153. package/lib/core/editor/components/Toolbar/widgets/NodeImageButton/index.js +11 -0
  154. package/lib/core/editor/components/Toolbar/widgets/NodeSizeButton/BoxBackgroundSetting.js +16 -0
  155. package/lib/core/editor/components/Toolbar/widgets/NodeSizeButton/NodeSizeButton.js +59 -0
  156. package/lib/core/editor/components/Toolbar/widgets/NodeSizeButton/index.js +11 -0
  157. package/lib/core/editor/components/Toolbar/widgets/SearchWidget.js +53 -0
  158. package/lib/core/editor/components/Toolbar/widgets/WidgetBox.js +63 -0
  159. package/lib/core/editor/components/Toolbar/widgets/WidgetBox.module.scss +64 -0
  160. package/lib/core/editor/components/Toolbar/widgets/components/ArrowButton.js +31 -0
  161. package/lib/core/editor/components/Toolbar/widgets/components/ArrowButton.module.scss +8 -0
  162. package/lib/core/editor/components/Toolbar/widgets/components/ArrowPopup.js +40 -0
  163. package/lib/core/editor/components/Toolbar/widgets/components/ArrowPopup.module.scss +10 -0
  164. package/lib/core/editor/components/Toolbar/widgets/components/ButtonBox.js +48 -0
  165. package/lib/core/editor/components/Toolbar/widgets/components/ButtonBox.module.scss +30 -0
  166. package/lib/core/editor/components/Toolbar/widgets/components/DropdownButton.js +64 -0
  167. package/lib/core/editor/components/Toolbar/widgets/components/DropdownButton.module.scss +10 -0
  168. package/lib/core/editor/components/Toolbar/widgets/components/DropdownMenu.js +41 -0
  169. package/lib/core/editor/components/Toolbar/widgets/components/MenuSelect.js +30 -0
  170. package/lib/core/editor/components/Toolbar/widgets.js +1 -0
  171. package/lib/core/editor/components/settings/common/SizeInput/NodeSizeInput.js +25 -8
  172. package/lib/core/editor/components/settings/common/SizeInput/NodeSizeInput.module.scss +4 -3
  173. package/lib/core/editor/components/settings/propertyViews/view/BatchSetNodeSize.js +5 -2
  174. package/lib/core/editor/components/titlebar/TopoEditorTitleBar.js +5 -11
  175. package/lib/core/models/HistoryManager.js +32 -5
  176. package/lib/core/models/SelectionManager.js +7 -0
  177. package/lib/core/models/TopoApp.js +4 -1
  178. package/lib/core/store/coreModels.js +6 -6
  179. package/lib/core/store/models/displayConfig.js +2 -3
  180. package/lib/core/store/models/historyManager.js +41 -0
  181. package/lib/core/viewer/components/titlebar/widgets/SearchWidget.js +3 -1
  182. package/lib/networkTopo/components/TopoView.js +2 -104
  183. package/lib/networkTopo/components/Topology.js +3 -41
  184. package/lib/networkTopo/components/editor/useEditorProps.js +49 -0
  185. package/lib/networkTopo/hooks/useLinkDynamicStyle.js +2 -2
  186. package/lib/style.js +1 -1
  187. package/package.json +3 -3
  188. package/es/core/components/DisplaySettingDrawer/LinkTip.js +0 -41
  189. package/es/networkTopo/components/viewer/displaySetting/LinkAttrCustomSettingDrawer.js +0 -59
  190. package/es/networkTopo/components/viewer/displaySetting/LinkTagCommonRidioGroup.js +0 -24
  191. package/es/networkTopo/components/viewer/displaySetting/LinkTagCommonRidioGroup.module.scss +0 -23
  192. package/es/networkTopo/components/viewer/displaySetting/LinkTagV2.js +0 -93
  193. package/es/networkTopo/components/viewer/titlebar/MoreButtonMenu.js +0 -32
  194. package/es/networkTopo/components/viewer/titlebar/ViewerTools.js +0 -9
  195. package/es/networkTopo/components/viewer/titlebar/useSetDefaultTopo.js +0 -30
  196. package/lib/core/components/DisplaySettingDrawer/LinkTip.js +0 -55
  197. package/lib/networkTopo/components/viewer/displaySetting/LinkAttrCustomSettingDrawer.js +0 -76
  198. package/lib/networkTopo/components/viewer/displaySetting/LinkTagCommonRidioGroup.js +0 -35
  199. package/lib/networkTopo/components/viewer/displaySetting/LinkTagCommonRidioGroup.module.scss +0 -23
  200. package/lib/networkTopo/components/viewer/displaySetting/LinkTagV2.js +0 -108
  201. package/lib/networkTopo/components/viewer/titlebar/ViewerTools.js +0 -19
  202. package/lib/networkTopo/components/viewer/titlebar/useSetDefaultTopo.js +0 -40
@@ -1,59 +0,0 @@
1
- import _extends from "@babel/runtime/helpers/extends";
2
- import React, { forwardRef, useEffect, useState } from 'react';
3
- import PropTypes from 'prop-types';
4
- import ResourceDiplayInfoSetting from "../../../../core/components/ResourceViewAttributeSetting/Setting";
5
- import rlog from '@riil-frontend/component-topology-utils/lib/rlog';
6
- /**
7
- * 链路标注、悬浮框设置
8
- */
9
-
10
- var LinkAttrCustomSettingDrawer = /*#__PURE__*/forwardRef(function (props, ref) {
11
- var topo = props.topo,
12
- showType = props.showType,
13
- value = props.value;
14
-
15
- var _useState = useState({}),
16
- data = _useState[0],
17
- setData = _useState[1];
18
-
19
- var queryData = function queryData() {
20
- rlog.info('链路属性配置:加载数据');
21
- var valueData = value.data || {};
22
- var result = {};
23
- topo.elementTagTipConfig.getLinkConfigItems().forEach(function (item) {
24
- var valueAttrs = valueData[item.id] || [];
25
- result[item.id] = {
26
- code: item.id,
27
- name: item.label,
28
- icon: 'networkLink',
29
- list: item.list.map(function (listItem) {
30
- var code = listItem.code.split(':')[1];
31
- return {
32
- id: listItem.code.split(':')[1] + "-" + listItem.type,
33
- code: code,
34
- name: listItem.name,
35
- type: listItem.type,
36
- tag: !!valueAttrs.find(function (a) {
37
- return a.code === code && a.type === listItem.type;
38
- }),
39
- tip: !!valueAttrs.find(function (a) {
40
- return a.code === code && a.type === listItem.type;
41
- })
42
- };
43
- })
44
- };
45
- });
46
- setData(result);
47
- return result;
48
- };
49
-
50
- return /*#__PURE__*/React.createElement(ResourceDiplayInfoSetting, _extends({
51
- ref: ref
52
- }, props, {
53
- data: data,
54
- queryData: queryData
55
- }));
56
- });
57
- LinkAttrCustomSettingDrawer.displayName = 'LinkAttrCustomSettingDrawer';
58
- LinkAttrCustomSettingDrawer.propTypes = {};
59
- export default LinkAttrCustomSettingDrawer;
@@ -1,24 +0,0 @@
1
- import _Radio from "@alifd/next/es/radio";
2
- import React from 'react';
3
- import styles from "./LinkTagCommonRidioGroup.module.scss";
4
- export default function LinkTagCommonRidioGroup(props) {
5
- var value = props.value,
6
- dataSource = props.dataSource,
7
- limit = props.limit,
8
- onChange = props.onChange;
9
- return /*#__PURE__*/React.createElement("div", {
10
- className: styles.contaienr
11
- }, /*#__PURE__*/React.createElement("div", {
12
- className: styles.checkboxGroupWrapper
13
- }, /*#__PURE__*/React.createElement(_Radio.Group, {
14
- value: typeof value === 'string' ? value : '0',
15
- itemDirection: "ver",
16
- onChange: onChange
17
- }, dataSource.map(function (item) {
18
- return /*#__PURE__*/React.createElement(_Radio, {
19
- key: item.value,
20
- value: item.value
21
- }, item.label);
22
- }))));
23
- }
24
- ;
@@ -1,23 +0,0 @@
1
- @import "@alifd/next/variables";
2
-
3
- .contaienr {
4
- padding: 16px 12px;
5
- background: #F2F7FD;
6
- border-radius: 4px;
7
-
8
- .checkboxGroupWrapper {
9
- margin: -8px -8px -8px 0;
10
-
11
- :global {
12
- .#{$css-prefix}checkbox-group.next-checkbox-group-hoz {
13
- display: flex;
14
- flex-flow: row wrap;
15
-
16
- .#{$css-prefix}checkbox-wrapper {
17
- margin-left: 8px;
18
- margin-right: 8px;
19
- }
20
- }
21
- }
22
- }
23
- }
@@ -1,93 +0,0 @@
1
- import _extends from "@babel/runtime/helpers/extends";
2
- import React from 'react';
3
- import { DEFAULT_LINK_TAG_COMMON_CONFIG } from "../../../../constants/ResourceInfoDisplay";
4
- import BasicConfig from "../../../../core/components/DisplaySettingDrawer/ResourceDisplay/BasicConfig";
5
- import LinkAttrCustomSettingDrawer from "./LinkAttrCustomSettingDrawer";
6
- import LinkTagCommonRidioGroup from "./LinkTagCommonRidioGroup"; // 默认中可配置内容包括总速率、带宽利用率、发送速率、发送带宽利用率、接收速率、接收带宽利用率
7
-
8
- var CommonOptions = [{
9
- value: '0',
10
- label: '无'
11
- }, {
12
- value: '1',
13
- label: '总速率、带宽利用率',
14
- options: {
15
- data: ['metric:interface_totalbps', 'metric:bandwidth_utilization']
16
- }
17
- }, {
18
- value: '2',
19
- label: '发送速率、发送带宽利用率',
20
- options: {
21
- data: ['metric:out_rate', 'metric:out_bandwidth_utilization']
22
- }
23
- }, {
24
- value: '3',
25
- label: '接收速率、接收带宽利用率',
26
- options: {
27
- data: ['metric:in_rate', 'metric:in_bandwidth_utilization']
28
- }
29
- }];
30
-
31
- var buildConfig = function buildConfig(item) {
32
- return {
33
- type: item.split(':')[0],
34
- code: item.split(':')[1]
35
- };
36
- };
37
- /**
38
- * 资源标注配置
39
- * @param {*} props
40
- * @returns
41
- */
42
-
43
-
44
- function LinkTagV2(props, ref) {
45
- var value = props.value,
46
- onChange = props.onChange;
47
-
48
- var handleChange = function handleChange(newValue) {
49
- // console.error(111, newValue)
50
- if (!newValue.isCustom) {
51
- var _CommonOptions$find;
52
-
53
- var type = newValue.data;
54
- var config = ((_CommonOptions$find = CommonOptions.find(function (item) {
55
- return item.value === type;
56
- })) === null || _CommonOptions$find === void 0 ? void 0 : _CommonOptions$find.options) || {
57
- data: []
58
- };
59
- onChange(_extends({}, newValue, config, {
60
- data: config.data.map(buildConfig),
61
- type: type
62
- }));
63
- } else {
64
- onChange(newValue);
65
- }
66
- };
67
-
68
- var LinkTagCommonRidioGroupWrapper = function LinkTagCommonRidioGroupWrapper(aaProps) {
69
- return /*#__PURE__*/React.createElement(LinkTagCommonRidioGroup, _extends({}, aaProps, {
70
- value: value ? value.type : undefined
71
- }));
72
- };
73
-
74
- return /*#__PURE__*/React.createElement(BasicConfig, _extends({
75
- ref: ref
76
- }, props, {
77
- value: value ? _extends({}, value, {
78
- data: value.data
79
- }) : value,
80
- limit: 2,
81
- elementType: "link",
82
- showType: "tag",
83
- commonOptions: CommonOptions,
84
- defaultCommonConfig: DEFAULT_LINK_TAG_COMMON_CONFIG,
85
- commonSelectWidget: LinkTagCommonRidioGroupWrapper,
86
- customSettingDrawer: function customSettingDrawer(params) {
87
- return /*#__PURE__*/React.createElement(LinkAttrCustomSettingDrawer, params);
88
- },
89
- onChange: handleChange
90
- }));
91
- }
92
-
93
- export default /*#__PURE__*/React.forwardRef(LinkTagV2);
@@ -1,32 +0,0 @@
1
- import _Dropdown from "@alifd/next/es/dropdown";
2
- import _Menu from "@alifd/next/es/menu";
3
- import _Button from "@alifd/next/es/button";
4
- import _Icon from "@alifd/next/es/icon";
5
- import React, { useState, useEffect, useRef, useCallback } from "react";
6
- import useSetDefaultTopo from "./useSetDefaultTopo";
7
- import exportData from "../../../utils/exportData";
8
- export default function MoreButtonMenu(props) {
9
- var topo = props.topo,
10
- style = props.style;
11
- var setDefaultTopo = useSetDefaultTopo({
12
- topo: topo
13
- });
14
- return /*#__PURE__*/React.createElement("div", {
15
- style: style
16
- }, /*#__PURE__*/React.createElement(_Dropdown, {
17
- trigger: /*#__PURE__*/React.createElement(_Button, {
18
- title: "\u66F4\u591A"
19
- }, /*#__PURE__*/React.createElement(_Icon, {
20
- type: "ellipsis-vertical"
21
- })),
22
- triggerType: "click"
23
- }, /*#__PURE__*/React.createElement(_Menu, null, setDefaultTopo.renderMenuItem(), /*#__PURE__*/React.createElement(_Menu.Item, {
24
- onClick: function onClick() {
25
- exportData(topo);
26
- }
27
- }, "\u5BFC\u51FA\u6570\u636E"), /*#__PURE__*/React.createElement(_Menu.Item, {
28
- onClick: function onClick() {
29
- topo.exportImage();
30
- }
31
- }, "\u5BFC\u51FA\u62D3\u6251\u56FE"))));
32
- }
@@ -1,9 +0,0 @@
1
- import React from "react";
2
- import BasicTools from "../../../../core/viewer/components/titlebar/BasicTools";
3
- import MoreButtonMenu from "./MoreButtonMenu";
4
- export default function ViewerTools(props) {
5
- var topo = props.topo;
6
- return /*#__PURE__*/React.createElement(BasicTools, props, /*#__PURE__*/React.createElement(MoreButtonMenu, {
7
- topo: topo
8
- }));
9
- }
@@ -1,30 +0,0 @@
1
- import _Menu from "@alifd/next/es/menu";
2
- import React from 'react';
3
- import { findNodeById } from "../../../../utils/tree";
4
- export default function useSetDefaultTopo(props) {
5
- var _findNodeById;
6
-
7
- var topo = props.topo;
8
- var store = topo.store;
9
- var functionAuthState = store.useModelState('functionAuth');
10
- var topoModState = store.useModelState('topoMod');
11
-
12
- var _store$useModel = store.useModel('topoTreeMod'),
13
- topoTreeState = _store$useModel[0],
14
- topoTreeDispatchers = _store$useModel[1];
15
-
16
- var isDefault = (_findNodeById = findNodeById(topoTreeState.treeData, topoModState.topoId)) === null || _findNodeById === void 0 ? void 0 : _findNodeById.showDefault;
17
- var showButton = !!functionAuthState.permissions.manageNavTree && !isDefault;
18
-
19
- var setDefault = function setDefault() {
20
- topoTreeDispatchers.setDefTopoOnTree(topoModState.topoId);
21
- };
22
-
23
- return {
24
- renderMenuItem: function renderMenuItem() {
25
- return showButton && /*#__PURE__*/React.createElement(_Menu.Item, {
26
- onClick: setDefault
27
- }, "\u8BBE\u4E3A\u9ED8\u8BA4\u62D3\u6251");
28
- }
29
- };
30
- }
@@ -1,55 +0,0 @@
1
- "use strict";
2
-
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
-
5
- exports.__esModule = true;
6
- exports["default"] = void 0;
7
-
8
- var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
9
-
10
- var _react = _interopRequireDefault(require("react"));
11
-
12
- var _ResourceInfoDisplay = require("../../../constants/ResourceInfoDisplay");
13
-
14
- var _LinkAttrCustomSettingDrawer = _interopRequireDefault(require("../../../networkTopo/components/viewer/displaySetting/LinkAttrCustomSettingDrawer"));
15
-
16
- var _BasicConfig = _interopRequireDefault(require("./ResourceDisplay/BasicConfig"));
17
-
18
- // 源端口、目的端口、总流量、带宽利用率
19
- var CommonOptions = [{
20
- value: 'attribute:source_id',
21
- label: '源端口'
22
- }, {
23
- value: 'attribute:destination_id',
24
- label: '目的端口'
25
- }, {
26
- value: 'metric:interface_totalbps',
27
- label: '总速率'
28
- }, {
29
- value: 'metric:bandwidth_utilization',
30
- label: '带宽利用率'
31
- }];
32
- /**
33
- * 资源标注配置
34
- * @param {*} props
35
- * @returns
36
- */
37
-
38
- function LinkTip(props, ref) {
39
- return /*#__PURE__*/_react["default"].createElement(_BasicConfig["default"], (0, _extends2["default"])({
40
- ref: ref
41
- }, props, {
42
- limit: 4,
43
- elementType: "link",
44
- showType: "tip",
45
- commonOptions: CommonOptions,
46
- defaultCommonConfig: _ResourceInfoDisplay.DEFAULT_TIP_COMMON_CONFIG,
47
- customSettingDrawer: function customSettingDrawer(params) {
48
- return /*#__PURE__*/_react["default"].createElement(_LinkAttrCustomSettingDrawer["default"], params);
49
- }
50
- }));
51
- }
52
-
53
- var _default = /*#__PURE__*/_react["default"].forwardRef(LinkTip);
54
-
55
- exports["default"] = _default;
@@ -1,76 +0,0 @@
1
- "use strict";
2
-
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
-
5
- exports.__esModule = true;
6
- exports["default"] = void 0;
7
-
8
- var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
9
-
10
- var _react = _interopRequireWildcard(require("react"));
11
-
12
- var _propTypes = _interopRequireDefault(require("prop-types"));
13
-
14
- var _Setting = _interopRequireDefault(require("../../../../core/components/ResourceViewAttributeSetting/Setting"));
15
-
16
- var _rlog = _interopRequireDefault(require("@riil-frontend/component-topology-utils/lib/rlog"));
17
-
18
- function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
19
-
20
- 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; }
21
-
22
- /**
23
- * 链路标注、悬浮框设置
24
- */
25
- var LinkAttrCustomSettingDrawer = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
26
- var topo = props.topo,
27
- showType = props.showType,
28
- value = props.value;
29
-
30
- var _useState = (0, _react.useState)({}),
31
- data = _useState[0],
32
- setData = _useState[1];
33
-
34
- var queryData = function queryData() {
35
- _rlog["default"].info('链路属性配置:加载数据');
36
-
37
- var valueData = value.data || {};
38
- var result = {};
39
- topo.elementTagTipConfig.getLinkConfigItems().forEach(function (item) {
40
- var valueAttrs = valueData[item.id] || [];
41
- result[item.id] = {
42
- code: item.id,
43
- name: item.label,
44
- icon: 'networkLink',
45
- list: item.list.map(function (listItem) {
46
- var code = listItem.code.split(':')[1];
47
- return {
48
- id: listItem.code.split(':')[1] + "-" + listItem.type,
49
- code: code,
50
- name: listItem.name,
51
- type: listItem.type,
52
- tag: !!valueAttrs.find(function (a) {
53
- return a.code === code && a.type === listItem.type;
54
- }),
55
- tip: !!valueAttrs.find(function (a) {
56
- return a.code === code && a.type === listItem.type;
57
- })
58
- };
59
- })
60
- };
61
- });
62
- setData(result);
63
- return result;
64
- };
65
-
66
- return /*#__PURE__*/_react["default"].createElement(_Setting["default"], (0, _extends2["default"])({
67
- ref: ref
68
- }, props, {
69
- data: data,
70
- queryData: queryData
71
- }));
72
- });
73
- LinkAttrCustomSettingDrawer.displayName = 'LinkAttrCustomSettingDrawer';
74
- LinkAttrCustomSettingDrawer.propTypes = {};
75
- var _default = LinkAttrCustomSettingDrawer;
76
- exports["default"] = _default;
@@ -1,35 +0,0 @@
1
- "use strict";
2
-
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
-
5
- exports.__esModule = true;
6
- exports["default"] = LinkTagCommonRidioGroup;
7
-
8
- var _radio = _interopRequireDefault(require("@alifd/next/lib/radio"));
9
-
10
- var _react = _interopRequireDefault(require("react"));
11
-
12
- var _LinkTagCommonRidioGroupModule = _interopRequireDefault(require("./LinkTagCommonRidioGroup.module.scss"));
13
-
14
- function LinkTagCommonRidioGroup(props) {
15
- var value = props.value,
16
- dataSource = props.dataSource,
17
- limit = props.limit,
18
- onChange = props.onChange;
19
- return /*#__PURE__*/_react["default"].createElement("div", {
20
- className: _LinkTagCommonRidioGroupModule["default"].contaienr
21
- }, /*#__PURE__*/_react["default"].createElement("div", {
22
- className: _LinkTagCommonRidioGroupModule["default"].checkboxGroupWrapper
23
- }, /*#__PURE__*/_react["default"].createElement(_radio["default"].Group, {
24
- value: typeof value === 'string' ? value : '0',
25
- itemDirection: "ver",
26
- onChange: onChange
27
- }, dataSource.map(function (item) {
28
- return /*#__PURE__*/_react["default"].createElement(_radio["default"], {
29
- key: item.value,
30
- value: item.value
31
- }, item.label);
32
- }))));
33
- }
34
-
35
- ;
@@ -1,23 +0,0 @@
1
- @import "@alifd/next/variables";
2
-
3
- .contaienr {
4
- padding: 16px 12px;
5
- background: #F2F7FD;
6
- border-radius: 4px;
7
-
8
- .checkboxGroupWrapper {
9
- margin: -8px -8px -8px 0;
10
-
11
- :global {
12
- .#{$css-prefix}checkbox-group.next-checkbox-group-hoz {
13
- display: flex;
14
- flex-flow: row wrap;
15
-
16
- .#{$css-prefix}checkbox-wrapper {
17
- margin-left: 8px;
18
- margin-right: 8px;
19
- }
20
- }
21
- }
22
- }
23
- }
@@ -1,108 +0,0 @@
1
- "use strict";
2
-
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
-
5
- exports.__esModule = true;
6
- exports["default"] = void 0;
7
-
8
- var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
9
-
10
- var _react = _interopRequireDefault(require("react"));
11
-
12
- var _ResourceInfoDisplay = require("../../../../constants/ResourceInfoDisplay");
13
-
14
- var _BasicConfig = _interopRequireDefault(require("../../../../core/components/DisplaySettingDrawer/ResourceDisplay/BasicConfig"));
15
-
16
- var _LinkAttrCustomSettingDrawer = _interopRequireDefault(require("./LinkAttrCustomSettingDrawer"));
17
-
18
- var _LinkTagCommonRidioGroup = _interopRequireDefault(require("./LinkTagCommonRidioGroup"));
19
-
20
- // 默认中可配置内容包括总速率、带宽利用率、发送速率、发送带宽利用率、接收速率、接收带宽利用率
21
- var CommonOptions = [{
22
- value: '0',
23
- label: '无'
24
- }, {
25
- value: '1',
26
- label: '总速率、带宽利用率',
27
- options: {
28
- data: ['metric:interface_totalbps', 'metric:bandwidth_utilization']
29
- }
30
- }, {
31
- value: '2',
32
- label: '发送速率、发送带宽利用率',
33
- options: {
34
- data: ['metric:out_rate', 'metric:out_bandwidth_utilization']
35
- }
36
- }, {
37
- value: '3',
38
- label: '接收速率、接收带宽利用率',
39
- options: {
40
- data: ['metric:in_rate', 'metric:in_bandwidth_utilization']
41
- }
42
- }];
43
-
44
- var buildConfig = function buildConfig(item) {
45
- return {
46
- type: item.split(':')[0],
47
- code: item.split(':')[1]
48
- };
49
- };
50
- /**
51
- * 资源标注配置
52
- * @param {*} props
53
- * @returns
54
- */
55
-
56
-
57
- function LinkTagV2(props, ref) {
58
- var value = props.value,
59
- onChange = props.onChange;
60
-
61
- var handleChange = function handleChange(newValue) {
62
- // console.error(111, newValue)
63
- if (!newValue.isCustom) {
64
- var _CommonOptions$find;
65
-
66
- var type = newValue.data;
67
- var config = ((_CommonOptions$find = CommonOptions.find(function (item) {
68
- return item.value === type;
69
- })) === null || _CommonOptions$find === void 0 ? void 0 : _CommonOptions$find.options) || {
70
- data: []
71
- };
72
- onChange((0, _extends2["default"])({}, newValue, config, {
73
- data: config.data.map(buildConfig),
74
- type: type
75
- }));
76
- } else {
77
- onChange(newValue);
78
- }
79
- };
80
-
81
- var LinkTagCommonRidioGroupWrapper = function LinkTagCommonRidioGroupWrapper(aaProps) {
82
- return /*#__PURE__*/_react["default"].createElement(_LinkTagCommonRidioGroup["default"], (0, _extends2["default"])({}, aaProps, {
83
- value: value ? value.type : undefined
84
- }));
85
- };
86
-
87
- return /*#__PURE__*/_react["default"].createElement(_BasicConfig["default"], (0, _extends2["default"])({
88
- ref: ref
89
- }, props, {
90
- value: value ? (0, _extends2["default"])({}, value, {
91
- data: value.data
92
- }) : value,
93
- limit: 2,
94
- elementType: "link",
95
- showType: "tag",
96
- commonOptions: CommonOptions,
97
- defaultCommonConfig: _ResourceInfoDisplay.DEFAULT_LINK_TAG_COMMON_CONFIG,
98
- commonSelectWidget: LinkTagCommonRidioGroupWrapper,
99
- customSettingDrawer: function customSettingDrawer(params) {
100
- return /*#__PURE__*/_react["default"].createElement(_LinkAttrCustomSettingDrawer["default"], params);
101
- },
102
- onChange: handleChange
103
- }));
104
- }
105
-
106
- var _default = /*#__PURE__*/_react["default"].forwardRef(LinkTagV2);
107
-
108
- exports["default"] = _default;
@@ -1,19 +0,0 @@
1
- "use strict";
2
-
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
-
5
- exports.__esModule = true;
6
- exports["default"] = ViewerTools;
7
-
8
- var _react = _interopRequireDefault(require("react"));
9
-
10
- var _BasicTools = _interopRequireDefault(require("../../../../core/viewer/components/titlebar/BasicTools"));
11
-
12
- var _MoreButtonMenu = _interopRequireDefault(require("./MoreButtonMenu"));
13
-
14
- function ViewerTools(props) {
15
- var topo = props.topo;
16
- return /*#__PURE__*/_react["default"].createElement(_BasicTools["default"], props, /*#__PURE__*/_react["default"].createElement(_MoreButtonMenu["default"], {
17
- topo: topo
18
- }));
19
- }
@@ -1,40 +0,0 @@
1
- "use strict";
2
-
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
-
5
- exports.__esModule = true;
6
- exports["default"] = useSetDefaultTopo;
7
-
8
- var _menu = _interopRequireDefault(require("@alifd/next/lib/menu"));
9
-
10
- var _react = _interopRequireDefault(require("react"));
11
-
12
- var _tree = require("../../../../utils/tree");
13
-
14
- function useSetDefaultTopo(props) {
15
- var _findNodeById;
16
-
17
- var topo = props.topo;
18
- var store = topo.store;
19
- var functionAuthState = store.useModelState('functionAuth');
20
- var topoModState = store.useModelState('topoMod');
21
-
22
- var _store$useModel = store.useModel('topoTreeMod'),
23
- topoTreeState = _store$useModel[0],
24
- topoTreeDispatchers = _store$useModel[1];
25
-
26
- var isDefault = (_findNodeById = (0, _tree.findNodeById)(topoTreeState.treeData, topoModState.topoId)) === null || _findNodeById === void 0 ? void 0 : _findNodeById.showDefault;
27
- var showButton = !!functionAuthState.permissions.manageNavTree && !isDefault;
28
-
29
- var setDefault = function setDefault() {
30
- topoTreeDispatchers.setDefTopoOnTree(topoModState.topoId);
31
- };
32
-
33
- return {
34
- renderMenuItem: function renderMenuItem() {
35
- return showButton && /*#__PURE__*/_react["default"].createElement(_menu["default"].Item, {
36
- onClick: setDefault
37
- }, "\u8BBE\u4E3A\u9ED8\u8BA4\u62D3\u6251");
38
- }
39
- };
40
- }