@riil-frontend/component-topology 3.1.5 → 3.1.8
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/CHANGELOG.md +4 -15
- package/build/1.js +1 -1
- package/build/index.css +1 -1
- package/build/index.js +11 -11
- package/demo/1/345/237/272/346/234/254//345/256/232/345/210/266/345/214/226/350/265/204/346/272/220/346/246/202/350/247/210.md +11 -0
- package/demo/1/345/237/272/346/234/254//350/207/252/345/256/232/344/271/211/346/240/207/346/263/250/345/222/214/346/202/254/346/265/256/346/241/206.md +11 -0
- 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 +2 -2
- package/demo-mock/basic/topo/v1/api/attributes/once +9164 -2796
- package/demo-mock/basic/topo/v1/api/attributes/once.json +9164 -2796
- package/es/core/components/DisplaySettingDrawer/DisplaySetting.js +4 -5
- package/es/core/components/DisplaySettingDrawer/DisplaySettingDrawer.js +2 -2
- package/es/core/components/DisplaySettingDrawer/hooks/useDisplaySetting.js +4 -4
- package/es/core/models/AttributeMetricDisplay.js +112 -98
- package/es/core/models/TopoApp.js +1 -1
- package/es/core/viewer/components/plugins/{BaseInfo/index.js → ResourceDetail/ResourceDetail.js} +23 -11
- package/es/core/viewer/components/plugins/ResourceDetail/ResourceDetailPlugin.js +11 -0
- package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/BaseInfo.js +131 -0
- package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/BaseInfoBlock.js +31 -0
- package/es/core/viewer/components/plugins/{BaseInfo → ResourceDetail}/components/ResourceOverview/BlockBox.js +0 -0
- package/es/core/viewer/components/plugins/{BaseInfo → ResourceDetail}/components/ResourceOverview/BlockBox.module.scss +0 -0
- package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/ResourceOverviewMetric.js +46 -0
- package/es/core/viewer/components/plugins/{BaseInfo → ResourceDetail}/components/ResourceOverview/SingleResourceStrategyLink.js +4 -2
- package/es/core/viewer/components/plugins/{BaseInfo → ResourceDetail}/components/ResourceOverview/index.js +70 -180
- package/es/core/viewer/components/plugins/{BaseInfo → ResourceDetail}/components/ResourceOverview/index.module.scss +0 -0
- package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/useCiAttrAndMetricData.js +12 -0
- package/es/core/viewer/components/plugins/ResourceDetail/index.js +2 -0
- package/es/core/viewer/components/plugins/ResourceDetail/index.module.scss +39 -30
- package/es/core/viewer/components/plugins/ViewerPlugin.js +2 -2
- package/es/core/viewer/components/titlebar/BasicTools.js +1 -1
- package/es/core/viewer/components/titlebar/widgets/SettingButton.js +3 -4
- package/es/core/viewer/components/titlebar/widgets/SettingButtonWidget.js +19 -0
- package/es/topoCenter/components/TopoView.js +3 -4
- package/es/topoCenter/models/TopoCenter.js +9 -5
- package/lib/core/components/DisplaySettingDrawer/DisplaySetting.js +4 -5
- package/lib/core/components/DisplaySettingDrawer/DisplaySettingDrawer.js +2 -2
- package/lib/core/components/DisplaySettingDrawer/hooks/useDisplaySetting.js +4 -4
- package/lib/core/models/AttributeMetricDisplay.js +111 -97
- package/lib/core/models/TopoApp.js +1 -1
- package/lib/core/viewer/components/plugins/{BaseInfo/index.js → ResourceDetail/ResourceDetail.js} +25 -12
- package/lib/core/viewer/components/plugins/ResourceDetail/ResourceDetailPlugin.js +21 -0
- package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/BaseInfo.js +141 -0
- package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/BaseInfoBlock.js +42 -0
- package/lib/core/viewer/components/plugins/{BaseInfo → ResourceDetail}/components/ResourceOverview/BlockBox.js +0 -0
- package/lib/core/viewer/components/plugins/{BaseInfo → ResourceDetail}/components/ResourceOverview/BlockBox.module.scss +0 -0
- package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/ResourceOverviewMetric.js +56 -0
- package/lib/core/viewer/components/plugins/{BaseInfo → ResourceDetail}/components/ResourceOverview/SingleResourceStrategyLink.js +4 -2
- package/lib/core/viewer/components/plugins/{BaseInfo → ResourceDetail}/components/ResourceOverview/index.js +73 -182
- package/lib/core/viewer/components/plugins/{BaseInfo → ResourceDetail}/components/ResourceOverview/index.module.scss +0 -0
- package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/useCiAttrAndMetricData.js +17 -0
- package/lib/core/viewer/components/plugins/ResourceDetail/index.js +11 -0
- package/lib/core/viewer/components/plugins/ResourceDetail/index.module.scss +39 -30
- package/lib/core/viewer/components/plugins/ViewerPlugin.js +2 -2
- package/lib/core/viewer/components/titlebar/BasicTools.js +2 -2
- package/lib/core/viewer/components/titlebar/widgets/SettingButton.js +2 -3
- package/lib/core/viewer/components/titlebar/widgets/SettingButtonWidget.js +28 -0
- package/lib/topoCenter/components/TopoView.js +3 -4
- package/lib/topoCenter/models/TopoCenter.js +9 -5
- package/package.json +2 -2
- package/demo/1/345/237/272/346/234/254//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 +0 -11
- package/es/core/viewer/components/plugins/BaseInfo/index.module.scss +0 -49
- package/es/core/viewer/components/plugins/ResourceDetail/ResourceDetailDrawerPlugin.js +0 -37
- package/es/core/viewer/components/plugins/ResourceDetail/topoDrawer.js +0 -147
- package/lib/core/viewer/components/plugins/BaseInfo/index.module.scss +0 -49
- package/lib/core/viewer/components/plugins/ResourceDetail/ResourceDetailDrawerPlugin.js +0 -50
- package/lib/core/viewer/components/plugins/ResourceDetail/topoDrawer.js +0 -167
|
@@ -1,24 +1,25 @@
|
|
|
1
1
|
import _Message from "@alifd/next/es/message";
|
|
2
|
-
import _extends from "@babel/runtime/helpers/extends";
|
|
3
2
|
import _Table from "@alifd/next/es/table";
|
|
3
|
+
import _extends from "@babel/runtime/helpers/extends";
|
|
4
4
|
import _Button from "@alifd/next/es/button";
|
|
5
5
|
import _Icon from "@alifd/next/es/icon";
|
|
6
6
|
import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
|
|
7
7
|
import _regeneratorRuntime from "@babel/runtime/regenerator";
|
|
8
|
-
import React, { useState, useEffect, useRef, useCallback } from 'react';
|
|
8
|
+
import React, { useState, useEffect, useRef, useCallback, useMemo } from 'react';
|
|
9
9
|
import { Link } from 'react-router-dom';
|
|
10
|
-
import { metricValueFormat } from '@riil-frontend/utils';
|
|
11
10
|
import moment from 'moment';
|
|
12
|
-
import { TopoEvent } from '@riil-frontend/component-topology-graph';
|
|
13
11
|
import topoService from '@riil-frontend/component-topology-common/es/services/topo';
|
|
14
12
|
import { findItem } from "../../../../../../../utils/topoData";
|
|
15
13
|
import service from "../../../../../../services/overview";
|
|
16
14
|
import alarmService from "../../../../../../services/alarm";
|
|
17
|
-
import DictCache from "../../../../../../models/cache/DictCache";
|
|
18
15
|
import { queryCisByIds } from "../../../../../../services";
|
|
19
16
|
import styles from "./index.module.scss";
|
|
20
17
|
import SingleResourceStrategyLink from "./SingleResourceStrategyLink";
|
|
21
|
-
import BlockBox from "./BlockBox";
|
|
18
|
+
import BlockBox from "./BlockBox";
|
|
19
|
+
import useCiAttrAndMetricData from "./useCiAttrAndMetricData";
|
|
20
|
+
import ResourceOverviewMetric from "./ResourceOverviewMetric";
|
|
21
|
+
import BaseInfo from "./BaseInfo";
|
|
22
|
+
import BaseInfoBlock from "./BaseInfoBlock"; // url 处理,UICBB 的地址需截取前缀
|
|
22
23
|
|
|
23
24
|
function formatUrl(url) {
|
|
24
25
|
var _window, _window$location;
|
|
@@ -30,127 +31,6 @@ function formatUrl(url) {
|
|
|
30
31
|
} else {
|
|
31
32
|
return url;
|
|
32
33
|
}
|
|
33
|
-
} // 基本信息
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
function BaseInfoRender(type, data) {
|
|
37
|
-
var _itemCols$type;
|
|
38
|
-
|
|
39
|
-
var itemCols = {
|
|
40
|
-
node: [{
|
|
41
|
-
label: '资源名称:',
|
|
42
|
-
objKey: 'resource',
|
|
43
|
-
render: function render(valueData, key) {
|
|
44
|
-
var display_name = valueData.display_name,
|
|
45
|
-
link = valueData.link;
|
|
46
|
-
return /*#__PURE__*/React.createElement("div", {
|
|
47
|
-
className: styles.item,
|
|
48
|
-
key: key
|
|
49
|
-
}, /*#__PURE__*/React.createElement("span", {
|
|
50
|
-
className: styles.label
|
|
51
|
-
}, "\u8D44\u6E90\u540D\u79F0\uFF1A"), /*#__PURE__*/React.createElement("span", {
|
|
52
|
-
className: styles.content,
|
|
53
|
-
title: display_name
|
|
54
|
-
}, valueData ? /*#__PURE__*/React.createElement(Link, {
|
|
55
|
-
className: styles.link,
|
|
56
|
-
to: formatUrl(link)
|
|
57
|
-
}, display_name) : '-'));
|
|
58
|
-
}
|
|
59
|
-
}, {
|
|
60
|
-
label: 'IP地址:',
|
|
61
|
-
objKey: 'ipv4_address'
|
|
62
|
-
}, {
|
|
63
|
-
label: '资产编号:',
|
|
64
|
-
objKey: 'asset_number'
|
|
65
|
-
}, {
|
|
66
|
-
label: '资源类型:',
|
|
67
|
-
objKey: 'ciName'
|
|
68
|
-
}, {
|
|
69
|
-
label: '资源位置:',
|
|
70
|
-
objKey: 'res_address'
|
|
71
|
-
} // {
|
|
72
|
-
// label: '负责人:',
|
|
73
|
-
// objKey: 'principal'
|
|
74
|
-
// },
|
|
75
|
-
],
|
|
76
|
-
link: [{
|
|
77
|
-
label: '链路带宽:',
|
|
78
|
-
objKey: 'rated_bandwidth',
|
|
79
|
-
style: {
|
|
80
|
-
width: '100%'
|
|
81
|
-
}
|
|
82
|
-
}, {
|
|
83
|
-
label: '源IP地址:',
|
|
84
|
-
objKey: 'source_ipv4'
|
|
85
|
-
}, {
|
|
86
|
-
label: '目的IP地址:',
|
|
87
|
-
objKey: 'destination_ipv4'
|
|
88
|
-
}, {
|
|
89
|
-
label: '源端口:',
|
|
90
|
-
objKey: 'source_Interface'
|
|
91
|
-
}, {
|
|
92
|
-
label: '目的端口:',
|
|
93
|
-
objKey: 'destination_Interface'
|
|
94
|
-
}]
|
|
95
|
-
};
|
|
96
|
-
return /*#__PURE__*/React.createElement("div", {
|
|
97
|
-
className: styles['base-info']
|
|
98
|
-
}, (_itemCols$type = itemCols[type]) === null || _itemCols$type === void 0 ? void 0 : _itemCols$type.map(function (_ref, key) {
|
|
99
|
-
var label = _ref.label,
|
|
100
|
-
objKey = _ref.objKey,
|
|
101
|
-
style = _ref.style,
|
|
102
|
-
render = _ref.render;
|
|
103
|
-
return data[objKey] === false ? '' : render ? render(data[objKey], key) : /*#__PURE__*/React.createElement("div", {
|
|
104
|
-
className: styles.item,
|
|
105
|
-
style: style || {},
|
|
106
|
-
key: key
|
|
107
|
-
}, /*#__PURE__*/React.createElement("span", {
|
|
108
|
-
className: styles.label
|
|
109
|
-
}, label), /*#__PURE__*/React.createElement("span", {
|
|
110
|
-
className: styles.content,
|
|
111
|
-
title: data[objKey]
|
|
112
|
-
}, data[objKey] || '-'));
|
|
113
|
-
}));
|
|
114
|
-
} // 关键指标
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
function indicatorRender(type, data) {
|
|
118
|
-
function formatValue(itemData) {
|
|
119
|
-
var format = metricValueFormat({
|
|
120
|
-
value: itemData.value,
|
|
121
|
-
dataType: itemData.dataType,
|
|
122
|
-
dict: DictCache.getDictObject(),
|
|
123
|
-
unit: itemData.unit,
|
|
124
|
-
code: itemData.code
|
|
125
|
-
});
|
|
126
|
-
return format.value + " " + (format.value === '-' ? '' : format.unit);
|
|
127
|
-
}
|
|
128
|
-
|
|
129
|
-
return /*#__PURE__*/React.createElement("div", {
|
|
130
|
-
className: styles.indicator
|
|
131
|
-
}, /*#__PURE__*/React.createElement("div", {
|
|
132
|
-
className: styles.row
|
|
133
|
-
}, data.slice(0, 3).map(function (item) {
|
|
134
|
-
return /*#__PURE__*/React.createElement("div", {
|
|
135
|
-
className: styles.item,
|
|
136
|
-
key: item.code
|
|
137
|
-
}, /*#__PURE__*/React.createElement("span", {
|
|
138
|
-
className: styles.content
|
|
139
|
-
}, formatValue(item)), /*#__PURE__*/React.createElement("span", {
|
|
140
|
-
className: styles.label
|
|
141
|
-
}, item.name));
|
|
142
|
-
})), type === 'node' ? /*#__PURE__*/React.createElement("div", {
|
|
143
|
-
className: styles.row
|
|
144
|
-
}, data.slice(3, 6).map(function (item) {
|
|
145
|
-
return /*#__PURE__*/React.createElement("div", {
|
|
146
|
-
className: styles.item,
|
|
147
|
-
key: item.code
|
|
148
|
-
}, /*#__PURE__*/React.createElement("span", {
|
|
149
|
-
className: styles.content
|
|
150
|
-
}, formatValue(item)), /*#__PURE__*/React.createElement("span", {
|
|
151
|
-
className: styles.label
|
|
152
|
-
}, item.name));
|
|
153
|
-
})) : '');
|
|
154
34
|
}
|
|
155
35
|
/**
|
|
156
36
|
* 资源概览
|
|
@@ -158,18 +38,19 @@ function indicatorRender(type, data) {
|
|
|
158
38
|
|
|
159
39
|
|
|
160
40
|
export default function ResourceOverview(props) {
|
|
41
|
+
var _viewerProps$resource, _baseInfo$resource;
|
|
42
|
+
|
|
161
43
|
var topo = props.topo,
|
|
162
44
|
id = props.id,
|
|
163
45
|
type = props.type,
|
|
164
46
|
ciType = props.ciType,
|
|
165
|
-
userId = props.userId
|
|
166
|
-
|
|
167
|
-
var
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
links = _topo$store$useModelS2.links;
|
|
47
|
+
userId = props.userId,
|
|
48
|
+
viewerProps = props.viewerProps;
|
|
49
|
+
var resourceOverviewProps = (viewerProps === null || viewerProps === void 0 ? void 0 : (_viewerProps$resource = viewerProps.resourceDetailProps) === null || _viewerProps$resource === void 0 ? void 0 : _viewerProps$resource.resourceOverviewProps) || {};
|
|
50
|
+
var ciAttrAndMetricData = useCiAttrAndMetricData({
|
|
51
|
+
topo: topo,
|
|
52
|
+
id: id
|
|
53
|
+
});
|
|
173
54
|
|
|
174
55
|
var _useState = useState({
|
|
175
56
|
// 资源
|
|
@@ -215,9 +96,25 @@ export default function ResourceOverview(props) {
|
|
|
215
96
|
isAppTopo = _useState4[0],
|
|
216
97
|
setIsAppTopo = _useState4[1];
|
|
217
98
|
|
|
99
|
+
var ciTypeMeta = useMemo(function () {
|
|
100
|
+
var typeMeta;
|
|
101
|
+
|
|
102
|
+
if (ciType === 'network_link') {
|
|
103
|
+
// 网络链路要按链路类型查询属性、指标
|
|
104
|
+
var link = topo.dataModel.getDataById(id);
|
|
105
|
+
var linkConnectType = link.attributes['network_link.connect_type'];
|
|
106
|
+
typeMeta = topo.ciTyeCache.getNetworkLinkCiType(linkConnectType);
|
|
107
|
+
} else {
|
|
108
|
+
typeMeta = topo.ciTyeCache.getCiType(ciType);
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
return typeMeta;
|
|
112
|
+
}, [id]);
|
|
218
113
|
useEffect(function () {
|
|
219
|
-
|
|
220
|
-
|
|
114
|
+
if (ciAttrAndMetricData) {
|
|
115
|
+
init();
|
|
116
|
+
}
|
|
117
|
+
}, [ciAttrAndMetricData, ciTypeMeta, id]);
|
|
221
118
|
|
|
222
119
|
function init() {
|
|
223
120
|
return _init.apply(this, arguments);
|
|
@@ -227,27 +124,15 @@ export default function ResourceOverview(props) {
|
|
|
227
124
|
_init = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
|
|
228
125
|
var _topo$options$resourc, _modelAttributeMap$ow, _modelAttributeMap$, _modelAttributeMap$2, _modelAttributeMap$3, _modelAttributeMap$di, _modelAttributeMap$ip, _modelAttributeMap$as, _modelAttributeMap$5, _modelAttributeMap$6, _modelAttributeMap$so, _attributeMap$source_, _modelAttributeMap$de, _attributeMap$destina;
|
|
229
126
|
|
|
230
|
-
var
|
|
127
|
+
var modelMetrics, ciName, modelAttributeMap, domain, topModelMetrics, isAppTopoFlag, attributeMap, metrics, res_address, _attributeMap$, rated_bandwidth, _modelAttributeMap$4;
|
|
231
128
|
|
|
232
129
|
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
|
233
130
|
while (1) {
|
|
234
131
|
switch (_context.prev = _context.next) {
|
|
235
132
|
case 0:
|
|
236
|
-
console.log('初始化/更新概览 props', props);
|
|
237
|
-
|
|
238
|
-
if (ciType === 'network_link') {
|
|
239
|
-
// 网络链路要按链路类型查询属性、指标
|
|
240
|
-
link = [].concat(linkGroups, links).find(function (item) {
|
|
241
|
-
return item.id === id;
|
|
242
|
-
});
|
|
243
|
-
linkConnectType = link.attributes['network_link.connect_type'];
|
|
244
|
-
ciTypeMeta = topo.ciTyeCache.getNetworkLinkCiType(linkConnectType);
|
|
245
|
-
} else {
|
|
246
|
-
ciTypeMeta = topo.ciTyeCache.getCiType(ciType);
|
|
247
|
-
} // 指标模型
|
|
248
|
-
|
|
133
|
+
console.log('初始化/更新概览 props', props); // 指标模型
|
|
249
134
|
|
|
250
|
-
|
|
135
|
+
modelMetrics = ciTypeMeta.metrics, ciName = ciTypeMeta.displayName, modelAttributeMap = ciTypeMeta.attributeMap, domain = ciTypeMeta.domain;
|
|
251
136
|
topModelMetrics = modelMetrics.slice(0, 6); // 应用拓扑处理
|
|
252
137
|
|
|
253
138
|
isAppTopoFlag = !!((_topo$options$resourc = topo.options.resourceOverviewDrawer) !== null && _topo$options$resourc !== void 0 && _topo$options$resourc.getData);
|
|
@@ -255,41 +140,41 @@ export default function ResourceOverview(props) {
|
|
|
255
140
|
setIsAppTopo(isAppTopoFlag);
|
|
256
141
|
|
|
257
142
|
if (!isAppTopoFlag) {
|
|
258
|
-
_context.next =
|
|
143
|
+
_context.next = 9;
|
|
259
144
|
break;
|
|
260
145
|
}
|
|
261
146
|
|
|
262
147
|
initAppTopo(topModelMetrics, modelAttributeMap, ciName, domain);
|
|
263
148
|
return _context.abrupt("return");
|
|
264
149
|
|
|
265
|
-
case
|
|
150
|
+
case 9:
|
|
266
151
|
// 拓扑(默认) ---------------------------
|
|
267
152
|
// 基本信息
|
|
268
|
-
|
|
269
|
-
console.log('基本信息', attributeMap,
|
|
153
|
+
attributeMap = ciAttrAndMetricData.attributeMap, metrics = ciAttrAndMetricData.metrics;
|
|
154
|
+
console.log('基本信息', attributeMap, modelAttributeMap); // userVisible
|
|
270
155
|
// 位置
|
|
271
156
|
|
|
272
157
|
res_address = false;
|
|
273
158
|
|
|
274
159
|
if (!((_modelAttributeMap$ow = modelAttributeMap.owned_computer_room) !== null && _modelAttributeMap$ow !== void 0 && _modelAttributeMap$ow.userVisible)) {
|
|
275
|
-
_context.next =
|
|
160
|
+
_context.next = 18;
|
|
276
161
|
break;
|
|
277
162
|
}
|
|
278
163
|
|
|
279
|
-
_context.next =
|
|
164
|
+
_context.next = 15;
|
|
280
165
|
return getAddressFormat(attributeMap);
|
|
281
166
|
|
|
282
|
-
case
|
|
167
|
+
case 15:
|
|
283
168
|
res_address = _context.sent;
|
|
284
|
-
_context.next =
|
|
169
|
+
_context.next = 19;
|
|
285
170
|
break;
|
|
286
171
|
|
|
287
|
-
case
|
|
172
|
+
case 18:
|
|
288
173
|
if ((_modelAttributeMap$ = modelAttributeMap[ciType + ".computer_room"]) !== null && _modelAttributeMap$ !== void 0 && _modelAttributeMap$.userVisible || (_modelAttributeMap$2 = modelAttributeMap[ciType + ".area"]) !== null && _modelAttributeMap$2 !== void 0 && _modelAttributeMap$2.userVisible) {
|
|
289
174
|
res_address = attributeMap[ciType + ".computer_room "] || attributeMap[ciType + ".area"] ? " " + (((_attributeMap$ = attributeMap[ciType + ".area_object"]) === null || _attributeMap$ === void 0 ? void 0 : _attributeMap$.displayName) || '') + " " + (attributeMap[ciType + ".computer_room"] || '') : false;
|
|
290
175
|
}
|
|
291
176
|
|
|
292
|
-
case
|
|
177
|
+
case 19:
|
|
293
178
|
// 链路带宽(取实际带宽)
|
|
294
179
|
rated_bandwidth = false;
|
|
295
180
|
|
|
@@ -320,16 +205,16 @@ export default function ResourceOverview(props) {
|
|
|
320
205
|
}); // 资源/链路-关键指标 数据 metrics,模型 topo.ciTyeCache.getCiType(ciType)
|
|
321
206
|
|
|
322
207
|
setIndicator(topModelMetrics.map(function (item) {
|
|
323
|
-
var
|
|
208
|
+
var _findItem;
|
|
324
209
|
|
|
325
210
|
return _extends({}, item, {
|
|
326
|
-
value: ((
|
|
211
|
+
value: ((_findItem = findItem(metrics, 'code', item.code)) === null || _findItem === void 0 ? void 0 : _findItem.value) || ''
|
|
327
212
|
});
|
|
328
213
|
})); // 资源-告警/风险
|
|
329
214
|
|
|
330
215
|
getAlarmRiskData(id);
|
|
331
216
|
|
|
332
|
-
case
|
|
217
|
+
case 24:
|
|
333
218
|
case "end":
|
|
334
219
|
return _context.stop();
|
|
335
220
|
}
|
|
@@ -453,7 +338,7 @@ export default function ResourceOverview(props) {
|
|
|
453
338
|
|
|
454
339
|
function _getAttribute() {
|
|
455
340
|
_getAttribute = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee3(id) {
|
|
456
|
-
var res,
|
|
341
|
+
var res, _ref2, attributes, attributeMap;
|
|
457
342
|
|
|
458
343
|
return _regeneratorRuntime.wrap(function _callee3$(_context3) {
|
|
459
344
|
while (1) {
|
|
@@ -471,7 +356,7 @@ export default function ResourceOverview(props) {
|
|
|
471
356
|
|
|
472
357
|
case 2:
|
|
473
358
|
res = _context3.sent;
|
|
474
|
-
|
|
359
|
+
_ref2 = res[0] || {}, attributes = _ref2.attributes;
|
|
475
360
|
attributeMap = {};
|
|
476
361
|
attributes.forEach(function (item) {
|
|
477
362
|
attributeMap[item.code] = item.value;
|
|
@@ -494,14 +379,14 @@ export default function ResourceOverview(props) {
|
|
|
494
379
|
|
|
495
380
|
|
|
496
381
|
function _getAddressFormat() {
|
|
497
|
-
_getAddressFormat = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee4(
|
|
382
|
+
_getAddressFormat = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee4(_ref) {
|
|
498
383
|
var owned_computer_room, owned_cabinet, start_u_location, end_u_location, address, _res$find, _res$find$attributes, _res$find2, _res$find2$attributes, res, u;
|
|
499
384
|
|
|
500
385
|
return _regeneratorRuntime.wrap(function _callee4$(_context4) {
|
|
501
386
|
while (1) {
|
|
502
387
|
switch (_context4.prev = _context4.next) {
|
|
503
388
|
case 0:
|
|
504
|
-
owned_computer_room =
|
|
389
|
+
owned_computer_room = _ref.owned_computer_room, owned_cabinet = _ref.owned_cabinet, start_u_location = _ref.start_u_location, end_u_location = _ref.end_u_location;
|
|
505
390
|
console.log('获取地址信息:', {
|
|
506
391
|
owned_computer_room: owned_computer_room,
|
|
507
392
|
owned_cabinet: owned_cabinet,
|
|
@@ -717,20 +602,25 @@ export default function ResourceOverview(props) {
|
|
|
717
602
|
return _alarmRiskOperation.apply(this, arguments);
|
|
718
603
|
}
|
|
719
604
|
|
|
605
|
+
var elementData = {
|
|
606
|
+
id: id,
|
|
607
|
+
ciType: ciType,
|
|
608
|
+
type: type,
|
|
609
|
+
name: baseInfo === null || baseInfo === void 0 ? void 0 : (_baseInfo$resource = baseInfo.resource) === null || _baseInfo$resource === void 0 ? void 0 : _baseInfo$resource.display_name
|
|
610
|
+
};
|
|
720
611
|
return /*#__PURE__*/React.createElement("div", {
|
|
721
612
|
className: styles['resource-overview']
|
|
722
|
-
}, /*#__PURE__*/React.createElement(
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
name: baseInfo.resource.display_name
|
|
728
|
-
})
|
|
729
|
-
}, BaseInfoRender(type, baseInfo)), /*#__PURE__*/React.createElement(BlockBox, {
|
|
613
|
+
}, /*#__PURE__*/React.createElement(BaseInfoBlock, _extends({
|
|
614
|
+
data: elementData,
|
|
615
|
+
ciTypeMeta: ciTypeMeta,
|
|
616
|
+
baseInfo: baseInfo
|
|
617
|
+
}, resourceOverviewProps === null || resourceOverviewProps === void 0 ? void 0 : resourceOverviewProps.baseInfoProps)), /*#__PURE__*/React.createElement(BlockBox, {
|
|
730
618
|
headerTitle: "\u5173\u952E\u6307\u6807"
|
|
731
|
-
}, /*#__PURE__*/React.createElement(
|
|
732
|
-
|
|
733
|
-
|
|
619
|
+
}, /*#__PURE__*/React.createElement(ResourceOverviewMetric, {
|
|
620
|
+
topo: topo,
|
|
621
|
+
type: type,
|
|
622
|
+
data: indicator
|
|
623
|
+
})), /*#__PURE__*/React.createElement(BlockBox, {
|
|
734
624
|
headerTitle: "\u6700\u8FD1\u7684\u544A\u8B66\u548C\u98CE\u9669"
|
|
735
625
|
}, /*#__PURE__*/React.createElement("div", {
|
|
736
626
|
className: styles.alarm
|
|
File without changes
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export default function useCiAttrAndMetricData(props) {
|
|
2
|
+
var topo = props.topo,
|
|
3
|
+
id = props.id;
|
|
4
|
+
|
|
5
|
+
var _topo$store$useModelS = topo.store.useModelState('topoBizMod'),
|
|
6
|
+
attrsAndMetrics = _topo$store$useModelS.attrsAndMetrics;
|
|
7
|
+
|
|
8
|
+
var data = attrsAndMetrics.find(function (item) {
|
|
9
|
+
return item.id === id;
|
|
10
|
+
});
|
|
11
|
+
return data;
|
|
12
|
+
}
|
|
@@ -1,40 +1,49 @@
|
|
|
1
|
-
.
|
|
2
|
-
width: 832px;
|
|
1
|
+
@import '~@alifd/next/variables.scss';
|
|
3
2
|
|
|
4
|
-
|
|
5
|
-
|
|
3
|
+
.title-popup{
|
|
4
|
+
width: 240px;
|
|
5
|
+
.search{
|
|
6
|
+
width: 100%;
|
|
7
|
+
padding: 4px 16px 12px;
|
|
6
8
|
}
|
|
9
|
+
.not-data{
|
|
10
|
+
color: var(--color-text1-4);
|
|
11
|
+
font-size: 14px;
|
|
12
|
+
line-height: 200px;
|
|
13
|
+
text-align: center;
|
|
14
|
+
}
|
|
15
|
+
:global {
|
|
16
|
+
.#{$css-prefix}menu-content{
|
|
17
|
+
height: 200px;
|
|
18
|
+
overflow-y: auto;
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
}
|
|
7
22
|
|
|
8
|
-
|
|
23
|
+
.baseInfo {
|
|
24
|
+
box-shadow: 0px 0px 6px 1px #F2F7FD;
|
|
25
|
+
.drawer-title{
|
|
9
26
|
font-size: 16px;
|
|
10
|
-
color: #333333;
|
|
11
|
-
line-height: 22px;
|
|
12
27
|
font-weight: 500;
|
|
28
|
+
color: #4D6277;
|
|
13
29
|
}
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
.topo-drawer-alarm-banner {
|
|
24
|
-
padding-bottom: 8px;
|
|
25
|
-
margin-top: -10px;
|
|
26
|
-
|
|
27
|
-
.topo-drawer-alarm-txt {
|
|
28
|
-
font-size: 12px;
|
|
29
|
-
color: #333333;
|
|
30
|
-
line-height: 20px;
|
|
30
|
+
:global {
|
|
31
|
+
.#{$css-prefix}drawer-body {
|
|
32
|
+
height: calc(100% - 49px);
|
|
33
|
+
padding: 16px 24px;
|
|
34
|
+
.#{$css-prefix}tabs-content{
|
|
35
|
+
height: calc(100% - 31px);
|
|
36
|
+
overflow: auto;
|
|
37
|
+
}
|
|
31
38
|
}
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
39
|
+
}
|
|
40
|
+
.tab{
|
|
41
|
+
height: 100%;
|
|
42
|
+
:global {
|
|
43
|
+
.#{$css-prefix}tabs-content{
|
|
44
|
+
height: calc(100% - 31px);
|
|
45
|
+
overflow: auto;
|
|
46
|
+
}
|
|
38
47
|
}
|
|
39
48
|
}
|
|
40
49
|
}
|
|
@@ -2,12 +2,12 @@ import _extends from "@babel/runtime/helpers/extends";
|
|
|
2
2
|
import React from 'react';
|
|
3
3
|
import ResourceWebControllUrlSettingDialog from "./ResourceWebControllUrlSettingDialog";
|
|
4
4
|
import MetricPollingPlugin from "./MetricPollingPlugin";
|
|
5
|
-
import
|
|
5
|
+
import ResourceDetail from "./ResourceDetail";
|
|
6
6
|
export default function ViewerPlugin(props) {
|
|
7
7
|
var topo = props.topo,
|
|
8
8
|
viewerProps = props.viewerProps;
|
|
9
9
|
var store = topo.store;
|
|
10
|
-
var plugins = [MetricPollingPlugin, ResourceWebControllUrlSettingDialog,
|
|
10
|
+
var plugins = [MetricPollingPlugin, ResourceWebControllUrlSettingDialog, ResourceDetail].concat((viewerProps === null || viewerProps === void 0 ? void 0 : viewerProps.plugins) || []);
|
|
11
11
|
return /*#__PURE__*/React.createElement(React.Fragment, null, plugins.map(function (Plugin, index) {
|
|
12
12
|
return /*#__PURE__*/React.createElement(Plugin, _extends({
|
|
13
13
|
key: index,
|
|
@@ -4,7 +4,7 @@ import React from "react";
|
|
|
4
4
|
import EditButton from "./widgets/EditButton";
|
|
5
5
|
import NodesDragSwitch from "./widgets/NodesDragSwitch";
|
|
6
6
|
import AlarmListShowButton from "./widgets/AlarmListShowButton";
|
|
7
|
-
import SettingButton from "./widgets/
|
|
7
|
+
import SettingButton from "./widgets/SettingButtonWidget";
|
|
8
8
|
export default function BasicTools(props) {
|
|
9
9
|
var topo = props.topo,
|
|
10
10
|
_props$showEditButton = props.showEditButton,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import _Button from "@alifd/next/es/button";
|
|
2
2
|
import _Icon from "@alifd/next/es/icon";
|
|
3
|
-
import React, {
|
|
3
|
+
import React, { useState } from 'react';
|
|
4
4
|
import DisplaySettingDrawer from "../../../../components/DisplaySettingDrawer";
|
|
5
5
|
/**
|
|
6
6
|
* 设置按钮
|
|
@@ -10,9 +10,8 @@ import DisplaySettingDrawer from "../../../../components/DisplaySettingDrawer";
|
|
|
10
10
|
|
|
11
11
|
export default function SettingButton(props) {
|
|
12
12
|
var topo = props.topo,
|
|
13
|
-
|
|
13
|
+
displaySettingProps = props.displaySettingProps,
|
|
14
14
|
style = props.style;
|
|
15
|
-
var id = topo.id;
|
|
16
15
|
|
|
17
16
|
var _useState = useState(false),
|
|
18
17
|
visible = _useState[0],
|
|
@@ -30,7 +29,7 @@ export default function SettingButton(props) {
|
|
|
30
29
|
})), /*#__PURE__*/React.createElement(DisplaySettingDrawer, {
|
|
31
30
|
visible: visible,
|
|
32
31
|
topo: topo,
|
|
33
|
-
|
|
32
|
+
displaySettingProps: displaySettingProps,
|
|
34
33
|
onClose: function onClose() {
|
|
35
34
|
setVisible(false);
|
|
36
35
|
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import SettingButton from "./SettingButton";
|
|
3
|
+
/**
|
|
4
|
+
* 设置按钮
|
|
5
|
+
*
|
|
6
|
+
* @return {any}
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
export default function SettingButtonWidget(props) {
|
|
10
|
+
var topo = props.topo,
|
|
11
|
+
viewerProps = props.viewerProps,
|
|
12
|
+
style = props.style;
|
|
13
|
+
return /*#__PURE__*/React.createElement(SettingButton, {
|
|
14
|
+
topo: topo,
|
|
15
|
+
displaySettingProps: viewerProps === null || viewerProps === void 0 ? void 0 : viewerProps.displaySettingProps,
|
|
16
|
+
style: style
|
|
17
|
+
});
|
|
18
|
+
}
|
|
19
|
+
;
|
|
@@ -43,10 +43,9 @@ function NetworkTopologyCore(props) {
|
|
|
43
43
|
plugins: [],
|
|
44
44
|
// 右侧工具栏按钮
|
|
45
45
|
ViewerTitlebarRightTools: ViewerTools,
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
displaySettingDrawerProps: {
|
|
46
|
+
displaySettingProps: {
|
|
47
|
+
showLinkConfig: true,
|
|
48
|
+
// 是否显示链路相关配置
|
|
50
49
|
linkTagConfig: function linkTagConfig(params) {
|
|
51
50
|
return /*#__PURE__*/React.createElement(LinkTag, params);
|
|
52
51
|
},
|
|
@@ -23,12 +23,16 @@ var TopoCenter = /*#__PURE__*/function (_TopoApp) {
|
|
|
23
23
|
}, options, {
|
|
24
24
|
usePermission: true,
|
|
25
25
|
storeModels: _extends({}, customStoreModels, options.storeModels),
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
26
|
+
tagTip: {
|
|
27
|
+
// 默认链路标注/悬浮框显示配置
|
|
28
|
+
getDefaultLinkTagConfig: function getDefaultLinkTagConfig() {
|
|
29
|
+
return DEFAULT_LINK_TAG_COMMON_CONFIG;
|
|
30
|
+
},
|
|
31
|
+
getDefaultLinkTipConfig: function getDefaultLinkTipConfig() {
|
|
32
|
+
return DEFAULT_TIP_COMMON_CONFIG;
|
|
33
|
+
},
|
|
34
|
+
ExtElementTagTipBuilder: LinkTagsTipsBuilder
|
|
30
35
|
},
|
|
31
|
-
ExtElementTagTipBuilder: LinkTagsTipsBuilder,
|
|
32
36
|
onSwitchToEditModeBegin: function () {
|
|
33
37
|
var _onSwitchToEditModeBegin = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(topo) {
|
|
34
38
|
var topoDispatchers;
|
|
@@ -37,16 +37,15 @@ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj &&
|
|
|
37
37
|
*/
|
|
38
38
|
function DisplaySetting(props, ref) {
|
|
39
39
|
var topo = props.topo,
|
|
40
|
-
|
|
40
|
+
displaySettingProps = props.displaySettingProps;
|
|
41
41
|
var displayConfig = topo.store.getModelState('displayConfig');
|
|
42
42
|
|
|
43
|
-
var _ref =
|
|
43
|
+
var _ref = displaySettingProps || {},
|
|
44
44
|
linkTagConfig = _ref.linkTagConfig,
|
|
45
45
|
linkTipConfig = _ref.linkTipConfig,
|
|
46
46
|
showEdgeExpandConfig = _ref.showEdgeExpandConfig,
|
|
47
|
-
extraConfig = _ref.extraConfig
|
|
48
|
-
|
|
49
|
-
var showLinkConfig = !!(viewerProps !== null && viewerProps !== void 0 && viewerProps.showLinkConfig);
|
|
47
|
+
extraConfig = _ref.extraConfig,
|
|
48
|
+
showLinkConfig = _ref.showLinkConfig;
|
|
50
49
|
|
|
51
50
|
var field = _field["default"].useField({
|
|
52
51
|
autoUnmount: false,
|
|
@@ -28,7 +28,7 @@ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj &&
|
|
|
28
28
|
function DisplaySettingDrawer(props) {
|
|
29
29
|
var visible = props.visible,
|
|
30
30
|
topo = props.topo,
|
|
31
|
-
|
|
31
|
+
displaySettingProps = props.displaySettingProps,
|
|
32
32
|
onClose = props.onClose;
|
|
33
33
|
var settingRef = (0, _react.useRef)();
|
|
34
34
|
|
|
@@ -95,7 +95,7 @@ function DisplaySettingDrawer(props) {
|
|
|
95
95
|
}, visible && /*#__PURE__*/_react["default"].createElement(_DisplaySetting["default"], {
|
|
96
96
|
ref: settingRef,
|
|
97
97
|
topo: topo,
|
|
98
|
-
|
|
98
|
+
displaySettingProps: displaySettingProps
|
|
99
99
|
}));
|
|
100
100
|
}
|
|
101
101
|
|