@riil-frontend/component-topology 3.1.6 → 3.1.7

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 (41) hide show
  1. package/build/1.js +1 -1
  2. package/build/index.css +1 -1
  3. package/build/index.js +11 -11
  4. package/demo//346/240/207/346/263/250/345/222/214/346/202/254/346/265/256/346/241/206//350/207/252/345/256/232/344/271/211/345/261/236/346/200/247/345/222/214/346/214/207/346/240/207.md +1 -1
  5. package/demo-mock/basic/topo/v1/api/attributes/once +152 -0
  6. package/demo-mock/basic/topo/v1/api/attributes/once.json +152 -0
  7. package/es/core/components/DisplaySettingDrawer/DisplaySetting.js +4 -5
  8. package/es/core/components/DisplaySettingDrawer/DisplaySettingDrawer.js +2 -2
  9. package/es/core/components/DisplaySettingDrawer/hooks/useDisplaySetting.js +4 -4
  10. package/es/core/models/AttributeMetricDisplay.js +9 -5
  11. package/es/core/models/TopoApp.js +1 -1
  12. package/es/core/viewer/components/plugins/BaseInfo/ResourceDetail.js +288 -0
  13. package/es/core/viewer/components/plugins/BaseInfo/ResourceDetailPlugin.js +11 -0
  14. package/es/core/viewer/components/plugins/BaseInfo/components/ResourceOverview/BaseInfo.js +129 -0
  15. package/es/core/viewer/components/plugins/BaseInfo/components/ResourceOverview/ResourceOverviewMetric.js +46 -0
  16. package/es/core/viewer/components/plugins/BaseInfo/components/ResourceOverview/index.js +64 -172
  17. package/es/core/viewer/components/plugins/BaseInfo/components/ResourceOverview/useCiAttrAndMetricData.js +12 -0
  18. package/es/core/viewer/components/plugins/BaseInfo/index.js +2 -276
  19. package/es/core/viewer/components/titlebar/BasicTools.js +1 -1
  20. package/es/core/viewer/components/titlebar/widgets/SettingButton.js +3 -4
  21. package/es/core/viewer/components/titlebar/widgets/SettingButtonWidget.js +19 -0
  22. package/es/topoCenter/components/TopoView.js +3 -4
  23. package/es/topoCenter/models/TopoCenter.js +9 -5
  24. package/lib/core/components/DisplaySettingDrawer/DisplaySetting.js +4 -5
  25. package/lib/core/components/DisplaySettingDrawer/DisplaySettingDrawer.js +2 -2
  26. package/lib/core/components/DisplaySettingDrawer/hooks/useDisplaySetting.js +4 -4
  27. package/lib/core/models/AttributeMetricDisplay.js +8 -4
  28. package/lib/core/models/TopoApp.js +1 -1
  29. package/lib/core/viewer/components/plugins/BaseInfo/ResourceDetail.js +313 -0
  30. package/lib/core/viewer/components/plugins/BaseInfo/ResourceDetailPlugin.js +21 -0
  31. package/lib/core/viewer/components/plugins/BaseInfo/components/ResourceOverview/BaseInfo.js +139 -0
  32. package/lib/core/viewer/components/plugins/BaseInfo/components/ResourceOverview/ResourceOverviewMetric.js +56 -0
  33. package/lib/core/viewer/components/plugins/BaseInfo/components/ResourceOverview/index.js +65 -173
  34. package/lib/core/viewer/components/plugins/BaseInfo/components/ResourceOverview/useCiAttrAndMetricData.js +17 -0
  35. package/lib/core/viewer/components/plugins/BaseInfo/index.js +2 -291
  36. package/lib/core/viewer/components/titlebar/BasicTools.js +2 -2
  37. package/lib/core/viewer/components/titlebar/widgets/SettingButton.js +2 -3
  38. package/lib/core/viewer/components/titlebar/widgets/SettingButtonWidget.js +28 -0
  39. package/lib/topoCenter/components/TopoView.js +3 -4
  40. package/lib/topoCenter/models/TopoCenter.js +9 -5
  41. package/package.json +2 -2
@@ -6,7 +6,7 @@ order: 8
6
6
  <br/>
7
7
 
8
8
  - 关闭内置的属性指标推送
9
- - 设置CiType默认的属性指标显示
9
+ - 自定义链路标注、悬浮框显示
10
10
 
11
11
  <br/>
12
12
 
@@ -10044,5 +10044,157 @@
10044
10044
  "templateCode": "m.export_link"
10045
10045
  }
10046
10046
  ]
10047
+ },
10048
+ {
10049
+ "code": "xx_link",
10050
+ "name": "xx链路",
10051
+ "icon": "xxLink",
10052
+ "extend": null,
10053
+ "domain": "network",
10054
+ "parent": null,
10055
+ "enable": true,
10056
+ "source": "system",
10057
+ "displayName": "网络链路",
10058
+ "vendor": null,
10059
+ "version": "v1.0",
10060
+ "category": "resources",
10061
+ "attributes": [
10062
+ {
10063
+ "id": "00000000080691f4",
10064
+ "key": null,
10065
+ "creator": null,
10066
+ "createdTime": 1650018956291,
10067
+ "updatedTime": 1650018956291,
10068
+ "code": "name",
10069
+ "name": "名称",
10070
+ "label": "资源",
10071
+ "type": "assets",
10072
+ "metricCode": "",
10073
+ "description": "名称",
10074
+ "source": "system",
10075
+ "dataType": "string",
10076
+ "dataLength": "255",
10077
+ "dataRange": "",
10078
+ "unit": "",
10079
+ "initValue": "",
10080
+ "defaultValue": "",
10081
+ "changeValue": "",
10082
+ "userVisible": true,
10083
+ "modifiable": false,
10084
+ "required": true,
10085
+ "enable": true,
10086
+ "refCi": null,
10087
+ "isPublic": true,
10088
+ "dictCode": null,
10089
+ "attrSource": "public",
10090
+ "refTemplateCode": "t.base",
10091
+ "refTemplateName": "基础模板",
10092
+ "dataSource": "discover"
10093
+ },
10094
+ {
10095
+ "id": "00000000080691f5",
10096
+ "key": null,
10097
+ "creator": null,
10098
+ "createdTime": 1650018956293,
10099
+ "updatedTime": 1650018956293,
10100
+ "code": "display_name",
10101
+ "name": "显示名称",
10102
+ "label": "资源",
10103
+ "type": "assets",
10104
+ "metricCode": "",
10105
+ "description": "显示名称",
10106
+ "source": "system",
10107
+ "dataType": "string",
10108
+ "dataLength": "255",
10109
+ "dataRange": "",
10110
+ "unit": "",
10111
+ "initValue": "name",
10112
+ "defaultValue": "",
10113
+ "changeValue": "",
10114
+ "userVisible": true,
10115
+ "modifiable": true,
10116
+ "required": false,
10117
+ "enable": true,
10118
+ "refCi": null,
10119
+ "isPublic": true,
10120
+ "dictCode": null,
10121
+ "attrSource": "public",
10122
+ "refTemplateCode": "t.base",
10123
+ "refTemplateName": "基础模板",
10124
+ "dataSource": "discover, manual"
10125
+ },
10126
+ {
10127
+ "id": null,
10128
+ "key": null,
10129
+ "creator": null,
10130
+ "createdTime": null,
10131
+ "updatedTime": null,
10132
+ "code": "xxx",
10133
+ "name": "xxx属性",
10134
+ "label": "",
10135
+ "type": "config",
10136
+ "metricCode": "",
10137
+ "description": "到网络出口的距离(跳数)",
10138
+ "source": "system",
10139
+ "dataType": "int",
10140
+ "dataLength": "128",
10141
+ "dataRange": "",
10142
+ "unit": "",
10143
+ "initValue": "",
10144
+ "defaultValue": "2147483647",
10145
+ "changeValue": "",
10146
+ "userVisible": false,
10147
+ "modifiable": false,
10148
+ "required": false,
10149
+ "enable": true,
10150
+ "refCi": null,
10151
+ "isPublic": null,
10152
+ "dictCode": null,
10153
+ "attrSource": "private",
10154
+ "refTemplateCode": "t.base",
10155
+ "refTemplateName": "基础模板",
10156
+ "dataSource": "manual"
10157
+ }
10158
+ ],
10159
+ "metrics": [
10160
+ {
10161
+ "id": null,
10162
+ "key": null,
10163
+ "creator": null,
10164
+ "createdTime": null,
10165
+ "updatedTime": null,
10166
+ "ref": null,
10167
+ "code": "xxx1",
10168
+ "name": "xxx1指标",
10169
+ "desc": null,
10170
+ "label": "",
10171
+ "isGoldMetric": true,
10172
+ "metricType": "capacity",
10173
+ "unit": "%",
10174
+ "dataType": "double",
10175
+ "dataRange": "0-100",
10176
+ "changeValue": "",
10177
+ "templateCode": "m.agg_link"
10178
+ },
10179
+ {
10180
+ "id": null,
10181
+ "key": null,
10182
+ "creator": null,
10183
+ "createdTime": null,
10184
+ "updatedTime": null,
10185
+ "ref": null,
10186
+ "code": "xxx2",
10187
+ "name": "xxx2指标",
10188
+ "desc": null,
10189
+ "label": "",
10190
+ "isGoldMetric": true,
10191
+ "metricType": "capacity",
10192
+ "unit": "%",
10193
+ "dataType": "double",
10194
+ "dataRange": "0-100",
10195
+ "changeValue": "",
10196
+ "templateCode": "m.agg_link"
10197
+ }
10198
+ ]
10047
10199
  }
10048
10200
  ]
@@ -10044,5 +10044,157 @@
10044
10044
  "templateCode": "m.export_link"
10045
10045
  }
10046
10046
  ]
10047
+ },
10048
+ {
10049
+ "code": "xx_link",
10050
+ "name": "xx链路",
10051
+ "icon": "xxLink",
10052
+ "extend": null,
10053
+ "domain": "network",
10054
+ "parent": null,
10055
+ "enable": true,
10056
+ "source": "system",
10057
+ "displayName": "网络链路",
10058
+ "vendor": null,
10059
+ "version": "v1.0",
10060
+ "category": "resources",
10061
+ "attributes": [
10062
+ {
10063
+ "id": "00000000080691f4",
10064
+ "key": null,
10065
+ "creator": null,
10066
+ "createdTime": 1650018956291,
10067
+ "updatedTime": 1650018956291,
10068
+ "code": "name",
10069
+ "name": "名称",
10070
+ "label": "资源",
10071
+ "type": "assets",
10072
+ "metricCode": "",
10073
+ "description": "名称",
10074
+ "source": "system",
10075
+ "dataType": "string",
10076
+ "dataLength": "255",
10077
+ "dataRange": "",
10078
+ "unit": "",
10079
+ "initValue": "",
10080
+ "defaultValue": "",
10081
+ "changeValue": "",
10082
+ "userVisible": true,
10083
+ "modifiable": false,
10084
+ "required": true,
10085
+ "enable": true,
10086
+ "refCi": null,
10087
+ "isPublic": true,
10088
+ "dictCode": null,
10089
+ "attrSource": "public",
10090
+ "refTemplateCode": "t.base",
10091
+ "refTemplateName": "基础模板",
10092
+ "dataSource": "discover"
10093
+ },
10094
+ {
10095
+ "id": "00000000080691f5",
10096
+ "key": null,
10097
+ "creator": null,
10098
+ "createdTime": 1650018956293,
10099
+ "updatedTime": 1650018956293,
10100
+ "code": "display_name",
10101
+ "name": "显示名称",
10102
+ "label": "资源",
10103
+ "type": "assets",
10104
+ "metricCode": "",
10105
+ "description": "显示名称",
10106
+ "source": "system",
10107
+ "dataType": "string",
10108
+ "dataLength": "255",
10109
+ "dataRange": "",
10110
+ "unit": "",
10111
+ "initValue": "name",
10112
+ "defaultValue": "",
10113
+ "changeValue": "",
10114
+ "userVisible": true,
10115
+ "modifiable": true,
10116
+ "required": false,
10117
+ "enable": true,
10118
+ "refCi": null,
10119
+ "isPublic": true,
10120
+ "dictCode": null,
10121
+ "attrSource": "public",
10122
+ "refTemplateCode": "t.base",
10123
+ "refTemplateName": "基础模板",
10124
+ "dataSource": "discover, manual"
10125
+ },
10126
+ {
10127
+ "id": null,
10128
+ "key": null,
10129
+ "creator": null,
10130
+ "createdTime": null,
10131
+ "updatedTime": null,
10132
+ "code": "xxx",
10133
+ "name": "xxx属性",
10134
+ "label": "",
10135
+ "type": "config",
10136
+ "metricCode": "",
10137
+ "description": "到网络出口的距离(跳数)",
10138
+ "source": "system",
10139
+ "dataType": "int",
10140
+ "dataLength": "128",
10141
+ "dataRange": "",
10142
+ "unit": "",
10143
+ "initValue": "",
10144
+ "defaultValue": "2147483647",
10145
+ "changeValue": "",
10146
+ "userVisible": false,
10147
+ "modifiable": false,
10148
+ "required": false,
10149
+ "enable": true,
10150
+ "refCi": null,
10151
+ "isPublic": null,
10152
+ "dictCode": null,
10153
+ "attrSource": "private",
10154
+ "refTemplateCode": "t.base",
10155
+ "refTemplateName": "基础模板",
10156
+ "dataSource": "manual"
10157
+ }
10158
+ ],
10159
+ "metrics": [
10160
+ {
10161
+ "id": null,
10162
+ "key": null,
10163
+ "creator": null,
10164
+ "createdTime": null,
10165
+ "updatedTime": null,
10166
+ "ref": null,
10167
+ "code": "xxx1",
10168
+ "name": "xxx1指标",
10169
+ "desc": null,
10170
+ "label": "",
10171
+ "isGoldMetric": true,
10172
+ "metricType": "capacity",
10173
+ "unit": "%",
10174
+ "dataType": "double",
10175
+ "dataRange": "0-100",
10176
+ "changeValue": "",
10177
+ "templateCode": "m.agg_link"
10178
+ },
10179
+ {
10180
+ "id": null,
10181
+ "key": null,
10182
+ "creator": null,
10183
+ "createdTime": null,
10184
+ "updatedTime": null,
10185
+ "ref": null,
10186
+ "code": "xxx2",
10187
+ "name": "xxx2指标",
10188
+ "desc": null,
10189
+ "label": "",
10190
+ "isGoldMetric": true,
10191
+ "metricType": "capacity",
10192
+ "unit": "%",
10193
+ "dataType": "double",
10194
+ "dataRange": "0-100",
10195
+ "changeValue": "",
10196
+ "templateCode": "m.agg_link"
10197
+ }
10198
+ ]
10047
10199
  }
10048
10200
  ]
@@ -17,16 +17,15 @@ import EdgeFlowDirection from "./EdgeFlowDirection";
17
17
 
18
18
  function DisplaySetting(props, ref) {
19
19
  var topo = props.topo,
20
- viewerProps = props.viewerProps;
20
+ displaySettingProps = props.displaySettingProps;
21
21
  var displayConfig = topo.store.getModelState('displayConfig');
22
22
 
23
- var _ref = (viewerProps === null || viewerProps === void 0 ? void 0 : viewerProps.displaySettingDrawerProps) || {},
23
+ var _ref = displaySettingProps || {},
24
24
  linkTagConfig = _ref.linkTagConfig,
25
25
  linkTipConfig = _ref.linkTipConfig,
26
26
  showEdgeExpandConfig = _ref.showEdgeExpandConfig,
27
- extraConfig = _ref.extraConfig;
28
-
29
- var showLinkConfig = !!(viewerProps !== null && viewerProps !== void 0 && viewerProps.showLinkConfig);
27
+ extraConfig = _ref.extraConfig,
28
+ showLinkConfig = _ref.showLinkConfig;
30
29
 
31
30
  var field = _Field.useField({
32
31
  autoUnmount: false,
@@ -9,7 +9,7 @@ import useDisplaySetting from "./hooks/useDisplaySetting";
9
9
  export default function DisplaySettingDrawer(props) {
10
10
  var visible = props.visible,
11
11
  topo = props.topo,
12
- viewerProps = props.viewerProps,
12
+ displaySettingProps = props.displaySettingProps,
13
13
  onClose = props.onClose;
14
14
  var settingRef = useRef();
15
15
 
@@ -76,7 +76,7 @@ export default function DisplaySettingDrawer(props) {
76
76
  }, visible && /*#__PURE__*/React.createElement(DisplaySetting, {
77
77
  ref: settingRef,
78
78
  topo: topo,
79
- viewerProps: viewerProps
79
+ displaySettingProps: displaySettingProps
80
80
  }));
81
81
  }
82
82
  ;
@@ -4,7 +4,7 @@ import _regeneratorRuntime from "@babel/runtime/regenerator";
4
4
  import topoService from '@riil-frontend/component-topology-common/es/services/topo';
5
5
  export default (function (props) {
6
6
  var topo = props.topo,
7
- viewerProps = props.viewerProps,
7
+ displaySettingProps = props.displaySettingProps,
8
8
  settingRef = props.settingRef;
9
9
 
10
10
  var executeByConfig = /*#__PURE__*/function () {
@@ -17,7 +17,7 @@ export default (function (props) {
17
17
  // 更新节点名称显示隐藏
18
18
  topo.attributeMetricDisplay.updateNodesNameVisible(); // 更新连线展开折叠状态
19
19
 
20
- if (viewerProps !== null && viewerProps !== void 0 && viewerProps.showLinkConfig) {
20
+ if (displaySettingProps !== null && displaySettingProps !== void 0 && displaySettingProps.showLinkConfig) {
21
21
  if (config.expandAllEdges) {
22
22
  topo.getHtTopo().expandAllEdgeGroups();
23
23
  } else {
@@ -49,7 +49,7 @@ export default (function (props) {
49
49
 
50
50
  var save = /*#__PURE__*/function () {
51
51
  var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2() {
52
- var _viewerProps$displayS;
52
+ var _displaySettingProps$;
53
53
 
54
54
  var values, prevDisplayConfig, displayConfig, displayConfigDispatchers, extraOnOk;
55
55
  return _regeneratorRuntime.wrap(function _callee2$(_context2) {
@@ -73,7 +73,7 @@ export default (function (props) {
73
73
  displayConfigDispatchers.update(displayConfig); // 按配置执行
74
74
 
75
75
  executeByConfig(displayConfig);
76
- extraOnOk = (viewerProps === null || viewerProps === void 0 ? void 0 : (_viewerProps$displayS = viewerProps.displaySettingDrawerProps) === null || _viewerProps$displayS === void 0 ? void 0 : _viewerProps$displayS.onOk) || (viewerProps === null || viewerProps === void 0 ? void 0 : viewerProps.onDisplaySettingDrawerOk);
76
+ extraOnOk = (displaySettingProps === null || displaySettingProps === void 0 ? void 0 : (_displaySettingProps$ = displaySettingProps.displaySettingProps) === null || _displaySettingProps$ === void 0 ? void 0 : _displaySettingProps$.onOk) || (displaySettingProps === null || displaySettingProps === void 0 ? void 0 : displaySettingProps.onDisplaySettingDrawerOk);
77
77
 
78
78
  if (extraOnOk) {
79
79
  extraOnOk();
@@ -4,7 +4,7 @@ import _regeneratorRuntime from "@babel/runtime/regenerator";
4
4
  import topoServer from '@riil-frontend/component-topology-common/es/services/topo';
5
5
  import rlog from '@riil-frontend/component-topology-utils/es/rlog';
6
6
  import { keyBy } from 'lodash';
7
- import { DEFAULT_LINK_TAG_COMMON_CONFIG, DEFAULT_NODE_TAG_COMMON_CONFIG, DEFAULT_TAG_COMMON_CONFIG, DEFAULT_TIP_COMMON_CONFIG } from "../../constants/ResourceInfoDisplay";
7
+ import { DEFAULT_NODE_TAG_COMMON_CONFIG, DEFAULT_TIP_COMMON_CONFIG } from "../../constants/ResourceInfoDisplay";
8
8
  import { findItem } from "../../utils/topoData";
9
9
  import { queryCisByIds } from "../services";
10
10
  import AttributeFormatter from "./attributeFormatter";
@@ -35,8 +35,10 @@ var filterByPermission = function filterByPermission(resource, items) {
35
35
 
36
36
  var AttributeMetricDisplay = /*#__PURE__*/function () {
37
37
  function AttributeMetricDisplay(topo) {
38
+ var _this$topo$options$ta;
39
+
38
40
  this.topo = topo;
39
- var ExtElementTagTipBuilder = this.topo.options.ExtElementTagTipBuilder;
41
+ var ExtElementTagTipBuilder = (_this$topo$options$ta = this.topo.options.tagTip) === null || _this$topo$options$ta === void 0 ? void 0 : _this$topo$options$ta.ExtElementTagTipBuilder;
40
42
 
41
43
  if (ExtElementTagTipBuilder) {
42
44
  this.extElementTagTipBuilder = new ExtElementTagTipBuilder(this);
@@ -236,10 +238,12 @@ var AttributeMetricDisplay = /*#__PURE__*/function () {
236
238
  return filterUnExistedFields(items, ciTypeMeta);
237
239
  }
238
240
 
239
- var defaultLinkTagTipConfig = this.topo.options.defaultLinkTagTipConfig;
241
+ var tagTipOptions = this.topo.options.tagTip;
242
+ var defaultLinkTagConfig = tagTipOptions !== null && tagTipOptions !== void 0 && tagTipOptions.getDefaultLinkTagConfig ? tagTipOptions === null || tagTipOptions === void 0 ? void 0 : tagTipOptions.getDefaultLinkTagConfig(link) : null;
243
+ var defaultLinkTipConfig = tagTipOptions !== null && tagTipOptions !== void 0 && tagTipOptions.getDefaultLinkTipConfig ? tagTipOptions === null || tagTipOptions === void 0 ? void 0 : tagTipOptions.getDefaultLinkTipConfig(link) : null;
240
244
  return {
241
- tags: getItems(linkTag || (defaultLinkTagTipConfig === null || defaultLinkTagTipConfig === void 0 ? void 0 : defaultLinkTagTipConfig.tag)),
242
- tips: getItems(linkTip || (defaultLinkTagTipConfig === null || defaultLinkTagTipConfig === void 0 ? void 0 : defaultLinkTagTipConfig.tip))
245
+ tags: getItems(linkTag || defaultLinkTagConfig),
246
+ tips: getItems(linkTip || defaultLinkTipConfig)
243
247
  };
244
248
  };
245
249
 
@@ -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.1.6" === 'string' ? "3.1.6" : null;
23
+ var version = typeof "3.1.7" === 'string' ? "3.1.7" : null;
24
24
  console.info("\u62D3\u6251\u7248\u672C: " + version);
25
25
  /**
26
26
  * 拓扑显示和编辑