@riil-frontend/component-topology 8.0.0-a.1 → 8.0.0-a.10
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/index.css +1 -1
- package/build/index.js +13 -13
- package/es/core/common/icons/basicIcons.js +1 -1
- package/es/core/common/icons/icon.js +6 -2
- package/es/core/editor/components/Toolbar/widgets/EdgeTypeButton/EdgeType.js +42 -24
- package/es/core/editor/components/Toolbar/widgets/EdgeTypeButton/LineType.js +7 -2
- package/es/core/editor/components/Toolbar/widgets/EdgeTypeButton/LineType.module.scss +4 -0
- package/es/core/editor/components/Toolbar/widgets/EdgeTypeButton/index.js +1 -0
- package/es/core/editor/utils/edgeTypeStyleUtil.js +2 -3
- package/es/core/hooks/usePolling.js +3 -3
- package/es/core/models/TopoApp.js +2 -2
- package/es/core/models/tagstips/ElementTagTipConfig.js +1 -1
- package/es/core/models/topoData.js +9 -1
- package/es/core/models/utils/linkUtils.js +31 -63
- package/es/core/services/topo/basic.js +34 -0
- package/es/core/services/topo/constants.js +1 -0
- package/es/core/services/topo/index.js +4 -0
- package/es/core/store/models/topoConfig.js +6 -1
- package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/ResourceOverview.js +3 -2
- package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/ResourceOverviewMetric.js +4 -2
- package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/components/LinkTopo/hooks/useMetricPolling.js +2 -2
- package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/hooks/useMetricModels.js +3 -3
- package/es/core/viewer/components/titlebar/widgets/SearchWidget.js +4 -0
- package/es/networkTopo/services/topo/basic.js +4 -2
- package/es/networkTopo/store/linkManager.js +0 -1
- package/es/networkTopo/store/topoCenter.js +0 -1
- package/es/networkTopo/store/topoLinkMod.js +0 -1
- package/lib/core/common/icons/basicIcons.js +1 -1
- package/lib/core/common/icons/icon.js +6 -2
- package/lib/core/editor/components/Toolbar/widgets/EdgeTypeButton/EdgeType.js +43 -24
- package/lib/core/editor/components/Toolbar/widgets/EdgeTypeButton/LineType.js +8 -2
- package/lib/core/editor/components/Toolbar/widgets/EdgeTypeButton/LineType.module.scss +4 -0
- package/lib/core/editor/components/Toolbar/widgets/EdgeTypeButton/index.js +1 -0
- package/lib/core/editor/utils/edgeTypeStyleUtil.js +2 -3
- package/lib/core/hooks/usePolling.js +3 -3
- package/lib/core/models/TopoApp.js +3 -3
- package/lib/core/models/tagstips/ElementTagTipConfig.js +2 -2
- package/lib/core/models/topoData.js +9 -1
- package/lib/core/models/utils/linkUtils.js +32 -67
- package/lib/core/services/topo/basic.js +46 -0
- package/lib/core/services/topo/constants.js +6 -0
- package/lib/core/services/topo/index.js +16 -0
- package/lib/core/store/models/topoConfig.js +6 -1
- package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/ResourceOverview.js +3 -2
- package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/ResourceOverviewMetric.js +4 -2
- package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/components/LinkTopo/hooks/useMetricPolling.js +2 -2
- package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/hooks/useMetricModels.js +3 -3
- package/lib/core/viewer/components/titlebar/widgets/SearchWidget.js +4 -0
- package/lib/networkTopo/services/topo/basic.js +4 -2
- package/lib/networkTopo/store/linkManager.js +0 -2
- package/lib/networkTopo/store/topoCenter.js +0 -2
- package/lib/networkTopo/store/topoLinkMod.js +0 -2
- package/package.json +2 -2
- /package/es/core/services/{topo.js → topo/tagtip.js} +0 -0
- /package/lib/core/services/{topo.js → topo/tagtip.js} +0 -0
@@ -37,11 +37,15 @@ export function getResourceIcons(topo) {
|
|
37
37
|
*/
|
38
38
|
|
39
39
|
export function getBasicIcons(topo, containsGroupIcon) {
|
40
|
+
var nodeIcons = topoManager.iconLibManager.getNodeIcons().filter(function (icon) {
|
41
|
+
return !icon.ciType;
|
42
|
+
});
|
43
|
+
|
40
44
|
if (containsGroupIcon === false) {
|
41
|
-
return basicIcons;
|
45
|
+
return [].concat(nodeIcons, basicIcons);
|
42
46
|
}
|
43
47
|
|
44
|
-
return [topoManager.iconLibManager.getGroupIcon()].concat(basicIcons);
|
48
|
+
return [topoManager.iconLibManager.getGroupIcon()].concat(nodeIcons, basicIcons);
|
45
49
|
}
|
46
50
|
export function getGroupDefaultIcons(topo) {
|
47
51
|
return [].concat(topoManager.iconLibManager.getIcons());
|
@@ -2,6 +2,7 @@ import _Field from "@alifd/next/es/field";
|
|
2
2
|
import _Select from "@alifd/next/es/select";
|
3
3
|
import _Form from "@alifd/next/es/form";
|
4
4
|
import React, { useEffect } from 'react';
|
5
|
+
import { getEdgesBySelection, loopEdgesAndChildren } from "../../../../utils/edgeTypeStyleUtil";
|
5
6
|
import styles from "./EdgeType.module.scss";
|
6
7
|
import LineType from "./LineType";
|
7
8
|
var FormItem = _Form.Item;
|
@@ -60,43 +61,60 @@ var LINE_MOLD_OPTIONS = [{
|
|
60
61
|
icon: 'topo_lineMold_dotted_two'
|
61
62
|
}];
|
62
63
|
|
63
|
-
function
|
64
|
+
function getValuesByEdges(topo) {
|
65
|
+
function getStartPoint(edge) {
|
66
|
+
var icons = edge.s('icons') || {};
|
67
|
+
return ['sourceArrow', 'sourceSolidCircle', 'sourceNoneCircle'].filter(function (name) {
|
68
|
+
return icons[name];
|
69
|
+
})[0] || 'nil';
|
70
|
+
}
|
71
|
+
|
72
|
+
function getEndPoint(edge) {
|
73
|
+
var icons = edge.s('icons') || {};
|
74
|
+
return ['targetArrow', 'targetSolidCircle', 'targetNoneCircle'].filter(function (name) {
|
75
|
+
return icons[name];
|
76
|
+
})[0] || 'nil';
|
77
|
+
}
|
78
|
+
|
79
|
+
var selectionEdges = getEdgesBySelection(topo);
|
80
|
+
var edgeValues = [];
|
81
|
+
loopEdgesAndChildren(topo, selectionEdges, function (edge) {
|
82
|
+
edgeValues.push({
|
83
|
+
lineButton: edge.s('edge.type'),
|
84
|
+
startPoint: getStartPoint(edge),
|
85
|
+
endPoint: getEndPoint(edge),
|
86
|
+
lineMold: edge.a('lineMode') || 'solidLine'
|
87
|
+
});
|
88
|
+
});
|
64
89
|
var values = {
|
90
|
+
lineButton: undefined,
|
65
91
|
startPoint: undefined,
|
66
92
|
endPoint: undefined,
|
67
93
|
lineMold: undefined
|
68
|
-
};
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
values = {
|
73
|
-
startPoint: 'nil',
|
74
|
-
endPoint: 'nil',
|
75
|
-
lineMold: edge.a('lineMode') || 'solidLine'
|
76
|
-
};
|
77
|
-
var icons = edge.s('icons') || {};
|
78
|
-
['sourceArrow', 'sourceSolidCircle', 'sourceNoneCircle'].forEach(function (name) {
|
79
|
-
if (icons[name]) {
|
80
|
-
values.startPoint = name;
|
81
|
-
}
|
94
|
+
};
|
95
|
+
Object.keys(values).forEach(function (name) {
|
96
|
+
var vals = edgeValues.map(function (item) {
|
97
|
+
return item[name];
|
82
98
|
});
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
}
|
87
|
-
});
|
88
|
-
}
|
99
|
+
var isSame = vals.filter(function (val) {
|
100
|
+
return val === vals[0];
|
101
|
+
}).length === vals.length;
|
89
102
|
|
103
|
+
if (isSame) {
|
104
|
+
values[name] = vals[0];
|
105
|
+
}
|
106
|
+
});
|
90
107
|
return values;
|
91
108
|
}
|
92
109
|
|
93
110
|
function EdgeType(props) {
|
94
|
-
var
|
111
|
+
var topo = props.topo,
|
112
|
+
selection = props.selection,
|
95
113
|
_onChange = props.onChange;
|
96
114
|
|
97
115
|
var field = _Field.useField({
|
98
116
|
autoUnmount: false,
|
99
|
-
values:
|
117
|
+
values: getValuesByEdges(topo),
|
100
118
|
onChange: function onChange(name, value) {
|
101
119
|
if (['startPoint', 'endPoint'].includes(name) && value === 'nil') {
|
102
120
|
_onChange(name, null);
|
@@ -107,7 +125,7 @@ function EdgeType(props) {
|
|
107
125
|
});
|
108
126
|
|
109
127
|
useEffect(function () {
|
110
|
-
field.setValues(
|
128
|
+
field.setValues(getValuesByEdges(topo));
|
111
129
|
}, [selection]);
|
112
130
|
return /*#__PURE__*/React.createElement("div", {
|
113
131
|
className: styles.lineBox
|
@@ -1,6 +1,7 @@
|
|
1
1
|
import _Button from "@alifd/next/es/button";
|
2
2
|
import _Balloon from "@alifd/next/es/balloon";
|
3
3
|
import React, { useState } from 'react';
|
4
|
+
import classNames from 'classnames';
|
4
5
|
import styles from "./LineType.module.scss";
|
5
6
|
var Tooltip = _Balloon.Tooltip;
|
6
7
|
var LINE_TYPE_OPTIONS = [{
|
@@ -25,11 +26,14 @@ var LINE_TYPE_OPTIONS = [{
|
|
25
26
|
icon: 'topo_linear_icon_arcline'
|
26
27
|
}];
|
27
28
|
var LineType = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
28
|
-
var
|
29
|
+
var value = props.value,
|
30
|
+
onChange = props.onChange;
|
29
31
|
|
30
32
|
function lineButton(item) {
|
33
|
+
var _classNames;
|
34
|
+
|
31
35
|
return /*#__PURE__*/React.createElement(_Button, {
|
32
|
-
className:
|
36
|
+
className: classNames(styles.redioBtn, (_classNames = {}, _classNames[styles.selected] = value === item.value, _classNames)),
|
33
37
|
onClick: function onClick() {
|
34
38
|
onChange(item.value);
|
35
39
|
}
|
@@ -50,4 +54,5 @@ var LineType = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
50
54
|
}, item.label);
|
51
55
|
}));
|
52
56
|
});
|
57
|
+
LineType.displayName = 'LineType';
|
53
58
|
export default LineType;
|
@@ -14,8 +14,7 @@ export function getEdgesBySelection(topo) {
|
|
14
14
|
return nodeIds;
|
15
15
|
};
|
16
16
|
|
17
|
-
var getSelectedEdges = function getSelectedEdges(
|
18
|
-
var gv = topo.getGraphView();
|
17
|
+
var getSelectedEdges = function getSelectedEdges(gv) {
|
19
18
|
var selection = gv.getSelectionModel().getSelection().toArray(); // 选中的连线
|
20
19
|
|
21
20
|
var edges = selection.filter(function (element) {
|
@@ -41,7 +40,7 @@ export function getEdgesBySelection(topo) {
|
|
41
40
|
return edges;
|
42
41
|
};
|
43
42
|
|
44
|
-
return getSelectedEdges(topo);
|
43
|
+
return getSelectedEdges(topo.getGraphView());
|
45
44
|
}
|
46
45
|
/**
|
47
46
|
* 遍历连线及子连线
|
@@ -21,9 +21,9 @@ var usePolling = function usePolling(props) {
|
|
21
21
|
var resIdsList = resAndMetrics === null || resAndMetrics === void 0 ? void 0 : resAndMetrics.resIdsList; // 轮询hooks
|
22
22
|
|
23
23
|
var _useRequest = useRequest(refresh, {
|
24
|
-
pollingInterval:
|
25
|
-
|
26
|
-
// debounceInterval:
|
24
|
+
pollingInterval: 60 * 1000,
|
25
|
+
pollingWhenHidden: false,
|
26
|
+
// debounceInterval: 200,
|
27
27
|
manual: true,
|
28
28
|
onSuccess: function onSuccess(result) {
|
29
29
|
if (result) {
|
@@ -1,10 +1,10 @@
|
|
1
1
|
import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
|
2
2
|
import _extends from "@babel/runtime/helpers/extends";
|
3
3
|
import _regeneratorRuntime from "@babel/runtime/regenerator";
|
4
|
-
import topoService from '@riil-frontend/component-topology-common/es/services/topo';
|
5
4
|
import { setRequest } from '@riil-frontend/component-topology-utils';
|
6
5
|
import rlog from '@riil-frontend/component-topology-utils/es/rlog';
|
7
6
|
import { cloneDeep } from 'lodash';
|
7
|
+
import topoService from "../services/topo";
|
8
8
|
import CiTypeCache from "./cache/CiTypeCache";
|
9
9
|
import Alarm from "./Alarm";
|
10
10
|
import TopoGraphView from "./TopoGraphView";
|
@@ -23,7 +23,7 @@ import topoFactory from "./topoFactory";
|
|
23
23
|
import ElementTagTipConfig from "./tagstips/ElementTagTipConfig";
|
24
24
|
import SelectionModel from "./SelectionModel"; // eslint-disable-next-line no-undef
|
25
25
|
|
26
|
-
var version = typeof "8.0.0-a.
|
26
|
+
var version = typeof "8.0.0-a.10" === 'string' ? "8.0.0-a.10" : null;
|
27
27
|
console.info("\u62D3\u6251\u7248\u672C: " + version);
|
28
28
|
/**
|
29
29
|
* 拓扑显示和编辑
|
@@ -2,7 +2,7 @@ import _extends from "@babel/runtime/helpers/extends";
|
|
2
2
|
import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
|
3
3
|
import _regeneratorRuntime from "@babel/runtime/regenerator";
|
4
4
|
import { getLinkMtCodes, getMonitorTemplateCodesFromTopoData, getMtCodeCiTypeMap, getNodeMtCodes } from "./utils";
|
5
|
-
import { getMetricsByMonitorTemplateCodes } from "../../services/topo";
|
5
|
+
import { getMetricsByMonitorTemplateCodes } from "../../services/topo/tagtip";
|
6
6
|
import rlog from '@riil-frontend/component-topology-utils/lib/rlog';
|
7
7
|
|
8
8
|
var ElementTagTipConfig = /*#__PURE__*/function () {
|
@@ -4,8 +4,16 @@ import _regeneratorRuntime from "@babel/runtime/regenerator";
|
|
4
4
|
import { TOPO_PARENT_ID } from "@riil-frontend/component-topology-common/es/services/topo";
|
5
5
|
import rlog from "@riil-frontend/component-topology-utils/es/rlog";
|
6
6
|
export function getLayoutId(layout) {
|
7
|
-
if (!layout
|
7
|
+
if (!layout) {
|
8
8
|
return layout;
|
9
|
+
} // 拖拽添加分层后点击保存ht传参不正确,临时适配
|
10
|
+
|
11
|
+
|
12
|
+
if (typeof layout === "string") {
|
13
|
+
return {
|
14
|
+
v: 'towardeast',
|
15
|
+
h: 'towardsouth'
|
16
|
+
}[layout] || layout;
|
9
17
|
}
|
10
18
|
|
11
19
|
var id = layout.id,
|
@@ -1,12 +1,12 @@
|
|
1
|
-
import _extends from "@babel/runtime/helpers/extends";
|
2
1
|
import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
|
2
|
+
import _extends from "@babel/runtime/helpers/extends";
|
3
3
|
import _regeneratorRuntime from "@babel/runtime/regenerator";
|
4
|
-
import topoService from '@riil-frontend/component-topology-common/es/services/topo';
|
5
4
|
import keyBy from 'lodash/keyBy';
|
6
5
|
import _ from 'lodash';
|
7
6
|
import { queryCisByIds, queryModelAsset } from "../../services"; // 查询所有连线
|
8
7
|
|
9
|
-
import { getEdges } from "../../../utils/htElementUtils";
|
8
|
+
import { getEdges } from "../../../utils/htElementUtils";
|
9
|
+
import CiTypeCache from "../cache/CiTypeCache"; // const interfaceTypeMap = {
|
10
10
|
// "network.interface": {
|
11
11
|
// displayName: "网络接口",
|
12
12
|
// },
|
@@ -33,40 +33,6 @@ export function isCrucialLink(link) {
|
|
33
33
|
export function isExitLink(link) {
|
34
34
|
return (link === null || link === void 0 ? void 0 : link.attributes) && !(link !== null && link !== void 0 && link.attributes['destination_id']);
|
35
35
|
}
|
36
|
-
export var getInterfaceObject = /*#__PURE__*/function () {
|
37
|
-
var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(codes) {
|
38
|
-
var query, promises, result, ifDoc;
|
39
|
-
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
40
|
-
while (1) {
|
41
|
-
switch (_context.prev = _context.next) {
|
42
|
-
case 0:
|
43
|
-
query = _.compact(_.uniq(codes));
|
44
|
-
promises = query.map(queryModelAsset);
|
45
|
-
_context.next = 4;
|
46
|
-
return Promise.all(promises);
|
47
|
-
|
48
|
-
case 4:
|
49
|
-
result = _context.sent;
|
50
|
-
ifDoc = {};
|
51
|
-
result.map(function (ifItem) {
|
52
|
-
ifDoc[ifItem.code] = {
|
53
|
-
displayName: ifItem.displayName
|
54
|
-
};
|
55
|
-
});
|
56
|
-
return _context.abrupt("return", ifDoc);
|
57
|
-
|
58
|
-
case 8:
|
59
|
-
case "end":
|
60
|
-
return _context.stop();
|
61
|
-
}
|
62
|
-
}
|
63
|
-
}, _callee);
|
64
|
-
}));
|
65
|
-
|
66
|
-
return function getInterfaceObject(_x) {
|
67
|
-
return _ref.apply(this, arguments);
|
68
|
-
};
|
69
|
-
}();
|
70
36
|
export function mergeLinksData(links, linkCis, nodes, interfaceCis, interfaceDoc) {
|
71
37
|
var linkCiMap = keyBy(links, 'id');
|
72
38
|
return links.map(function (link) {
|
@@ -110,57 +76,59 @@ export function mergeLinksData(links, linkCis, nodes, interfaceCis, interfaceDoc
|
|
110
76
|
});
|
111
77
|
});
|
112
78
|
}
|
113
|
-
export function getLinksDetail(
|
79
|
+
export function getLinksDetail(_x, _x2) {
|
114
80
|
return _getLinksDetail.apply(this, arguments);
|
115
81
|
}
|
116
82
|
|
117
83
|
function _getLinksDetail() {
|
118
|
-
_getLinksDetail = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
84
|
+
_getLinksDetail = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(links, nodes) {
|
119
85
|
var linkCis, interfaceIds, interfaceTypes, interfaceCis, interfaceDoc;
|
120
|
-
return _regeneratorRuntime.wrap(function
|
86
|
+
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
121
87
|
while (1) {
|
122
|
-
switch (
|
88
|
+
switch (_context.prev = _context.next) {
|
123
89
|
case 0:
|
124
90
|
if (!(!links || !links.length)) {
|
125
|
-
|
91
|
+
_context.next = 2;
|
126
92
|
break;
|
127
93
|
}
|
128
94
|
|
129
|
-
return
|
95
|
+
return _context.abrupt("return", []);
|
130
96
|
|
131
97
|
case 2:
|
132
98
|
// const linkCis = await topoService.relation.batchQueryRelation(
|
133
99
|
// links.map((link) => link.id)
|
134
100
|
// );
|
135
101
|
linkCis = links;
|
136
|
-
interfaceIds = []
|
137
|
-
|
138
|
-
linkCis.
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
102
|
+
interfaceIds = [].concat(linkCis.map(function (item) {
|
103
|
+
return item.attributes.source_id;
|
104
|
+
}), linkCis.map(function (item) {
|
105
|
+
return item.attributes.destination_id;
|
106
|
+
}));
|
107
|
+
interfaceTypes = _.compact(_.uniq([].concat(linkCis.map(function (item) {
|
108
|
+
return item.attributes.source_type;
|
109
|
+
}), linkCis.map(function (item) {
|
110
|
+
return item.attributes.destination_type;
|
111
|
+
})))).filter(function (item) {
|
112
|
+
return item !== 'ip';
|
143
113
|
});
|
144
|
-
|
114
|
+
_context.next = 7;
|
145
115
|
return queryCisByIds(interfaceIds);
|
146
116
|
|
147
|
-
case
|
148
|
-
interfaceCis =
|
149
|
-
|
150
|
-
return
|
151
|
-
return item !== 'ip';
|
152
|
-
}));
|
117
|
+
case 7:
|
118
|
+
interfaceCis = _context.sent;
|
119
|
+
_context.next = 10;
|
120
|
+
return CiTypeCache.getCiTypeMap(interfaceTypes);
|
153
121
|
|
154
|
-
case
|
155
|
-
interfaceDoc =
|
156
|
-
return
|
122
|
+
case 10:
|
123
|
+
interfaceDoc = _context.sent;
|
124
|
+
return _context.abrupt("return", mergeLinksData(links, linkCis, nodes, interfaceCis, interfaceDoc));
|
157
125
|
|
158
|
-
case
|
126
|
+
case 12:
|
159
127
|
case "end":
|
160
|
-
return
|
128
|
+
return _context.stop();
|
161
129
|
}
|
162
130
|
}
|
163
|
-
},
|
131
|
+
}, _callee);
|
164
132
|
}));
|
165
133
|
return _getLinksDetail.apply(this, arguments);
|
166
134
|
}
|
@@ -0,0 +1,34 @@
|
|
1
|
+
import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
|
2
|
+
import _regeneratorRuntime from "@babel/runtime/regenerator";
|
3
|
+
import { request } from '@riil-frontend/component-topology-utils';
|
4
|
+
import { TOPO_API_ROOT } from "./constants";
|
5
|
+
export default {
|
6
|
+
/**
|
7
|
+
* 保存拓扑绘制数据(第三方库内部结构,无需关心含义)
|
8
|
+
* @param {Number} id Topo ID
|
9
|
+
* @param {String} data ht拓扑序列化数据
|
10
|
+
* @returns
|
11
|
+
*/
|
12
|
+
saveSerializeData: function saveSerializeData(id, data) {
|
13
|
+
return _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
|
14
|
+
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
15
|
+
while (1) {
|
16
|
+
switch (_context.prev = _context.next) {
|
17
|
+
case 0:
|
18
|
+
_context.next = 2;
|
19
|
+
return request.post(TOPO_API_ROOT + "/structure/" + id, {
|
20
|
+
data: data
|
21
|
+
});
|
22
|
+
|
23
|
+
case 2:
|
24
|
+
return _context.abrupt("return", _context.sent);
|
25
|
+
|
26
|
+
case 3:
|
27
|
+
case "end":
|
28
|
+
return _context.stop();
|
29
|
+
}
|
30
|
+
}
|
31
|
+
}, _callee);
|
32
|
+
}))();
|
33
|
+
}
|
34
|
+
};
|
@@ -0,0 +1 @@
|
|
1
|
+
export var TOPO_API_ROOT = '/topo/v1/api';
|
@@ -385,7 +385,12 @@ export default function (topoApp) {
|
|
385
385
|
alarmListDefaultOpen: displayConfig.alarmListDefaultOpen,
|
386
386
|
extraConfig: JSON.stringify(_extends({}, displayConfig, {
|
387
387
|
// 背景图,便于加载拓扑直接显示背景图
|
388
|
-
background: topoApp.store.getModelState("background").current
|
388
|
+
background: topoApp.store.getModelState("background").current,
|
389
|
+
// 增加保存日志,便于排查链路重复问题 2023-4-12 19:27:18
|
390
|
+
saveHistories: [{
|
391
|
+
date: new Date().toLocaleString(),
|
392
|
+
version: topoApp.version
|
393
|
+
}].concat(displayConfig.saveHistories || [])
|
389
394
|
}))
|
390
395
|
};
|
391
396
|
rlog.debug('saveGlobalConfig', config);
|
@@ -525,7 +525,7 @@ export default function ResourceOverview(props) {
|
|
525
525
|
ciType: ciType,
|
526
526
|
type: type,
|
527
527
|
// name: '123'
|
528
|
-
name: props.name
|
528
|
+
name: props.name ? props.name : props.resourceData.attributes.name
|
529
529
|
}; // 基本信息设置改变
|
530
530
|
|
531
531
|
function baseInfoColChange(_x5) {
|
@@ -954,7 +954,8 @@ export default function ResourceOverview(props) {
|
|
954
954
|
ciAttrAndMetricData: ciAttrAndMetricData
|
955
955
|
},
|
956
956
|
data: metric,
|
957
|
-
loading: metricInitLoading
|
957
|
+
loading: metricInitLoading,
|
958
|
+
formatMetricLatestValue: resourceOverviewProps.formatMetricLatestValue
|
958
959
|
})), /*#__PURE__*/React.createElement(EventsCard, {
|
959
960
|
alarmRiskList: alarmRiskList,
|
960
961
|
closeDetailDrawer: onClose,
|
@@ -60,7 +60,8 @@ export default function ResourceOverviewMetric(props) {
|
|
60
60
|
var topo = props.topo,
|
61
61
|
type = props.type,
|
62
62
|
data = props.data,
|
63
|
-
loading = props.loading
|
63
|
+
loading = props.loading,
|
64
|
+
formatMetricLatestValue = props.formatMetricLatestValue;
|
64
65
|
|
65
66
|
function formatValue(itemData) {
|
66
67
|
var _list;
|
@@ -69,7 +70,8 @@ export default function ResourceOverviewMetric(props) {
|
|
69
70
|
metricItem = itemData.metricItem,
|
70
71
|
list = itemData.list;
|
71
72
|
var format = metricValueFormat({
|
72
|
-
|
73
|
+
// 支持业务拓扑历史时间点指标值处理
|
74
|
+
value: formatMetricLatestValue ? formatMetricLatestValue(list) : (_list = list[list.length - 1]) === null || _list === void 0 ? void 0 : _list.metricValue,
|
73
75
|
dataType: metricItem.dataType,
|
74
76
|
dict: topo.dictCache.getDictObject(),
|
75
77
|
unit: metricItem.unit,
|
@@ -21,7 +21,7 @@ export default function useMetricPolling(_ref) {
|
|
21
21
|
|
22
22
|
|
23
23
|
var queryLinkMetricsRequest = useRequest(queryLinkLatestMetrics, {
|
24
|
-
pollingInterval:
|
24
|
+
pollingInterval: 60 * 1000,
|
25
25
|
pollingWhenHidden: false,
|
26
26
|
debounceInterval: 200,
|
27
27
|
manual: true,
|
@@ -31,7 +31,7 @@ export default function useMetricPolling(_ref) {
|
|
31
31
|
}
|
32
32
|
});
|
33
33
|
var queryInterfaceMetricsRequest = useRequest(queryLinkInterfacesLatestMetrics, {
|
34
|
-
pollingInterval:
|
34
|
+
pollingInterval: 60 * 1000,
|
35
35
|
pollingWhenHidden: false,
|
36
36
|
debounceInterval: 200,
|
37
37
|
manual: true,
|
@@ -92,9 +92,9 @@ var useMetricModels = function useMetricModels(props) {
|
|
92
92
|
}
|
93
93
|
|
94
94
|
var request = useRequest(fetchData, {
|
95
|
-
pollingInterval: 1000 *
|
96
|
-
|
97
|
-
// debounceInterval:
|
95
|
+
pollingInterval: 1000 * 60,
|
96
|
+
pollingWhenHidden: false,
|
97
|
+
// debounceInterval: 200,
|
98
98
|
manual: true,
|
99
99
|
onSuccess: function onSuccess(newMetricModels) {
|
100
100
|
var a = metricModels.map(function (item) {
|
@@ -532,7 +532,7 @@ export default _extends({
|
|
532
532
|
/**
|
533
533
|
* 保存拓扑绘制数据(第三方库内部结构,无需关心含义)
|
534
534
|
* @param {Number} id Topo ID
|
535
|
-
* @param {String} data
|
535
|
+
* @param {String} data ht拓扑序列化数据
|
536
536
|
* @returns
|
537
537
|
*/
|
538
538
|
saveSerializeData: function saveSerializeData(id, data) {
|
@@ -542,7 +542,9 @@ export default _extends({
|
|
542
542
|
switch (_context15.prev = _context15.next) {
|
543
543
|
case 0:
|
544
544
|
_context15.next = 2;
|
545
|
-
return request.post(API_ROOT + "/structure/" + id,
|
545
|
+
return request.post(API_ROOT + "/structure/" + id, {
|
546
|
+
data: data
|
547
|
+
});
|
546
548
|
|
547
549
|
case 2:
|
548
550
|
return _context15.abrupt("return", _context15.sent);
|
@@ -6,7 +6,6 @@ import _regeneratorRuntime from "@babel/runtime/regenerator";
|
|
6
6
|
* 链路新增、编辑 Model
|
7
7
|
*/
|
8
8
|
import rlog from '@riil-frontend/component-topology-utils/es/rlog';
|
9
|
-
import topoService from '@riil-frontend/component-topology-common/es/services/topo';
|
10
9
|
export default function (topoApp) {
|
11
10
|
return {
|
12
11
|
// 定义 model 的初始 state
|
@@ -8,7 +8,6 @@ import _regeneratorRuntime from "@babel/runtime/regenerator";
|
|
8
8
|
*
|
9
9
|
*/
|
10
10
|
import rlog from '@riil-frontend/component-topology-utils/es/rlog';
|
11
|
-
import topoService from '@riil-frontend/component-topology-common/es/services/topo';
|
12
11
|
export default {
|
13
12
|
// 定义 model 的初始 state
|
14
13
|
state: {
|
@@ -6,7 +6,6 @@ import _regeneratorRuntime from "@babel/runtime/regenerator";
|
|
6
6
|
* 拓扑链路相关 Model
|
7
7
|
*/
|
8
8
|
import rlog from "@riil-frontend/component-topology-utils/es/rlog";
|
9
|
-
import topoService from "@riil-frontend/component-topology-common/es/services/topo";
|
10
9
|
export default function (topoApp) {
|
11
10
|
return {
|
12
11
|
// 定义 model 的初始 state
|
@@ -62,11 +62,15 @@ function getResourceIcons(topo) {
|
|
62
62
|
|
63
63
|
|
64
64
|
function getBasicIcons(topo, containsGroupIcon) {
|
65
|
+
var nodeIcons = _manager["default"].iconLibManager.getNodeIcons().filter(function (icon) {
|
66
|
+
return !icon.ciType;
|
67
|
+
});
|
68
|
+
|
65
69
|
if (containsGroupIcon === false) {
|
66
|
-
return _basicIcons["default"];
|
70
|
+
return [].concat(nodeIcons, _basicIcons["default"]);
|
67
71
|
}
|
68
72
|
|
69
|
-
return [_manager["default"].iconLibManager.getGroupIcon()].concat(_basicIcons["default"]);
|
73
|
+
return [_manager["default"].iconLibManager.getGroupIcon()].concat(nodeIcons, _basicIcons["default"]);
|
70
74
|
}
|
71
75
|
|
72
76
|
function getGroupDefaultIcons(topo) {
|