@riil-frontend/component-topology 4.0.0-beta.21 → 4.0.0-beta.24
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/1.js +2 -2
- package/build/2.js +1 -1
- package/build/index.css +1 -1
- package/build/index.js +20 -20
- package/es/constants/ResourceInfoDisplay.js +1 -4
- package/es/core/components/AlarmListPanel/components/AlarmListItem.js +5 -4
- package/es/core/components/DisplaySettingDrawer/ResourceDisplay/BasicConfig.js +3 -1
- package/es/core/editor/components/settings/propertyViews/multipleElements/BatchSetNodeIcon.js +21 -0
- package/es/core/editor/components/settings/propertyViews/multipleElements/MultipleElementPropertyView.js +5 -0
- package/es/core/models/AttributeMetricDisplay.js +24 -10
- package/es/core/models/TopoApp.js +1 -1
- package/es/core/models/attributeFormatter/index.js +2 -26
- package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/BaseInfoBlock.js +13 -3
- package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/ResourceOverview.js +5 -3
- package/es/topoCenter/components/TopoView.js +2 -1
- package/es/topoCenter/components/viewer/displaySetting/LinkTagCommonRidioGroup.js +23 -0
- package/es/topoCenter/components/viewer/displaySetting/LinkTagCommonRidioGroup.module.scss +23 -0
- package/es/topoCenter/components/viewer/displaySetting/LinkTagV2.js +85 -0
- package/es/topoCenter/models/TopoCenter.js +2 -2
- package/lib/constants/ResourceInfoDisplay.js +1 -4
- package/lib/core/components/AlarmListPanel/components/AlarmListItem.js +5 -4
- package/lib/core/components/DisplaySettingDrawer/ResourceDisplay/BasicConfig.js +3 -1
- package/lib/core/editor/components/settings/propertyViews/multipleElements/BatchSetNodeIcon.js +31 -0
- package/lib/core/editor/components/settings/propertyViews/multipleElements/MultipleElementPropertyView.js +6 -0
- package/lib/core/models/AttributeMetricDisplay.js +24 -10
- package/lib/core/models/TopoApp.js +1 -1
- package/lib/core/models/attributeFormatter/index.js +2 -26
- package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/BaseInfoBlock.js +13 -3
- package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/ResourceOverview.js +5 -3
- package/lib/topoCenter/components/TopoView.js +3 -1
- package/lib/topoCenter/components/viewer/displaySetting/LinkTagCommonRidioGroup.js +34 -0
- package/lib/topoCenter/components/viewer/displaySetting/LinkTagCommonRidioGroup.module.scss +23 -0
- package/lib/topoCenter/components/viewer/displaySetting/LinkTagV2.js +100 -0
- package/lib/topoCenter/models/TopoCenter.js +2 -2
- package/package.json +3 -3
|
@@ -10,10 +10,6 @@ var alarmLink = function alarmLink(alarmInfo) {
|
|
|
10
10
|
return "/default/pagecenter/" + PAGE_TYPE.ALERT_DETAIL + "/view/" + alarmInfo.alertId + "?alertId=" + alarmInfo.alertId + "&resId=" + alarmInfo.ciId + "&title=" + alarmInfo.alertObject + "&ruleId=" + alarmInfo.ruleId + "&ciCode=" + alarmInfo.ciTypeCode + "&ciType=" + alarmInfo.ciType;
|
|
11
11
|
};
|
|
12
12
|
|
|
13
|
-
var riskLink = function riskLink(item) {
|
|
14
|
-
return "/default/inspectionTaskList/inspectionReport?title=" + item.ciName + "&reportId=" + item.executeId + "&reportTime=" + item.executeTime + "&reportType=" + item.viewType + "&reportName=" + item.ciName;
|
|
15
|
-
};
|
|
16
|
-
|
|
17
13
|
function AlarmListItem(props) {
|
|
18
14
|
// 传入参数
|
|
19
15
|
var topo = props.topo,
|
|
@@ -38,6 +34,11 @@ function RiskListItem(props) {
|
|
|
38
34
|
var topo = props.topo,
|
|
39
35
|
alarmInfo = props.alarmInfo,
|
|
40
36
|
onClick = props.onClick;
|
|
37
|
+
|
|
38
|
+
var riskLink = function riskLink(item) {
|
|
39
|
+
return "/default/inspectionTaskList/inspectionReport?title=" + item.ciName + "&reportId=" + item.executeId + "&reportTime=" + item.executeTime + "&reportType=" + item.viewType + "&reportName=" + item.reportName;
|
|
40
|
+
};
|
|
41
|
+
|
|
41
42
|
return /*#__PURE__*/React.createElement(_List.Item, {
|
|
42
43
|
className: styles.AlarmListItem,
|
|
43
44
|
media: /*#__PURE__*/React.createElement(_Icon, {
|
|
@@ -21,6 +21,7 @@ function BasicConfig(props, ref) {
|
|
|
21
21
|
value = props.value,
|
|
22
22
|
commonOptions = props.commonOptions,
|
|
23
23
|
defaultCommonConfig = props.defaultCommonConfig,
|
|
24
|
+
commonSelectWidget = props.commonSelectWidget,
|
|
24
25
|
limit = props.limit,
|
|
25
26
|
elementType = props.elementType,
|
|
26
27
|
showType = props.showType,
|
|
@@ -78,6 +79,7 @@ function BasicConfig(props, ref) {
|
|
|
78
79
|
});
|
|
79
80
|
};
|
|
80
81
|
|
|
82
|
+
var CommonSelectWidget = commonSelectWidget || CommonCheckboxGroup;
|
|
81
83
|
return /*#__PURE__*/React.createElement(_Box, {
|
|
82
84
|
spacing: 8,
|
|
83
85
|
direction: "column"
|
|
@@ -96,7 +98,7 @@ function BasicConfig(props, ref) {
|
|
|
96
98
|
type: "primary",
|
|
97
99
|
text: true,
|
|
98
100
|
onClick: openSetting
|
|
99
|
-
}, showType === 'tag' ? '选择图数据' : '选择Tooltip数据'), renderCustomSettingDrawer())), !isCustom && /*#__PURE__*/React.createElement(
|
|
101
|
+
}, showType === 'tag' ? '选择图数据' : '选择Tooltip数据'), renderCustomSettingDrawer())), !isCustom && /*#__PURE__*/React.createElement(CommonSelectWidget, {
|
|
100
102
|
value: data,
|
|
101
103
|
dataSource: commonOptions,
|
|
102
104
|
limit: limit,
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { isGroup, isNode } from "../../../../../../utils/htElementUtils";
|
|
3
|
+
import NodeIconSelect from "../node/NodeIconSelect";
|
|
4
|
+
export default function BatchSetNodeIcon(props) {
|
|
5
|
+
var topo = props.topo;
|
|
6
|
+
|
|
7
|
+
var setNodeIcon = function setNodeIcon(iconId) {
|
|
8
|
+
var selection = topo.getSelectionModel().getSelection().toArray();
|
|
9
|
+
var nodes = selection.filter(function (element) {
|
|
10
|
+
return isNode(element) && !isGroup(element);
|
|
11
|
+
});
|
|
12
|
+
nodes.forEach(function (node) {
|
|
13
|
+
node.setImage(iconId);
|
|
14
|
+
});
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
return /*#__PURE__*/React.createElement(NodeIconSelect, {
|
|
18
|
+
topo: topo,
|
|
19
|
+
onChange: setNodeIcon
|
|
20
|
+
});
|
|
21
|
+
}
|
|
@@ -7,6 +7,7 @@ import BatchSetNodeSize from "./BatchSetNodeSize/BatchSetNodeSize";
|
|
|
7
7
|
import { TPL_TREE } from "../../../../../../utils/template";
|
|
8
8
|
import ViewPropertyView from "../view/ViewPropertyView";
|
|
9
9
|
import MultipleElementLineType from "./MultipleElementLineType";
|
|
10
|
+
import BatchSetNodeIcon from "./BatchSetNodeIcon";
|
|
10
11
|
var CollapsePanel = _Collapse.Panel;
|
|
11
12
|
/**
|
|
12
13
|
* 多选元素属性面板
|
|
@@ -60,6 +61,10 @@ export default function MultipleElementPropertyView(props) {
|
|
|
60
61
|
key: "\u56FE\u7247",
|
|
61
62
|
title: "\u56FE\u7247"
|
|
62
63
|
}, /*#__PURE__*/React.createElement(_Form.Item, {
|
|
64
|
+
label: "\u663E\u793A\u56FE\u7247"
|
|
65
|
+
}, /*#__PURE__*/React.createElement(BatchSetNodeIcon, {
|
|
66
|
+
topo: topo
|
|
67
|
+
})), /*#__PURE__*/React.createElement(_Form.Item, {
|
|
63
68
|
label: "\u56FE\u7247\u5C3A\u5BF8",
|
|
64
69
|
style: {
|
|
65
70
|
marginBottom: 0
|
|
@@ -114,10 +114,6 @@ var AttributeMetricDisplay = /*#__PURE__*/function () {
|
|
|
114
114
|
return _extends({}, link, {
|
|
115
115
|
type: 'edge'
|
|
116
116
|
});
|
|
117
|
-
}), linkGroups.map(function (link) {
|
|
118
|
-
return _extends({}, link, {
|
|
119
|
-
type: 'edgeGroup'
|
|
120
|
-
});
|
|
121
117
|
}));
|
|
122
118
|
};
|
|
123
119
|
|
|
@@ -241,8 +237,14 @@ var AttributeMetricDisplay = /*#__PURE__*/function () {
|
|
|
241
237
|
var tagTipOptions = this.topo.options.tagTip;
|
|
242
238
|
var defaultLinkTagConfig = tagTipOptions !== null && tagTipOptions !== void 0 && tagTipOptions.getDefaultLinkTagConfig ? tagTipOptions === null || tagTipOptions === void 0 ? void 0 : tagTipOptions.getDefaultLinkTagConfig(link) : null;
|
|
243
239
|
var defaultLinkTipConfig = tagTipOptions !== null && tagTipOptions !== void 0 && tagTipOptions.getDefaultLinkTipConfig ? tagTipOptions === null || tagTipOptions === void 0 ? void 0 : tagTipOptions.getDefaultLinkTipConfig(link) : null;
|
|
240
|
+
var linkTagConfig = linkTag || defaultLinkTagConfig;
|
|
244
241
|
return {
|
|
245
|
-
tags: getItems(
|
|
242
|
+
tags: getItems(linkTagConfig),
|
|
243
|
+
tagLinkArrow: {
|
|
244
|
+
1: 'both',
|
|
245
|
+
2: 'from',
|
|
246
|
+
3: 'to'
|
|
247
|
+
}[linkTagConfig === null || linkTagConfig === void 0 ? void 0 : linkTagConfig.type] || undefined,
|
|
246
248
|
tips: getItems(linkTip || defaultLinkTipConfig)
|
|
247
249
|
};
|
|
248
250
|
};
|
|
@@ -255,13 +257,14 @@ var AttributeMetricDisplay = /*#__PURE__*/function () {
|
|
|
255
257
|
|
|
256
258
|
var tagTipConfig = _this2.getLinkTagTipConfig(link);
|
|
257
259
|
|
|
258
|
-
return {
|
|
260
|
+
return _extends({
|
|
259
261
|
type: link.type,
|
|
260
262
|
id: link.id,
|
|
261
|
-
ciType: ciType
|
|
263
|
+
ciType: ciType
|
|
264
|
+
}, tagTipConfig, {
|
|
262
265
|
tags: filterByPermission(link, tagTipConfig.tags),
|
|
263
266
|
tips: filterByPermission(link, tagTipConfig.tips)
|
|
264
|
-
};
|
|
267
|
+
});
|
|
265
268
|
});
|
|
266
269
|
}
|
|
267
270
|
/**
|
|
@@ -700,9 +703,10 @@ var AttributeMetricDisplay = /*#__PURE__*/function () {
|
|
|
700
703
|
;
|
|
701
704
|
|
|
702
705
|
_proto.buildTagsTips = function buildTagsTips() {
|
|
706
|
+
var _this6 = this;
|
|
707
|
+
|
|
703
708
|
var data = this.getData(); // 获取标注、悬浮框配置
|
|
704
709
|
|
|
705
|
-
var formatter = new AttributeFormatter(this.topo);
|
|
706
710
|
var ciConfigs = this.getResourceTagTipConfig();
|
|
707
711
|
var ciTagsAndTips = ciConfigs.map(function (ciConfig) {
|
|
708
712
|
var ciDataItem = findItem(data, 'id', ciConfig.id);
|
|
@@ -720,10 +724,20 @@ var AttributeMetricDisplay = /*#__PURE__*/function () {
|
|
|
720
724
|
ciType: ciConfig.ciType
|
|
721
725
|
});
|
|
722
726
|
|
|
727
|
+
var formatter = new AttributeFormatter(_this6.topo);
|
|
728
|
+
var tags = formatter.formatAttrs(ciConfig.tags, ciData); // 链路标注箭头
|
|
729
|
+
|
|
730
|
+
if (ciConfig.type === 'edge') {
|
|
731
|
+
tags = {
|
|
732
|
+
data: tags,
|
|
733
|
+
linkArrow: ciConfig.tagLinkArrow
|
|
734
|
+
};
|
|
735
|
+
}
|
|
736
|
+
|
|
723
737
|
return {
|
|
724
738
|
type: ciConfig.type,
|
|
725
739
|
id: ciConfig.id,
|
|
726
|
-
tags:
|
|
740
|
+
tags: tags,
|
|
727
741
|
tips: formatter.formatAttrs(ciConfig.tips, ciData)
|
|
728
742
|
};
|
|
729
743
|
});
|
|
@@ -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 "4.0.0-beta.
|
|
23
|
+
var version = typeof "4.0.0-beta.24" === 'string' ? "4.0.0-beta.24" : null;
|
|
24
24
|
console.info("\u62D3\u6251\u7248\u672C: " + version);
|
|
25
25
|
/**
|
|
26
26
|
* 拓扑显示和编辑
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import _extends from "@babel/runtime/helpers/extends";
|
|
2
1
|
import rlog from '@riil-frontend/component-topology-utils/es/rlog';
|
|
3
2
|
import { metricValueFormat } from '@riil-frontend/utils';
|
|
4
3
|
import { findItem } from "../../../utils/topoData";
|
|
@@ -25,33 +24,10 @@ export function formatMetric(val, metricInfo) {
|
|
|
25
24
|
return "" + val;
|
|
26
25
|
}
|
|
27
26
|
}
|
|
28
|
-
|
|
29
|
-
function addLinkMetricUnderlineArrow(metricCode) {
|
|
30
|
-
var map = {
|
|
31
|
-
// 总流速和总带宽利用率:双向箭头
|
|
32
|
-
'interface_totalbps': 'both',
|
|
33
|
-
'bandwidth_utilization': 'both',
|
|
34
|
-
// 发送速率和发送带宽利用率:背向取值端口的箭头 指向目的
|
|
35
|
-
'out_rate': 'to',
|
|
36
|
-
'out_bandwidth_utilization': 'to',
|
|
37
|
-
// 接收速率和接收带宽利用率:指向取值端口的箭头 指向源
|
|
38
|
-
'in_rate': 'from',
|
|
39
|
-
'in_bandwidth_utilization': 'from'
|
|
40
|
-
};
|
|
41
|
-
|
|
42
|
-
if (map[metricCode]) {
|
|
43
|
-
return {
|
|
44
|
-
underlineArrow: map[metricCode]
|
|
45
|
-
};
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
return {};
|
|
49
|
-
}
|
|
50
27
|
/**
|
|
51
28
|
* 标注值格式化
|
|
52
29
|
*/
|
|
53
30
|
|
|
54
|
-
|
|
55
31
|
var AttributeFormatter = /*#__PURE__*/function () {
|
|
56
32
|
function AttributeFormatter(topo) {
|
|
57
33
|
this.topo = topo;
|
|
@@ -88,7 +64,7 @@ var AttributeFormatter = /*#__PURE__*/function () {
|
|
|
88
64
|
fieldValue = ciData[attrType + "Map"][fieldCode + "_object"].displayName;
|
|
89
65
|
}
|
|
90
66
|
|
|
91
|
-
return
|
|
67
|
+
return {
|
|
92
68
|
type: item.type,
|
|
93
69
|
code: item.code,
|
|
94
70
|
// 属性code
|
|
@@ -97,7 +73,7 @@ var AttributeFormatter = /*#__PURE__*/function () {
|
|
|
97
73
|
value: formatMetric(fieldValue, fieldMeta),
|
|
98
74
|
// 属性值
|
|
99
75
|
originValue: fieldValue
|
|
100
|
-
}
|
|
76
|
+
};
|
|
101
77
|
};
|
|
102
78
|
|
|
103
79
|
_proto.attributeTransform = function attributeTransform(item, ciData) {
|
|
@@ -10,18 +10,28 @@ export default function BaseInfoBlock(props) {
|
|
|
10
10
|
ciTypeMeta = props.ciTypeMeta,
|
|
11
11
|
headerExtra = props.headerExtra,
|
|
12
12
|
renderContent = props.renderContent,
|
|
13
|
-
baseInfo = props.baseInfo
|
|
13
|
+
baseInfo = props.baseInfo,
|
|
14
|
+
isAppTopo = props.isAppTopo;
|
|
14
15
|
var id = data.id,
|
|
15
16
|
ciType = data.ciType,
|
|
16
17
|
type = data.type,
|
|
17
18
|
name = data.name;
|
|
19
|
+
console.log('111 data', data);
|
|
18
20
|
return /*#__PURE__*/React.createElement(BlockBox, {
|
|
19
21
|
headerTitle: "\u57FA\u672C\u4FE1\u606F",
|
|
20
|
-
headerExtra:
|
|
22
|
+
headerExtra: /*#__PURE__*/React.createElement("div", {
|
|
23
|
+
style: {
|
|
24
|
+
display: 'flex'
|
|
25
|
+
}
|
|
26
|
+
}, !isAppTopo && ciType === 'network_link' ? /*#__PURE__*/React.createElement("div", {
|
|
27
|
+
style: {
|
|
28
|
+
lineHeight: '28px'
|
|
29
|
+
}
|
|
30
|
+
}, /*#__PURE__*/React.createElement(SingleResourceStrategyLink, {
|
|
21
31
|
id: id,
|
|
22
32
|
ciType: ciType,
|
|
23
33
|
name: name
|
|
24
|
-
})
|
|
34
|
+
})) : '', headerExtra ? headerExtra(props) : '')
|
|
25
35
|
}, loading ? /*#__PURE__*/React.createElement(_Loading, {
|
|
26
36
|
style: {
|
|
27
37
|
width: '100%',
|
|
@@ -47,7 +47,7 @@ function formatUrl(url) {
|
|
|
47
47
|
|
|
48
48
|
|
|
49
49
|
export default function ResourceOverview(props) {
|
|
50
|
-
var _viewerProps$resource, _data$attributes
|
|
50
|
+
var _viewerProps$resource, _data$attributes;
|
|
51
51
|
|
|
52
52
|
var topo = props.topo,
|
|
53
53
|
id = props.id,
|
|
@@ -393,7 +393,7 @@ export default function ResourceOverview(props) {
|
|
|
393
393
|
icon: 'Overall_risk_full',
|
|
394
394
|
className: 'risk-icon',
|
|
395
395
|
title: "" + item.ciName + item.itemName,
|
|
396
|
-
link: "/default/inspectionTaskList/inspectionReport?title=" + item.ciName + "&reportId=" + item.executeId + "&reportTime=" + item.executeTime + "&reportType=" + item.viewType + "&reportName=" + item.
|
|
396
|
+
link: "/default/inspectionTaskList/inspectionReport?title=" + item.ciName + "&reportId=" + item.executeId + "&reportTime=" + item.executeTime + "&reportType=" + item.viewType + "&reportName=" + item.reportName,
|
|
397
397
|
time: item.firstFoundTime
|
|
398
398
|
};
|
|
399
399
|
}); // console.log('告警和风险', alarmList, riskList);
|
|
@@ -508,7 +508,8 @@ export default function ResourceOverview(props) {
|
|
|
508
508
|
id: id,
|
|
509
509
|
ciType: ciType,
|
|
510
510
|
type: type,
|
|
511
|
-
name:
|
|
511
|
+
// name: '123'
|
|
512
|
+
name: props.name
|
|
512
513
|
}; // 基本信息设置改变
|
|
513
514
|
|
|
514
515
|
function baseInfoColChange(_x5) {
|
|
@@ -807,6 +808,7 @@ export default function ResourceOverview(props) {
|
|
|
807
808
|
data: elementData,
|
|
808
809
|
ciTypeMeta: ciTypeMeta,
|
|
809
810
|
baseInfo: baseInfo,
|
|
811
|
+
isAppTopo: isAppTopo,
|
|
810
812
|
headerExtra: function headerExtra(p) {
|
|
811
813
|
var _resourceOverviewProp3;
|
|
812
814
|
|
|
@@ -17,6 +17,7 @@ import LinkTag from "../../core/components/DisplaySettingDrawer/LinkTag";
|
|
|
17
17
|
import LinkTip from "../../core/components/DisplaySettingDrawer/LinkTip";
|
|
18
18
|
import ViewerTools from "./viewer/titlebar/ViewerTools";
|
|
19
19
|
import useEdgeFlow from "../hooks/viewer/useEdgeFlow";
|
|
20
|
+
import LinkTagV2 from "./viewer/displaySetting/LinkTagV2";
|
|
20
21
|
/**
|
|
21
22
|
* 拓扑组件。变化无权限、无数据显示
|
|
22
23
|
*/
|
|
@@ -111,7 +112,7 @@ function NetworkTopologyCore(props) {
|
|
|
111
112
|
showLinkConfig: true,
|
|
112
113
|
// 是否显示链路流动效果配置
|
|
113
114
|
linkTagConfig: function linkTagConfig(params) {
|
|
114
|
-
return /*#__PURE__*/React.createElement(
|
|
115
|
+
return /*#__PURE__*/React.createElement(LinkTagV2, params);
|
|
115
116
|
},
|
|
116
117
|
linkTipConfig: function linkTipConfig(params) {
|
|
117
118
|
return /*#__PURE__*/React.createElement(LinkTip, params);
|
|
@@ -0,0 +1,23 @@
|
|
|
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 : undefined,
|
|
15
|
+
itemDirection: "ver",
|
|
16
|
+
onChange: onChange
|
|
17
|
+
}, dataSource.map(function (item) {
|
|
18
|
+
return /*#__PURE__*/React.createElement(_Radio, {
|
|
19
|
+
value: item.value
|
|
20
|
+
}, item.label);
|
|
21
|
+
}))));
|
|
22
|
+
}
|
|
23
|
+
;
|
|
@@ -0,0 +1,23 @@
|
|
|
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
|
+
}
|
|
@@ -0,0 +1,85 @@
|
|
|
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 ResourceDiplayInfoSetting from "../../../../core/components/ResourceViewAttributeSetting/Setting";
|
|
6
|
+
import LinkTagCommonRidioGroup from "./LinkTagCommonRidioGroup"; // 默认中可配置内容包括总速率、带宽利用率、发送速率、发送带宽利用率、接收速率、接收带宽利用率
|
|
7
|
+
|
|
8
|
+
var CommonOptions = [{
|
|
9
|
+
value: '1',
|
|
10
|
+
label: '总流速、带宽利用率',
|
|
11
|
+
options: {
|
|
12
|
+
data: ['metric:interface_totalbps', 'metric:bandwidth_utilization']
|
|
13
|
+
}
|
|
14
|
+
}, {
|
|
15
|
+
value: '2',
|
|
16
|
+
label: '发送速率、发送带宽利用率',
|
|
17
|
+
options: {
|
|
18
|
+
data: ['metric:out_rate', 'metric:out_bandwidth_utilization']
|
|
19
|
+
}
|
|
20
|
+
}, {
|
|
21
|
+
value: '3',
|
|
22
|
+
label: '接收速率、接收带宽利用率',
|
|
23
|
+
options: {
|
|
24
|
+
data: ['metric:in_rate', 'metric:in_bandwidth_utilization']
|
|
25
|
+
}
|
|
26
|
+
}];
|
|
27
|
+
|
|
28
|
+
var buildConfig = function buildConfig(item) {
|
|
29
|
+
return {
|
|
30
|
+
type: item.split(':')[0],
|
|
31
|
+
code: item.split(':')[1]
|
|
32
|
+
};
|
|
33
|
+
};
|
|
34
|
+
/**
|
|
35
|
+
* 资源标注配置
|
|
36
|
+
* @param {*} props
|
|
37
|
+
* @returns
|
|
38
|
+
*/
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
function LinkTagV2(props, ref) {
|
|
42
|
+
var value = props.value,
|
|
43
|
+
onChange = props.onChange;
|
|
44
|
+
|
|
45
|
+
var handleChange = function handleChange(newValue) {
|
|
46
|
+
console.error(111, newValue);
|
|
47
|
+
|
|
48
|
+
if (!newValue.isCustom) {
|
|
49
|
+
var _CommonOptions$find;
|
|
50
|
+
|
|
51
|
+
var type = newValue.data;
|
|
52
|
+
var config = ((_CommonOptions$find = CommonOptions.find(function (item) {
|
|
53
|
+
return item.value === type;
|
|
54
|
+
})) === null || _CommonOptions$find === void 0 ? void 0 : _CommonOptions$find.options) || {
|
|
55
|
+
data: []
|
|
56
|
+
};
|
|
57
|
+
onChange(_extends({}, newValue, config, {
|
|
58
|
+
data: config.data.map(buildConfig),
|
|
59
|
+
type: type
|
|
60
|
+
}));
|
|
61
|
+
} else {
|
|
62
|
+
onChange(newValue);
|
|
63
|
+
}
|
|
64
|
+
};
|
|
65
|
+
|
|
66
|
+
return /*#__PURE__*/React.createElement(BasicConfig, _extends({
|
|
67
|
+
ref: ref
|
|
68
|
+
}, props, {
|
|
69
|
+
value: value ? _extends({}, value, {
|
|
70
|
+
data: value.type
|
|
71
|
+
}) : value,
|
|
72
|
+
limit: 1,
|
|
73
|
+
elementType: "link",
|
|
74
|
+
showType: "tag",
|
|
75
|
+
commonOptions: CommonOptions,
|
|
76
|
+
defaultCommonConfig: DEFAULT_LINK_TAG_COMMON_CONFIG,
|
|
77
|
+
commonSelectWidget: LinkTagCommonRidioGroup,
|
|
78
|
+
customSettingDrawer: function customSettingDrawer(params) {
|
|
79
|
+
return /*#__PURE__*/React.createElement(ResourceDiplayInfoSetting, params);
|
|
80
|
+
},
|
|
81
|
+
onChange: handleChange
|
|
82
|
+
}));
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
export default /*#__PURE__*/React.forwardRef(LinkTagV2);
|
|
@@ -29,8 +29,8 @@ var TopoCenter = /*#__PURE__*/function (_TopoApp) {
|
|
|
29
29
|
},
|
|
30
30
|
getDefaultLinkTipConfig: function getDefaultLinkTipConfig() {
|
|
31
31
|
return DEFAULT_TIP_COMMON_CONFIG;
|
|
32
|
-
},
|
|
33
|
-
|
|
32
|
+
} // ExtElementTagTipBuilder: LinkTagsTipsBuilder,
|
|
33
|
+
|
|
34
34
|
},
|
|
35
35
|
onSwitchToEditModeBegin: function () {
|
|
36
36
|
var _onSwitchToEditModeBegin = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(topo) {
|
|
@@ -63,9 +63,6 @@ var NODE_TIP_DEFAULT_CONFIG = {
|
|
|
63
63
|
exports.NODE_TIP_DEFAULT_CONFIG = NODE_TIP_DEFAULT_CONFIG;
|
|
64
64
|
var DEFAULT_LINK_TAG_COMMON_CONFIG = {
|
|
65
65
|
isCustom: false,
|
|
66
|
-
data: [
|
|
67
|
-
type: 'metric',
|
|
68
|
-
code: 'interface_totalbps'
|
|
69
|
-
}]
|
|
66
|
+
data: []
|
|
70
67
|
};
|
|
71
68
|
exports.DEFAULT_LINK_TAG_COMMON_CONFIG = DEFAULT_LINK_TAG_COMMON_CONFIG;
|
|
@@ -26,10 +26,6 @@ var alarmLink = function alarmLink(alarmInfo) {
|
|
|
26
26
|
return "/default/pagecenter/" + _uicbb.PAGE_TYPE.ALERT_DETAIL + "/view/" + alarmInfo.alertId + "?alertId=" + alarmInfo.alertId + "&resId=" + alarmInfo.ciId + "&title=" + alarmInfo.alertObject + "&ruleId=" + alarmInfo.ruleId + "&ciCode=" + alarmInfo.ciTypeCode + "&ciType=" + alarmInfo.ciType;
|
|
27
27
|
};
|
|
28
28
|
|
|
29
|
-
var riskLink = function riskLink(item) {
|
|
30
|
-
return "/default/inspectionTaskList/inspectionReport?title=" + item.ciName + "&reportId=" + item.executeId + "&reportTime=" + item.executeTime + "&reportType=" + item.viewType + "&reportName=" + item.ciName;
|
|
31
|
-
};
|
|
32
|
-
|
|
33
29
|
function AlarmListItem(props) {
|
|
34
30
|
// 传入参数
|
|
35
31
|
var topo = props.topo,
|
|
@@ -54,6 +50,11 @@ function RiskListItem(props) {
|
|
|
54
50
|
var topo = props.topo,
|
|
55
51
|
alarmInfo = props.alarmInfo,
|
|
56
52
|
onClick = props.onClick;
|
|
53
|
+
|
|
54
|
+
var riskLink = function riskLink(item) {
|
|
55
|
+
return "/default/inspectionTaskList/inspectionReport?title=" + item.ciName + "&reportId=" + item.executeId + "&reportTime=" + item.executeTime + "&reportType=" + item.viewType + "&reportName=" + item.reportName;
|
|
56
|
+
};
|
|
57
|
+
|
|
57
58
|
return /*#__PURE__*/_react["default"].createElement(_list["default"].Item, {
|
|
58
59
|
className: _indexModule["default"].AlarmListItem,
|
|
59
60
|
media: /*#__PURE__*/_react["default"].createElement(_icon["default"], {
|
|
@@ -40,6 +40,7 @@ function BasicConfig(props, ref) {
|
|
|
40
40
|
value = props.value,
|
|
41
41
|
commonOptions = props.commonOptions,
|
|
42
42
|
defaultCommonConfig = props.defaultCommonConfig,
|
|
43
|
+
commonSelectWidget = props.commonSelectWidget,
|
|
43
44
|
limit = props.limit,
|
|
44
45
|
elementType = props.elementType,
|
|
45
46
|
showType = props.showType,
|
|
@@ -99,6 +100,7 @@ function BasicConfig(props, ref) {
|
|
|
99
100
|
});
|
|
100
101
|
};
|
|
101
102
|
|
|
103
|
+
var CommonSelectWidget = commonSelectWidget || _CommonCheckboxGroup["default"];
|
|
102
104
|
return /*#__PURE__*/_react["default"].createElement(_box["default"], {
|
|
103
105
|
spacing: 8,
|
|
104
106
|
direction: "column"
|
|
@@ -117,7 +119,7 @@ function BasicConfig(props, ref) {
|
|
|
117
119
|
type: "primary",
|
|
118
120
|
text: true,
|
|
119
121
|
onClick: openSetting
|
|
120
|
-
}, showType === 'tag' ? '选择图数据' : '选择Tooltip数据'), renderCustomSettingDrawer())), !isCustom && /*#__PURE__*/_react["default"].createElement(
|
|
122
|
+
}, showType === 'tag' ? '选择图数据' : '选择Tooltip数据'), renderCustomSettingDrawer())), !isCustom && /*#__PURE__*/_react["default"].createElement(CommonSelectWidget, {
|
|
121
123
|
value: data,
|
|
122
124
|
dataSource: commonOptions,
|
|
123
125
|
limit: limit,
|
package/lib/core/editor/components/settings/propertyViews/multipleElements/BatchSetNodeIcon.js
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
|
|
5
|
+
exports.__esModule = true;
|
|
6
|
+
exports["default"] = BatchSetNodeIcon;
|
|
7
|
+
|
|
8
|
+
var _react = _interopRequireDefault(require("react"));
|
|
9
|
+
|
|
10
|
+
var _htElementUtils = require("../../../../../../utils/htElementUtils");
|
|
11
|
+
|
|
12
|
+
var _NodeIconSelect = _interopRequireDefault(require("../node/NodeIconSelect"));
|
|
13
|
+
|
|
14
|
+
function BatchSetNodeIcon(props) {
|
|
15
|
+
var topo = props.topo;
|
|
16
|
+
|
|
17
|
+
var setNodeIcon = function setNodeIcon(iconId) {
|
|
18
|
+
var selection = topo.getSelectionModel().getSelection().toArray();
|
|
19
|
+
var nodes = selection.filter(function (element) {
|
|
20
|
+
return (0, _htElementUtils.isNode)(element) && !(0, _htElementUtils.isGroup)(element);
|
|
21
|
+
});
|
|
22
|
+
nodes.forEach(function (node) {
|
|
23
|
+
node.setImage(iconId);
|
|
24
|
+
});
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
return /*#__PURE__*/_react["default"].createElement(_NodeIconSelect["default"], {
|
|
28
|
+
topo: topo,
|
|
29
|
+
onChange: setNodeIcon
|
|
30
|
+
});
|
|
31
|
+
}
|
|
@@ -23,6 +23,8 @@ var _ViewPropertyView = _interopRequireDefault(require("../view/ViewPropertyView
|
|
|
23
23
|
|
|
24
24
|
var _MultipleElementLineType = _interopRequireDefault(require("./MultipleElementLineType"));
|
|
25
25
|
|
|
26
|
+
var _BatchSetNodeIcon = _interopRequireDefault(require("./BatchSetNodeIcon"));
|
|
27
|
+
|
|
26
28
|
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); }
|
|
27
29
|
|
|
28
30
|
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; }
|
|
@@ -80,6 +82,10 @@ function MultipleElementPropertyView(props) {
|
|
|
80
82
|
key: "\u56FE\u7247",
|
|
81
83
|
title: "\u56FE\u7247"
|
|
82
84
|
}, /*#__PURE__*/_react["default"].createElement(_form["default"].Item, {
|
|
85
|
+
label: "\u663E\u793A\u56FE\u7247"
|
|
86
|
+
}, /*#__PURE__*/_react["default"].createElement(_BatchSetNodeIcon["default"], {
|
|
87
|
+
topo: topo
|
|
88
|
+
})), /*#__PURE__*/_react["default"].createElement(_form["default"].Item, {
|
|
83
89
|
label: "\u56FE\u7247\u5C3A\u5BF8",
|
|
84
90
|
style: {
|
|
85
91
|
marginBottom: 0
|