@riil-frontend/component-topology 3.1.10 → 3.1.13

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 (27) hide show
  1. package/build/index.js +40 -40
  2. package/demo/1/345/237/272/346/234/254//345/210/207/346/215/242/345/233/276/346/240/207.md +11 -0
  3. package/demo/CHANGELOG/CHANGELOG.md +15 -1
  4. package/demo-mock/basic/topo/v1/api/attributes/once +95 -0
  5. package/demo-mock/basic/topo/v1/api/attributes/once.json +96 -1
  6. package/es/components/BatchAttrMetric/index.js +1 -0
  7. package/es/core/common/icons/icon.js +20 -6
  8. package/es/core/components/DisplaySettingDrawer/ResourceDisplay/CommonCheckboxGroup.module.scss +3 -3
  9. package/es/core/components/ResourceViewAttributeSetting/Setting.js +1 -0
  10. package/es/core/models/TopoApp.js +1 -1
  11. package/es/core/viewer/components/plugins/ResourceDetail/ResourceDetail.js +10 -5
  12. package/es/core/viewer/components/plugins/ResourceDetail/ResourceDetailPlugin.js +6 -0
  13. package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/ResourceOverview.js +660 -0
  14. package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/index.js +2 -637
  15. package/es/utils/topoData.js +66 -40
  16. package/lib/components/BatchAttrMetric/index.js +1 -0
  17. package/lib/core/common/icons/icon.js +25 -6
  18. package/lib/core/components/DisplaySettingDrawer/ResourceDisplay/CommonCheckboxGroup.module.scss +3 -3
  19. package/lib/core/components/ResourceViewAttributeSetting/Setting.js +1 -0
  20. package/lib/core/models/TopoApp.js +1 -1
  21. package/lib/core/viewer/components/plugins/ResourceDetail/ResourceDetail.js +11 -5
  22. package/lib/core/viewer/components/plugins/ResourceDetail/ResourceDetailPlugin.js +6 -0
  23. package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/ResourceOverview.js +691 -0
  24. package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/index.js +4 -663
  25. package/lib/utils/topoData.js +68 -40
  26. package/package.json +2 -2
  27. package/CHANGELOG.md +0 -23
@@ -0,0 +1,11 @@
1
+ ---
2
+ title: 切换图标
3
+ order: 10
4
+ ---
5
+
6
+ <br/>
7
+
8
+ ```jsx
9
+ <DemoCode src="../../demo-src/basic/SwitchNodeIconDemo.jsx" />
10
+ ```
11
+
@@ -1,5 +1,19 @@
1
- ## v2.3.17 / 2021-11-11
1
+ ## v3.1.12 `2022-4-21 14:56:34`
2
2
 
3
+ - 概览支持自定义指标范围和顺序
4
+
5
+ ## v3.1.11 `2022-4-20 10:55:08`
6
+
7
+ - 支持移除概览功能
8
+
9
+ ## v3.1.10 `2022-4-19 11:20:01`
10
+
11
+ - 支持不显示区域添加资源按钮
12
+
13
+ ## v3.1.8
14
+
15
+ - 支持自定义链路概览基本信息
16
+ - 编辑模式节点属性面板设置支持不显示图标设置
3
17
 
4
18
 
5
19
  ## v2.1.8
@@ -10194,6 +10194,101 @@
10194
10194
  "dataRange": "0-100",
10195
10195
  "changeValue": "",
10196
10196
  "templateCode": "m.agg_link"
10197
+ },
10198
+ {
10199
+ "id": null,
10200
+ "key": null,
10201
+ "creator": null,
10202
+ "createdTime": null,
10203
+ "updatedTime": null,
10204
+ "ref": null,
10205
+ "code": "xxx3",
10206
+ "name": "xxx3指标",
10207
+ "desc": null,
10208
+ "label": "",
10209
+ "isGoldMetric": true,
10210
+ "metricType": "capacity",
10211
+ "unit": "%",
10212
+ "dataType": "double",
10213
+ "dataRange": "0-100",
10214
+ "changeValue": "",
10215
+ "templateCode": "m.agg_link"
10216
+ },
10217
+ {
10218
+ "id": null,
10219
+ "key": null,
10220
+ "creator": null,
10221
+ "createdTime": null,
10222
+ "updatedTime": null,
10223
+ "ref": null,
10224
+ "code": "xxx4",
10225
+ "name": "xxx4指标",
10226
+ "desc": null,
10227
+ "label": "",
10228
+ "isGoldMetric": true,
10229
+ "metricType": "capacity",
10230
+ "unit": "%",
10231
+ "dataType": "double",
10232
+ "dataRange": "0-100",
10233
+ "changeValue": "",
10234
+ "templateCode": "m.agg_link"
10235
+ },
10236
+ {
10237
+ "id": null,
10238
+ "key": null,
10239
+ "creator": null,
10240
+ "createdTime": null,
10241
+ "updatedTime": null,
10242
+ "ref": null,
10243
+ "code": "xxx5",
10244
+ "name": "xxx5指标",
10245
+ "desc": null,
10246
+ "label": "",
10247
+ "isGoldMetric": true,
10248
+ "metricType": "capacity",
10249
+ "unit": "%",
10250
+ "dataType": "double",
10251
+ "dataRange": "0-100",
10252
+ "changeValue": "",
10253
+ "templateCode": "m.agg_link"
10254
+ },
10255
+ {
10256
+ "id": null,
10257
+ "key": null,
10258
+ "creator": null,
10259
+ "createdTime": null,
10260
+ "updatedTime": null,
10261
+ "ref": null,
10262
+ "code": "xxx6",
10263
+ "name": "xxx6指标",
10264
+ "desc": null,
10265
+ "label": "",
10266
+ "isGoldMetric": true,
10267
+ "metricType": "capacity",
10268
+ "unit": "%",
10269
+ "dataType": "double",
10270
+ "dataRange": "0-100",
10271
+ "changeValue": "",
10272
+ "templateCode": "m.agg_link"
10273
+ },
10274
+ {
10275
+ "id": null,
10276
+ "key": null,
10277
+ "creator": null,
10278
+ "createdTime": null,
10279
+ "updatedTime": null,
10280
+ "ref": null,
10281
+ "code": "xxx7",
10282
+ "name": "xxx7指标",
10283
+ "desc": null,
10284
+ "label": "",
10285
+ "isGoldMetric": true,
10286
+ "metricType": "capacity",
10287
+ "unit": "%",
10288
+ "dataType": "double",
10289
+ "dataRange": "0-100",
10290
+ "changeValue": "",
10291
+ "templateCode": "m.agg_link"
10197
10292
  }
10198
10293
  ]
10199
10294
  }
@@ -10054,7 +10054,7 @@
10054
10054
  "parent": null,
10055
10055
  "enable": true,
10056
10056
  "source": "system",
10057
- "displayName": "网络链路",
10057
+ "displayName": "xx链路",
10058
10058
  "vendor": null,
10059
10059
  "version": "v1.0",
10060
10060
  "category": "resources",
@@ -10194,6 +10194,101 @@
10194
10194
  "dataRange": "0-100",
10195
10195
  "changeValue": "",
10196
10196
  "templateCode": "m.agg_link"
10197
+ },
10198
+ {
10199
+ "id": null,
10200
+ "key": null,
10201
+ "creator": null,
10202
+ "createdTime": null,
10203
+ "updatedTime": null,
10204
+ "ref": null,
10205
+ "code": "xxx3",
10206
+ "name": "xxx3指标",
10207
+ "desc": null,
10208
+ "label": "",
10209
+ "isGoldMetric": true,
10210
+ "metricType": "capacity",
10211
+ "unit": "%",
10212
+ "dataType": "double",
10213
+ "dataRange": "0-100",
10214
+ "changeValue": "",
10215
+ "templateCode": "m.agg_link"
10216
+ },
10217
+ {
10218
+ "id": null,
10219
+ "key": null,
10220
+ "creator": null,
10221
+ "createdTime": null,
10222
+ "updatedTime": null,
10223
+ "ref": null,
10224
+ "code": "xxx4",
10225
+ "name": "xxx4指标",
10226
+ "desc": null,
10227
+ "label": "",
10228
+ "isGoldMetric": true,
10229
+ "metricType": "capacity",
10230
+ "unit": "%",
10231
+ "dataType": "double",
10232
+ "dataRange": "0-100",
10233
+ "changeValue": "",
10234
+ "templateCode": "m.agg_link"
10235
+ },
10236
+ {
10237
+ "id": null,
10238
+ "key": null,
10239
+ "creator": null,
10240
+ "createdTime": null,
10241
+ "updatedTime": null,
10242
+ "ref": null,
10243
+ "code": "xxx5",
10244
+ "name": "xxx5指标",
10245
+ "desc": null,
10246
+ "label": "",
10247
+ "isGoldMetric": true,
10248
+ "metricType": "capacity",
10249
+ "unit": "%",
10250
+ "dataType": "double",
10251
+ "dataRange": "0-100",
10252
+ "changeValue": "",
10253
+ "templateCode": "m.agg_link"
10254
+ },
10255
+ {
10256
+ "id": null,
10257
+ "key": null,
10258
+ "creator": null,
10259
+ "createdTime": null,
10260
+ "updatedTime": null,
10261
+ "ref": null,
10262
+ "code": "xxx6",
10263
+ "name": "xxx6指标",
10264
+ "desc": null,
10265
+ "label": "",
10266
+ "isGoldMetric": true,
10267
+ "metricType": "capacity",
10268
+ "unit": "%",
10269
+ "dataType": "double",
10270
+ "dataRange": "0-100",
10271
+ "changeValue": "",
10272
+ "templateCode": "m.agg_link"
10273
+ },
10274
+ {
10275
+ "id": null,
10276
+ "key": null,
10277
+ "creator": null,
10278
+ "createdTime": null,
10279
+ "updatedTime": null,
10280
+ "ref": null,
10281
+ "code": "xxx7",
10282
+ "name": "xxx7指标",
10283
+ "desc": null,
10284
+ "label": "",
10285
+ "isGoldMetric": true,
10286
+ "metricType": "capacity",
10287
+ "unit": "%",
10288
+ "dataType": "double",
10289
+ "dataRange": "0-100",
10290
+ "changeValue": "",
10291
+ "templateCode": "m.agg_link"
10197
10292
  }
10198
10293
  ]
10199
10294
  }
@@ -76,6 +76,7 @@ var BatchAttrMetricDrawer = /*#__PURE__*/forwardRef(function (_ref, ref) {
76
76
  }
77
77
  })));
78
78
  });
79
+ BatchAttrMetricDrawer.displayName = 'BatchAttrMetricDrawer';
79
80
  BatchAttrMetricDrawer.propTypes = {
80
81
  // 数据项
81
82
  allCiSet: PropTypes.any.isRequired,
@@ -6,6 +6,25 @@ var groupDefaultIcons = [{
6
6
  name: '区域',
7
7
  url: '/img/topo/citype-icons/区域_平面.svg'
8
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
+ }
9
28
  /**
10
29
  * 获取默认图标
11
30
  * @param {*} topo
@@ -13,12 +32,7 @@ var groupDefaultIcons = [{
13
32
  */
14
33
 
15
34
  export function getNodeDefaultIcons(topo) {
16
- var networkTopoCiTypeIcons = getNetworkTopoCiTypeIcons().filter(function (icon) {
17
- return !DEFAULT_NODE_ICONS.filter(function (defaultIcon) {
18
- return defaultIcon.id === icon.id;
19
- }).length;
20
- });
21
- return [].concat(DEFAULT_NODE_ICONS, networkTopoCiTypeIcons, topo.options.icons || []);
35
+ return [].concat(getSystemIcons(), topo.options.icons || []);
22
36
  }
23
37
  export function getGroupDefaultIcons(topo) {
24
38
  return [].concat(groupDefaultIcons, getNodeDefaultIcons(topo));
@@ -1,4 +1,4 @@
1
-
1
+ @import "@alifd/next/variables";
2
2
 
3
3
  .contaienr {
4
4
  padding: 16px 12px;
@@ -9,11 +9,11 @@
9
9
  margin: -8px;
10
10
 
11
11
  :global {
12
- .next-checkbox-group.next-checkbox-group-hoz {
12
+ .#{$css-prefix}checkbox-group.next-checkbox-group-hoz {
13
13
  display: flex;
14
14
  flex-flow: row wrap;
15
15
 
16
- .next-checkbox-wrapper {
16
+ .#{$css-prefix}checkbox-wrapper {
17
17
  margin-left: 8px;
18
18
  margin-right: 8px;
19
19
  }
@@ -119,4 +119,5 @@ var ResourceDiplayInfoSetting = /*#__PURE__*/forwardRef(function (props, ref) {
119
119
  saveCb: saveMarkSetting
120
120
  }));
121
121
  });
122
+ ResourceDiplayInfoSetting.displayName = 'ResourceDiplayInfoSetting';
122
123
  export default ResourceDiplayInfoSetting;
@@ -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.10" === 'string' ? "3.1.10" : null;
23
+ var version = typeof "3.1.13" === 'string' ? "3.1.13" : null;
24
24
  console.info("\u62D3\u6251\u7248\u672C: " + version);
25
25
  /**
26
26
  * 拓扑显示和编辑
@@ -12,6 +12,7 @@ import PropTypes from 'prop-types';
12
12
  import service from "../../../../services/overview";
13
13
  import ResourceOverview from "./components/ResourceOverview";
14
14
  import styles from "./index.module.scss";
15
+ import rlog from '@riil-frontend/component-topology-utils/es/rlog';
15
16
 
16
17
  function Title(_ref) {
17
18
  var id = _ref.id,
@@ -197,11 +198,11 @@ function ResourceDetail(props) {
197
198
  type = data.type,
198
199
  ciType = data.ciType,
199
200
  ciName = data.ciName,
200
- operation = data.operation; // 仅展示资源和链路的概览
201
-
202
- if (!['node', 'link', 'linkGroup'].includes(type)) return; // 没有权限不显示
203
-
204
- if (!operation) return;
201
+ operation = data.operation;
202
+ if ( // 仅展示资源和链路的概览
203
+ !['node', 'link', 'linkGroup'].includes(type) || // 没有权限不显示
204
+ !operation || // 没有citype不显示
205
+ !ciType) return;
205
206
  var htElement = topo.getDataModel().getDataByTag(id);
206
207
 
207
208
  if (!canShow(htElement)) {
@@ -242,6 +243,10 @@ function ResourceDetail(props) {
242
243
  ciTypeMeta = topo.ciTyeCache.getCiType(ciType);
243
244
  }
244
245
 
246
+ if (!ciTypeMeta) {
247
+ return;
248
+ }
249
+
245
250
  var _ciTypeMeta = ciTypeMeta,
246
251
  metrics = _ciTypeMeta.metrics; // 同步需要实时展示的指标
247
252
 
@@ -5,6 +5,12 @@ import ResourceDetail from "./ResourceDetail";
5
5
  function ResourceDetailPlugin(props) {
6
6
  var viewerProps = props.viewerProps;
7
7
  var resourceDetailProps = viewerProps === null || viewerProps === void 0 ? void 0 : viewerProps.resourceDetailProps;
8
+ var hideResourceDetailDrawer = (viewerProps === null || viewerProps === void 0 ? void 0 : viewerProps.hideResourceDetailDrawer) === true;
9
+
10
+ if (hideResourceDetailDrawer) {
11
+ return null;
12
+ }
13
+
8
14
  return /*#__PURE__*/React.createElement(ResourceDetail, _extends({}, props, resourceDetailProps));
9
15
  }
10
16