@riil-frontend/component-topology 12.0.1 → 12.1.0-dev.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/1.js +1 -1
- package/build/index.js +14 -14
- package/es/core/editor/components/Toolbar/widgets/EdgeColorButton/EdgeColorButton.js +2 -2
- package/es/core/editor/components/Toolbar/widgets/EdgeTypeButton/LineType.js +5 -15
- package/es/core/editor/components/Toolbar/widgets/FontFamilyWidget.js +2 -27
- package/es/core/editor/components/Toolbar/widgets/FontSizeWidget.js +3 -28
- package/es/core/editor/components/Toolbar/widgets/FontStyleButton.js +6 -52
- package/es/core/editor/components/Toolbar/widgets/components/FontFamilySelect.js +29 -0
- package/es/core/editor/components/Toolbar/widgets/components/FontSizeSelect.js +29 -0
- package/es/core/editor/components/Toolbar/widgets/components/FontStyleSelect.js +71 -0
- package/es/core/editor/components/settings/propertyViews/view/GlobalEdgeToggle.js +2 -2
- package/es/core/editor/hooks/useNewElementTheme.js +20 -16
- package/es/core/editor/utils/edgeTypeStyleUtil.js +11 -32
- package/es/core/hooks/usePolling.js +2 -1
- package/es/core/hooks/useTopoEdit.js +169 -235
- package/es/core/models/AttributeMetricDisplay.js +2 -1
- package/es/core/models/HistoryManager.js +11 -9
- package/es/core/models/TopoApp.js +23 -31
- package/es/core/models/utils/linkUtils.js +36 -28
- package/es/core/store/models/topoConfig.js +2 -1
- package/es/core/utils/edgeUtil.js +7 -10
- package/es/core/viewer/components/plugins/ElementDetailDrawer/hooks/useElementDetailManager.js +2 -2
- package/es/networkTopo/models/EdgeGroupTagTipBuilder.js +7 -7
- package/es/networkTopo/models/LinkDynamicStyleExecutor.js +7 -63
- package/es/networkTopo/utils/edgeGroupTagUtil.js +2 -2
- package/es/utils/clusterUtil.js +3 -3
- package/es/utils/htElementUtils.js +16 -84
- package/lib/core/editor/components/Toolbar/widgets/EdgeColorButton/EdgeColorButton.js +2 -2
- package/lib/core/editor/components/Toolbar/widgets/EdgeTypeButton/LineType.js +5 -14
- package/lib/core/editor/components/Toolbar/widgets/FontFamilyWidget.js +3 -28
- package/lib/core/editor/components/Toolbar/widgets/FontSizeWidget.js +3 -28
- package/lib/core/editor/components/Toolbar/widgets/FontStyleButton.js +6 -56
- package/lib/core/editor/components/Toolbar/widgets/components/FontFamilySelect.js +38 -0
- package/lib/core/editor/components/Toolbar/widgets/components/FontSizeSelect.js +38 -0
- package/lib/core/editor/components/Toolbar/widgets/components/FontStyleSelect.js +83 -0
- package/lib/core/editor/components/settings/propertyViews/view/GlobalEdgeToggle.js +2 -2
- package/lib/core/editor/hooks/useNewElementTheme.js +20 -16
- package/lib/core/editor/utils/edgeTypeStyleUtil.js +10 -33
- package/lib/core/hooks/usePolling.js +6 -5
- package/lib/core/hooks/useTopoEdit.js +177 -261
- package/lib/core/models/AttributeMetricDisplay.js +6 -6
- package/lib/core/models/HistoryManager.js +13 -17
- package/lib/core/models/TopoApp.js +22 -29
- package/lib/core/models/utils/linkUtils.js +36 -27
- package/lib/core/store/models/topoConfig.js +9 -16
- package/lib/core/utils/edgeUtil.js +8 -10
- package/lib/core/viewer/components/plugins/ElementDetailDrawer/hooks/useElementDetailManager.js +3 -2
- package/lib/networkTopo/models/EdgeGroupTagTipBuilder.js +6 -6
- package/lib/networkTopo/models/LinkDynamicStyleExecutor.js +6 -64
- package/lib/networkTopo/utils/edgeGroupTagUtil.js +2 -2
- package/lib/utils/clusterUtil.js +2 -2
- package/lib/utils/htElementUtils.js +19 -93
- package/package.json +2 -2
- package/es/networkTopo/models/LinkTagsTipsBuilder.js +0 -235
- package/lib/networkTopo/models/LinkTagsTipsBuilder.js +0 -245
@@ -11,7 +11,7 @@ var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/
|
|
11
11
|
|
12
12
|
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
13
13
|
|
14
|
-
var
|
14
|
+
var _loglevel = _interopRequireDefault(require("loglevel"));
|
15
15
|
|
16
16
|
var _ResourceInfoDisplay = require("../../constants/ResourceInfoDisplay");
|
17
17
|
|
@@ -25,6 +25,8 @@ var _nodeNameVisibleUtil = require("./utils/nodeNameVisibleUtil");
|
|
25
25
|
|
26
26
|
var _ciRefAttributeTranslateUtil = require("../../utils/ciRefAttributeTranslateUtil");
|
27
27
|
|
28
|
+
var rlog = _loglevel["default"].getLogger('topo');
|
29
|
+
|
28
30
|
function isGraphField(item) {
|
29
31
|
return item.type === 'graph';
|
30
32
|
}
|
@@ -451,7 +453,7 @@ var AttributeMetricDisplay = /*#__PURE__*/function () {
|
|
451
453
|
});
|
452
454
|
});
|
453
455
|
} else {
|
454
|
-
|
456
|
+
rlog.warn("\u63A8\u9001\u5C5E\u6027\u6307\u6807\u6570\u636E\uFF1A\u672A\u67E5\u8BE2\u5230ciType " + ciType, ciData);
|
455
457
|
}
|
456
458
|
});
|
457
459
|
refIds = Object.keys(refIdMap);
|
@@ -540,9 +542,7 @@ var AttributeMetricDisplay = /*#__PURE__*/function () {
|
|
540
542
|
tags: tags
|
541
543
|
});
|
542
544
|
});
|
543
|
-
|
544
|
-
_componentTopologyUtils.rlog.debug('推送标注 => ht', elementTagsAndTips);
|
545
|
-
|
545
|
+
rlog.debug('推送标注 => ht', elementTagsAndTips);
|
546
546
|
var htTopo = topo.getHtTopo();
|
547
547
|
|
548
548
|
if (htTopo) {
|
@@ -553,7 +553,7 @@ var AttributeMetricDisplay = /*#__PURE__*/function () {
|
|
553
553
|
try {
|
554
554
|
htTopo.loadTagAndTip(JSON.parse(JSON.stringify(elementTagsAndTips)));
|
555
555
|
} catch (error) {
|
556
|
-
|
556
|
+
rlog.error('推送标注 => ht 失败', error);
|
557
557
|
}
|
558
558
|
|
559
559
|
(_topo$historyManager2 = topo.historyManager) === null || _topo$historyManager2 === void 0 ? void 0 : _topo$historyManager2.setDisabled(false, '加载标注');
|
@@ -9,6 +9,10 @@ var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends")
|
|
9
9
|
|
10
10
|
var _componentTopologyUtils = require("@riil-frontend/component-topology-utils");
|
11
11
|
|
12
|
+
var _loglevel = _interopRequireDefault(require("loglevel"));
|
13
|
+
|
14
|
+
var log = _loglevel["default"].getLogger('topo.HistoryManager');
|
15
|
+
|
12
16
|
var ht = window.ht;
|
13
17
|
|
14
18
|
var HistoryManager = /*#__PURE__*/function () {
|
@@ -19,9 +23,7 @@ var HistoryManager = /*#__PURE__*/function () {
|
|
19
23
|
this.topo = topo;
|
20
24
|
this.htHistoryManager = htHistoryManager;
|
21
25
|
htHistoryManager.clear();
|
22
|
-
|
23
|
-
_componentTopologyUtils.rlog.info('HistoryManager 初始化', htHistoryManager);
|
24
|
-
|
26
|
+
log.info('HistoryManager 初始化', htHistoryManager);
|
25
27
|
this.updateStore = this.updateStore.bind(this);
|
26
28
|
this.init();
|
27
29
|
}
|
@@ -69,11 +71,10 @@ var HistoryManager = /*#__PURE__*/function () {
|
|
69
71
|
|
70
72
|
_proto.setDisabled = function setDisabled(disabled, message) {
|
71
73
|
this.htHistoryManager.setDisabled(disabled);
|
72
|
-
|
73
|
-
_componentTopologyUtils.rlog.debug("HistoryManager.setDisabled " + (disabled ? '禁用' : '启用') + (message ? "(" + message + ")" : '') + ": " + this.toString(), this.getHistories());
|
74
|
+
log.debug("HistoryManager.setDisabled " + (disabled ? '禁用' : '启用') + (message ? "(" + message + ")" : '') + ": " + this.toString(), this.getHistories());
|
74
75
|
};
|
75
76
|
|
76
|
-
_proto.beginTransaction = function beginTransaction() {
|
77
|
+
_proto.beginTransaction = function beginTransaction(name) {
|
77
78
|
var _this = this;
|
78
79
|
|
79
80
|
this.htHistoryManager.beginTransaction();
|
@@ -104,8 +105,7 @@ var HistoryManager = /*#__PURE__*/function () {
|
|
104
105
|
oldValue: _this.topo.store.getModelState(item.modelName)[item.property]
|
105
106
|
});
|
106
107
|
});
|
107
|
-
|
108
|
-
_componentTopologyUtils.rlog.debug("HistoryManager.beginTransaction: " + this.toString(), this.getHistories());
|
108
|
+
log.debug("HistoryManager.beginTransaction: " + this.toString(), this.getHistories());
|
109
109
|
};
|
110
110
|
|
111
111
|
_proto.addStoreHistory = function addStoreHistory() {
|
@@ -130,18 +130,16 @@ var HistoryManager = /*#__PURE__*/function () {
|
|
130
130
|
type: 'store',
|
131
131
|
data: storeChanged
|
132
132
|
});
|
133
|
-
|
134
|
-
_componentTopologyUtils.rlog.debug('HistoryManager.addStoreHistory', storeChanged);
|
133
|
+
log.debug('HistoryManager.addStoreHistory', storeChanged);
|
135
134
|
}
|
136
135
|
|
137
136
|
this.storeHistory = [];
|
138
137
|
};
|
139
138
|
|
140
|
-
_proto.endTransaction = function endTransaction() {
|
139
|
+
_proto.endTransaction = function endTransaction(name) {
|
141
140
|
this.addStoreHistory();
|
142
141
|
this.htHistoryManager.endTransaction();
|
143
|
-
|
144
|
-
_componentTopologyUtils.rlog.debug("HistoryManager.endTransaction: " + this.toString(), this.getHistories());
|
142
|
+
log.debug("HistoryManager.endTransaction: " + this.toString(), this.getHistories());
|
145
143
|
};
|
146
144
|
|
147
145
|
_proto.clear = function clear() {
|
@@ -185,8 +183,7 @@ var HistoryManager = /*#__PURE__*/function () {
|
|
185
183
|
return;
|
186
184
|
}
|
187
185
|
|
188
|
-
|
189
|
-
|
186
|
+
log.debug('HistoryManager.undo', this.getHistories(), this.getHistoryIndex());
|
190
187
|
var storeHistory = this.getCurrentStoreHistory(true);
|
191
188
|
|
192
189
|
if (storeHistory) {
|
@@ -204,8 +201,7 @@ var HistoryManager = /*#__PURE__*/function () {
|
|
204
201
|
_proto.redo = function redo() {
|
205
202
|
var _this4 = this;
|
206
203
|
|
207
|
-
|
208
|
-
|
204
|
+
log.debug('HistoryManager.redo', this.getHistories(), this.getHistoryIndex());
|
209
205
|
var storeHistory = this.getCurrentStoreHistory(false);
|
210
206
|
|
211
207
|
if (storeHistory) {
|
@@ -54,7 +54,7 @@ var _SelectionModel = _interopRequireDefault(require("./SelectionModel"));
|
|
54
54
|
var _CiCache = _interopRequireDefault(require("./cache/CiCache"));
|
55
55
|
|
56
56
|
// eslint-disable-next-line no-undef
|
57
|
-
var version = typeof "12.0.
|
57
|
+
var version = typeof "12.1.0-dev.10" === 'string' ? "12.1.0-dev.10" : null;
|
58
58
|
console.info("\u62D3\u6251\u7248\u672C: " + version);
|
59
59
|
/**
|
60
60
|
* 拓扑显示和编辑
|
@@ -218,37 +218,29 @@ var Topo = /*#__PURE__*/function () {
|
|
218
218
|
|
219
219
|
_proto.getData = function getData() {
|
220
220
|
return {
|
221
|
-
groups: this.
|
222
|
-
nodes:
|
223
|
-
|
221
|
+
groups: (0, _htElementUtils.getGroupDatas)(this.getDataModel()),
|
222
|
+
nodes: (0, _htElementUtils.getNodes)(this.getDataModel()).filter(function (node) {
|
223
|
+
return !!node.getTag();
|
224
|
+
}).map(_htElementUtils.getNodeData),
|
224
225
|
customNodes: (0, _htElementUtils.getNodeDatas)(this.getDataModel()).filter(function (item) {
|
225
226
|
return !item.id;
|
226
227
|
}),
|
227
|
-
|
228
|
+
lines: (0, _htElementUtils.getEdgeDatas)(this.getDataModel()).filter(function (item) {
|
229
|
+
return !!item.id;
|
230
|
+
}),
|
231
|
+
customLines: (0, _htElementUtils.getEdgeDatas)(this.getDataModel()).filter(function (item) {
|
228
232
|
return !item.id;
|
229
233
|
})
|
230
234
|
};
|
231
|
-
}
|
232
|
-
|
233
|
-
|
234
|
-
|
235
|
-
|
236
|
-
|
237
|
-
_proto.getNodes = function getNodes() {
|
238
|
-
var nodes = (0, _htElementUtils.getNodes)(this.getDataModel()).filter(function (node) {
|
239
|
-
return !!node.getTag();
|
240
|
-
});
|
241
|
-
return nodes.map(_htElementUtils.getNodeData);
|
242
|
-
};
|
235
|
+
}
|
236
|
+
/**
|
237
|
+
* @deprecated 待移除。uicbb有使用
|
238
|
+
* @returns
|
239
|
+
*/
|
240
|
+
;
|
243
241
|
|
244
242
|
_proto.getLines = function getLines() {
|
245
|
-
return this.
|
246
|
-
return !!item.id;
|
247
|
-
});
|
248
|
-
};
|
249
|
-
|
250
|
-
_proto.getEdges = function getEdges() {
|
251
|
-
return (0, _htElementUtils.getEdgeDatas)(this.getDataModel());
|
243
|
+
return this.getData().lines;
|
252
244
|
}
|
253
245
|
/**
|
254
246
|
* 全量更新数据
|
@@ -307,18 +299,19 @@ var Topo = /*#__PURE__*/function () {
|
|
307
299
|
/*#__PURE__*/
|
308
300
|
function () {
|
309
301
|
var _addElements = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee5(elements) {
|
310
|
-
var data;
|
302
|
+
var prevData, data;
|
311
303
|
return _regenerator["default"].wrap(function _callee5$(_context5) {
|
312
304
|
while (1) switch (_context5.prev = _context5.next) {
|
313
305
|
case 0:
|
306
|
+
prevData = this.getData();
|
314
307
|
data = {
|
315
|
-
groups: [].concat(
|
316
|
-
nodes: [].concat(
|
317
|
-
lines: [].concat(
|
308
|
+
groups: [].concat(prevData.groups, elements.groups || []),
|
309
|
+
nodes: [].concat(prevData.nodes, elements.nodes || []),
|
310
|
+
lines: [].concat(prevData.lines, elements.lines || [])
|
318
311
|
};
|
319
312
|
this.updateElements(data); // TODO 更新store,触发属性、指标模型加载,更新指标
|
320
313
|
|
321
|
-
case
|
314
|
+
case 3:
|
322
315
|
case "end":
|
323
316
|
return _context5.stop();
|
324
317
|
}
|
@@ -6,6 +6,7 @@ exports.__esModule = true;
|
|
6
6
|
exports.buildTopoLinkData = buildTopoLinkData;
|
7
7
|
exports.compatibleWith = void 0;
|
8
8
|
exports.getLinksDetail = getLinksDetail;
|
9
|
+
exports.isAggLink = isAggLink;
|
9
10
|
exports.isCrucialLink = isCrucialLink;
|
10
11
|
exports.isExitLink = isExitLink;
|
11
12
|
exports.mergeExportLinkData = void 0;
|
@@ -22,8 +23,6 @@ var _keyBy = _interopRequireDefault(require("lodash/keyBy"));
|
|
22
23
|
|
23
24
|
var _lodash = _interopRequireDefault(require("lodash"));
|
24
25
|
|
25
|
-
var _services = require("../../services");
|
26
|
-
|
27
26
|
var _htElementUtils = require("../../../utils/htElementUtils");
|
28
27
|
|
29
28
|
var _CiTypeCache = _interopRequireDefault(require("../cache/CiTypeCache"));
|
@@ -56,7 +55,21 @@ function isCrucialLink(link) {
|
|
56
55
|
|
57
56
|
|
58
57
|
function isExitLink(link) {
|
59
|
-
|
58
|
+
var _link$attributes;
|
59
|
+
|
60
|
+
return (link === null || link === void 0 ? void 0 : (_link$attributes = link.attributes) === null || _link$attributes === void 0 ? void 0 : _link$attributes.destination_type) === "ip";
|
61
|
+
}
|
62
|
+
/**
|
63
|
+
* 是否聚合链路
|
64
|
+
* @param {*} link
|
65
|
+
* @returns
|
66
|
+
*/
|
67
|
+
|
68
|
+
|
69
|
+
function isAggLink(link) {
|
70
|
+
var _link$attributes2, _link$attributes3;
|
71
|
+
|
72
|
+
return (link === null || link === void 0 ? void 0 : (_link$attributes2 = link.attributes) === null || _link$attributes2 === void 0 ? void 0 : _link$attributes2.destination_type) === "network.agg_interface" && (link === null || link === void 0 ? void 0 : (_link$attributes3 = link.attributes) === null || _link$attributes3 === void 0 ? void 0 : _link$attributes3.source_type) === "network.agg_interface";
|
60
73
|
}
|
61
74
|
|
62
75
|
function mergeLinksData(links, linkCis, nodes, interfaceCiMap, interfaceDoc) {
|
@@ -107,7 +120,7 @@ function _getLinksDetail() {
|
|
107
120
|
return _regenerator["default"].wrap(function _callee$(_context) {
|
108
121
|
while (1) switch (_context.prev = _context.next) {
|
109
122
|
case 0:
|
110
|
-
if (
|
123
|
+
if (links !== null && links !== void 0 && links.length) {
|
111
124
|
_context.next = 2;
|
112
125
|
break;
|
113
126
|
}
|
@@ -115,9 +128,6 @@ function _getLinksDetail() {
|
|
115
128
|
return _context.abrupt("return", []);
|
116
129
|
|
117
130
|
case 2:
|
118
|
-
// const linkCis = await topoService.relation.batchQueryRelation(
|
119
|
-
// links.map((link) => link.id)
|
120
|
-
// );
|
121
131
|
linkCis = links;
|
122
132
|
interfaceIds = [].concat(linkCis.map(function (item) {
|
123
133
|
return item.attributes.source_id;
|
@@ -176,7 +186,8 @@ var plurals = {
|
|
176
186
|
2: ["phy"],
|
177
187
|
3: ["agg"],
|
178
188
|
4: ["phy", "agg"]
|
179
|
-
};
|
189
|
+
}; // 待办:移到网络拓扑组件
|
190
|
+
|
180
191
|
exports.plurals = plurals;
|
181
192
|
|
182
193
|
var showLinkByConfig = function showLinkByConfig(props) {
|
@@ -190,31 +201,29 @@ var showLinkByConfig = function showLinkByConfig(props) {
|
|
190
201
|
|
191
202
|
var gv = topo.getGraphView();
|
192
203
|
var dm = gv.getDataModel();
|
193
|
-
var edges = (0, _htElementUtils.getEdges)(dm)
|
204
|
+
var edges = (0, _htElementUtils.getEdges)(dm).filter(function (edge) {
|
205
|
+
return !(0, _htElementUtils.isEdgeGroupAgent)(edge);
|
206
|
+
}); // console.log("edges", edges);
|
194
207
|
|
195
208
|
var showPhy = types.indexOf("phy") >= 0;
|
196
209
|
var showAgg = types.indexOf("agg") >= 0; // console.log("edges----types",showType, types,showPhy, showAgg);
|
197
210
|
|
198
|
-
|
199
|
-
|
200
|
-
|
201
|
-
|
202
|
-
|
203
|
-
|
204
|
-
|
205
|
-
var _d$attributes, _d$attributes2;
|
206
|
-
|
207
|
-
var d = topo.dataModel.getDataById(edge.getTag()); // 判断是否聚合链路
|
211
|
+
edges.forEach(function (edge) {
|
212
|
+
if (showType === 1 || showType === true) {
|
213
|
+
// 单链路全部显示
|
214
|
+
// console.log("单链路全部显示", edge);
|
215
|
+
edge.s("x.visible", true);
|
216
|
+
} else {
|
217
|
+
var d = topo.dataModel.getDataById(edge.getTag()); // 判断是否聚合链路
|
208
218
|
|
209
|
-
|
210
|
-
|
211
|
-
|
212
|
-
|
213
|
-
|
214
|
-
}
|
219
|
+
if (isAggLink(d)) {
|
220
|
+
edge.s("x.visible", showAgg);
|
221
|
+
} else {
|
222
|
+
// console.log("edge", edge, d, showAgg);
|
223
|
+
edge.s("x.visible", showPhy);
|
215
224
|
}
|
216
|
-
}
|
217
|
-
}
|
225
|
+
}
|
226
|
+
});
|
218
227
|
};
|
219
228
|
|
220
229
|
exports.showLinkByConfig = showLinkByConfig;
|
@@ -17,7 +17,7 @@ var _utils2 = require("@riil-frontend/component-topology-graph/es/utils");
|
|
17
17
|
|
18
18
|
var _topo = require("@riil-frontend/component-topology-common/es/services/topo");
|
19
19
|
|
20
|
-
var
|
20
|
+
var _loglevel = _interopRequireDefault(require("loglevel"));
|
21
21
|
|
22
22
|
var _format = require("../../../utils/format");
|
23
23
|
|
@@ -34,6 +34,8 @@ var _getTopoData = require("../../../networkTopo/getTopoData");
|
|
34
34
|
/**
|
35
35
|
* 拓扑配置
|
36
36
|
*/
|
37
|
+
var rlog = _loglevel["default"].getLogger('topo');
|
38
|
+
|
37
39
|
var newGroupWithUUID = function newGroupWithUUID(group) {
|
38
40
|
if (group === void 0) {
|
39
41
|
group = _template.DEFAULT_GROUP;
|
@@ -96,7 +98,7 @@ function conditionToRes(conditions) {
|
|
96
98
|
}
|
97
99
|
|
98
100
|
function updateGroupData(groups, index, data) {
|
99
|
-
|
101
|
+
rlog.debug("容器侦查-----updateGroupData", groups, index, data);
|
100
102
|
|
101
103
|
if (groups && groups[index]) {
|
102
104
|
var group = (0, _extends2["default"])({}, groups[index], data);
|
@@ -276,15 +278,13 @@ function _default(topoApp) {
|
|
276
278
|
|
277
279
|
case 5:
|
278
280
|
data = _context2.sent;
|
279
|
-
|
280
|
-
_rlog["default"].debug("按配置查询拓扑数据", {
|
281
|
+
rlog.debug("按配置查询拓扑数据", {
|
281
282
|
config: {
|
282
283
|
resources: resources,
|
283
284
|
groups: groups
|
284
285
|
},
|
285
286
|
data: data
|
286
287
|
});
|
287
|
-
|
288
288
|
return _context2.abrupt("return", data);
|
289
289
|
|
290
290
|
case 8:
|
@@ -325,8 +325,7 @@ function _default(topoApp) {
|
|
325
325
|
return _regenerator["default"].wrap(function _callee4$(_context4) {
|
326
326
|
while (1) switch (_context4.prev = _context4.next) {
|
327
327
|
case 0:
|
328
|
-
|
329
|
-
|
328
|
+
rlog.debug("getTopoByConditions--------", params);
|
330
329
|
topoId = params.id, resources = params.resources, groups = params.groups;
|
331
330
|
viewConditions = (0, _topoData2.resToConditions)(resources);
|
332
331
|
groupInfo = (0, _utils.isAvailableArray)(groups) && groups.map(function (group) {
|
@@ -335,17 +334,13 @@ function _default(topoApp) {
|
|
335
334
|
resources: (0, _topoData2.resToConditions)(group.resources)
|
336
335
|
});
|
337
336
|
});
|
338
|
-
|
339
|
-
_rlog["default"].debug("getTopoByConditions--------", viewConditions, groupInfo);
|
340
|
-
|
337
|
+
rlog.debug("getTopoByConditions--------", viewConditions, groupInfo);
|
341
338
|
_context4.next = 7;
|
342
339
|
return topoApp.serverApi.getTopoDataByResource(topoId, viewConditions, groupInfo);
|
343
340
|
|
344
341
|
case 7:
|
345
342
|
data = _context4.sent;
|
346
|
-
|
347
|
-
_rlog["default"].debug("getTopoByConditions--------data", data);
|
348
|
-
|
343
|
+
rlog.debug("getTopoByConditions--------data", data);
|
349
344
|
_context4.next = 11;
|
350
345
|
return (0, _getTopoData.buildData)(data);
|
351
346
|
|
@@ -408,9 +403,7 @@ function _default(topoApp) {
|
|
408
403
|
}].concat(displayConfig.saveHistories || [])
|
409
404
|
}))
|
410
405
|
};
|
411
|
-
|
412
|
-
_rlog["default"].debug("saveGlobalConfig", config);
|
413
|
-
|
406
|
+
rlog.debug("saveGlobalConfig", config);
|
414
407
|
_context5.next = 5;
|
415
408
|
return topoApp.serverApi.saveTopoSettings(topoApp.id, config);
|
416
409
|
|
@@ -10,12 +10,14 @@ var _rlog = _interopRequireDefault(require("@riil-frontend/component-topology-ut
|
|
10
10
|
|
11
11
|
var _linkUtils = require("../models/utils/linkUtils");
|
12
12
|
|
13
|
+
var _htElementUtils = require("../../utils/htElementUtils");
|
14
|
+
|
13
15
|
/**
|
14
16
|
* 是否手工连线
|
15
17
|
* @param {*} edge
|
16
18
|
*/
|
17
19
|
function isCustomEdge(edge) {
|
18
|
-
return !
|
20
|
+
return !(0, _htElementUtils.isEdgeGroupAgent)(edge) && (edge.a('type') == 'line' || !edge.a('type'));
|
19
21
|
}
|
20
22
|
/**
|
21
23
|
* 根据配置更新连线展开折叠状态
|
@@ -25,7 +27,7 @@ function isCustomEdge(edge) {
|
|
25
27
|
|
26
28
|
|
27
29
|
var updateEdgeExpanded = function updateEdgeExpanded(topo) {
|
28
|
-
var _topo$historyManager, _topo$historyManager2;
|
30
|
+
var _topo$historyManager, _topo$historyManager2, _topo$linkDynamicStyl;
|
29
31
|
|
30
32
|
var _topo$store$getModelS = topo.store.getModelState("topoMod"),
|
31
33
|
viewState = _topo$store$getModelS.viewState;
|
@@ -38,8 +40,7 @@ var updateEdgeExpanded = function updateEdgeExpanded(topo) {
|
|
38
40
|
}
|
39
41
|
|
40
42
|
var _topo$store$getModelS2 = topo.store.getModelState("displayConfig"),
|
41
|
-
expandAllEdges = _topo$store$getModelS2.expandAllEdges;
|
42
|
-
|
43
|
+
expandAllEdges = _topo$store$getModelS2.expandAllEdges;
|
43
44
|
|
44
45
|
(_topo$historyManager = topo.historyManager) === null || _topo$historyManager === void 0 ? void 0 : _topo$historyManager.setDisabled(true, '连线展开控制');
|
45
46
|
|
@@ -48,11 +49,11 @@ var updateEdgeExpanded = function updateEdgeExpanded(topo) {
|
|
48
49
|
topo: topo,
|
49
50
|
showType: 1
|
50
51
|
});
|
51
|
-
htTopo.
|
52
|
+
htTopo.toggleAllEdgeGroups(false);
|
52
53
|
|
53
54
|
_rlog["default"].debug("updateEdgeExpanded 折叠");
|
54
55
|
} else {
|
55
|
-
htTopo.
|
56
|
+
htTopo.toggleAllEdgeGroups(true);
|
56
57
|
(0, _linkUtils.showLinkByConfig)({
|
57
58
|
topo: topo,
|
58
59
|
showType: expandAllEdges,
|
@@ -63,10 +64,7 @@ var updateEdgeExpanded = function updateEdgeExpanded(topo) {
|
|
63
64
|
}
|
64
65
|
|
65
66
|
(_topo$historyManager2 = topo.historyManager) === null || _topo$historyManager2 === void 0 ? void 0 : _topo$historyManager2.setDisabled(false, '连线展开控制');
|
66
|
-
|
67
|
-
if (topo.linkDynamicStyleExecutor) {
|
68
|
-
topo.linkDynamicStyleExecutor.execute();
|
69
|
-
}
|
67
|
+
(_topo$linkDynamicStyl = topo.linkDynamicStyleExecutor) === null || _topo$linkDynamicStyl === void 0 ? void 0 : _topo$linkDynamicStyl.execute();
|
70
68
|
};
|
71
69
|
|
72
70
|
exports.updateEdgeExpanded = updateEdgeExpanded;
|
package/lib/core/viewer/components/plugins/ElementDetailDrawer/hooks/useElementDetailManager.js
CHANGED
@@ -9,6 +9,8 @@ var _react = _interopRequireWildcard(require("react"));
|
|
9
9
|
|
10
10
|
var _DefaultDetailContent = _interopRequireDefault(require("../../ResourceDetail/DefaultDetailContent"));
|
11
11
|
|
12
|
+
var _htElementUtils = require("../../../../../../utils/htElementUtils");
|
13
|
+
|
12
14
|
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); }
|
13
15
|
|
14
16
|
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; }
|
@@ -74,9 +76,8 @@ function useElementDetailManager(props) {
|
|
74
76
|
}
|
75
77
|
|
76
78
|
function openByHtElement(htElement) {
|
77
|
-
var isEdgeGroupAgent = htElement instanceof ht.Edge && htElement.isEdgeGroupAgent() && !htElement.s('edge.expanded');
|
78
79
|
open({
|
79
|
-
id: isEdgeGroupAgent || !htElement.getTag() ? "ht:" + htElement.getId() : htElement.getTag(),
|
80
|
+
id: (0, _htElementUtils.isEdgeGroupAgent)(htElement) || !htElement.getTag() ? "ht:" + htElement.getId() : htElement.getTag(),
|
80
81
|
htElement: htElement
|
81
82
|
});
|
82
83
|
}
|
@@ -22,11 +22,11 @@ var EdgeGroupTagTipBuilder = /*#__PURE__*/function () {
|
|
22
22
|
|
23
23
|
var topo = this.topo;
|
24
24
|
var dm = this.topo.getDataModel();
|
25
|
-
var
|
26
|
-
|
27
|
-
|
28
|
-
var linkId = (0, _edgeGroupTagUtil.getEdgeGroupLinkIdConfig)(
|
29
|
-
var edgeGroupId = [
|
25
|
+
var edgeGroupAgents = (0, _htElementUtils.getEdgeGroupAgents)(dm);
|
26
|
+
var edgeGroupsTagsTips = edgeGroupAgents.map(function (edgeGroupAgent) {
|
27
|
+
// 获取配置的链路
|
28
|
+
var linkId = (0, _edgeGroupTagUtil.getEdgeGroupLinkIdConfig)(edgeGroupAgent, topo);
|
29
|
+
var edgeGroupId = [edgeGroupAgent.getSource().getId(), edgeGroupAgent.getTarget().getId()];
|
30
30
|
var data = {
|
31
31
|
tags: [],
|
32
32
|
tips: []
|
@@ -37,7 +37,7 @@ var EdgeGroupTagTipBuilder = /*#__PURE__*/function () {
|
|
37
37
|
}
|
38
38
|
|
39
39
|
return {
|
40
|
-
htId:
|
40
|
+
htId: edgeGroupAgent.getId(),
|
41
41
|
edgeGroupId: edgeGroupId,
|
42
42
|
tags: data.tags,
|
43
43
|
tips: data.tips,
|
@@ -3,14 +3,10 @@
|
|
3
3
|
exports.__esModule = true;
|
4
4
|
exports["default"] = void 0;
|
5
5
|
|
6
|
-
var _componentTopologyUtils = require("@riil-frontend/component-topology-utils");
|
7
|
-
|
8
6
|
var _clusterUtil = require("../../utils/clusterUtil");
|
9
7
|
|
10
8
|
var _htElementUtils = require("../../utils/htElementUtils");
|
11
9
|
|
12
|
-
var _linkUtil = require("../utils/linkUtil");
|
13
|
-
|
14
10
|
// network_link.actual_bandwidth
|
15
11
|
function calcEdgeWidth(actualBandwidth) {
|
16
12
|
if (!actualBandwidth) {
|
@@ -61,16 +57,17 @@ var LinkDynamicStyleExecutor = /*#__PURE__*/function () {
|
|
61
57
|
var _proto = LinkDynamicStyleExecutor.prototype;
|
62
58
|
|
63
59
|
_proto.execute = function execute() {
|
64
|
-
var
|
60
|
+
var _topo$historyManager,
|
61
|
+
_this = this,
|
62
|
+
_topo$historyManager2;
|
65
63
|
|
66
64
|
var topo = this.topo;
|
67
65
|
|
68
66
|
var _topo$dataModel$getDa = topo.dataModel.getData(),
|
69
|
-
links = _topo$dataModel$getDa.links
|
70
|
-
linkGroups = _topo$dataModel$getDa.linkGroups;
|
67
|
+
links = _topo$dataModel$getDa.links;
|
71
68
|
|
72
69
|
var dataModel = this.topo.getDataModel();
|
73
|
-
|
70
|
+
(_topo$historyManager = topo.historyManager) === null || _topo$historyManager === void 0 ? void 0 : _topo$historyManager.setDisabled(true, '链路动态样式'); // 1、如果连线可见,设置线宽
|
74
71
|
|
75
72
|
links.forEach(function (link) {
|
76
73
|
var edge = dataModel.getDataByTag(link.id);
|
@@ -78,63 +75,8 @@ var LinkDynamicStyleExecutor = /*#__PURE__*/function () {
|
|
78
75
|
if (edge) {
|
79
76
|
edge.s('edge.width', _this.calcLinkEdgeWidth(link));
|
80
77
|
}
|
81
|
-
}); // 2、如果连线组关联链路并可见,设置线宽
|
82
|
-
|
83
|
-
linkGroups.forEach(function (link) {
|
84
|
-
// 聚合链路是连线/连线组,并可以查询到
|
85
|
-
var edge = topo.getDataModel().getDataByTag(link.id);
|
86
|
-
|
87
|
-
if (edge) {
|
88
|
-
edge.s('edge.width', _this.calcLinkEdgeWidth(link));
|
89
|
-
return;
|
90
|
-
} // 聚合链路是连线组(编辑模式还未关联业务信息)
|
91
|
-
|
92
|
-
|
93
|
-
var edgeGroup = (0, _htElementUtils.getEdgeGroupByNodeTags)(dataModel, link.source, link.target);
|
94
|
-
|
95
|
-
if (edgeGroup) {
|
96
|
-
var edgeGroupAgent = edgeGroup.getEdgeGroupAgent(); // 判断是显示的连线组元素
|
97
|
-
|
98
|
-
if (edgeGroupAgent) {
|
99
|
-
edgeGroup.getEdgeGroupAgent().s('edge.width', _this.calcLinkEdgeWidth(link));
|
100
|
-
}
|
101
|
-
} else {
|
102
|
-
_componentTopologyUtils.rlog.warn('动态链路样式执行:未找到聚合链路的ht元素', link);
|
103
|
-
}
|
104
|
-
}); // 3、如果连线组未关联链路并可见,设置线宽。
|
105
|
-
|
106
|
-
var edges = (0, _htElementUtils.getEdges)(dataModel);
|
107
|
-
edges.forEach(function (edge) {
|
108
|
-
try {
|
109
|
-
// 获取两端代理节点
|
110
|
-
var sourceAgent = edge.getSourceAgent();
|
111
|
-
var targetAgent = edge.getTargetAgent();
|
112
|
-
var sourceId = sourceAgent.getTag();
|
113
|
-
var targetId = targetAgent.getTag(); // 查询是否有聚合链路
|
114
|
-
|
115
|
-
var aggLink = linkGroups.find(function (link) {
|
116
|
-
return link.source === sourceId && link.target === targetId || link.target === sourceId && link.source === targetId;
|
117
|
-
}); // 如果连线组未关联链路并可见
|
118
|
-
|
119
|
-
if (!aggLink && edge.isEdgeGroupAgent()) {
|
120
|
-
// 查询两端代理节点(包含子节点)间的子链路列表
|
121
|
-
var sourceCiIds = getChildrenNodeCiIds([sourceAgent]);
|
122
|
-
var targetCiIds = getChildrenNodeCiIds([targetAgent]);
|
123
|
-
var aggLinks = (0, _linkUtil.getLinksBetweenNodes)(linkGroups, sourceCiIds, targetCiIds);
|
124
|
-
var phyLinks = (0, _linkUtil.getLinksBetweenNodes)(links, sourceCiIds, targetCiIds);
|
125
|
-
var linkBetweenNodes = aggLinks.length ? aggLinks : phyLinks; // 如果有子链路,计算线宽并设置
|
126
|
-
|
127
|
-
if (linkBetweenNodes.length) {
|
128
|
-
var edgeWidth = _this.calcEdgeGroupEdgeWidth(linkBetweenNodes);
|
129
|
-
|
130
|
-
edge.s('edge.width', edgeWidth);
|
131
|
-
}
|
132
|
-
}
|
133
|
-
} catch (error) {
|
134
|
-
_componentTopologyUtils.rlog.error('连线组未关联链路并可见,设置线宽:异常', edge, error);
|
135
|
-
}
|
136
78
|
});
|
137
|
-
topo.historyManager
|
79
|
+
(_topo$historyManager2 = topo.historyManager) === null || _topo$historyManager2 === void 0 ? void 0 : _topo$historyManager2.setDisabled(false, '链路动态样式');
|
138
80
|
}
|
139
81
|
/**
|
140
82
|
* 处理单个连线组切换。有链路时设置
|
@@ -65,8 +65,8 @@ function getEdgeGroupLinkIdConfig(edgeGroup, topo) {
|
|
65
65
|
}
|
66
66
|
|
67
67
|
function getEdgeGroupConfigId(edgeGroup) {
|
68
|
-
var sourceNode = edgeGroup.
|
69
|
-
var targetNode = edgeGroup.
|
68
|
+
var sourceNode = edgeGroup.getSource();
|
69
|
+
var targetNode = edgeGroup.getTarget();
|
70
70
|
var sourceId = sourceNode.a('uuid');
|
71
71
|
var targetId = targetNode.a('uuid');
|
72
72
|
return [sourceId, targetId].sort().join(',');
|
package/lib/utils/clusterUtil.js
CHANGED
@@ -103,7 +103,7 @@ function isClusterHtElement(element) {
|
|
103
103
|
}
|
104
104
|
|
105
105
|
function isClusterMemberHtElement(element) {
|
106
|
-
return element
|
106
|
+
return (element === null || element === void 0 ? void 0 : element.getParent()) && isClusterHtElement(element.getParent());
|
107
107
|
}
|
108
108
|
/**
|
109
109
|
* 集群无权限时收起
|
@@ -140,7 +140,7 @@ function upgradeV103GraphClusterNode(topo, topoData) {
|
|
140
140
|
var topoDataTrans = (0, _utils.transformTopoElements)(topoData);
|
141
141
|
var dm = topo.getDataModel();
|
142
142
|
var unExistedList = topoDataTrans.filter(function (data) {
|
143
|
-
return !(0, _htElementUtils.
|
143
|
+
return !(0, _htElementUtils.containsElement)(dm, data);
|
144
144
|
});
|
145
145
|
|
146
146
|
if (!unExistedList.length) {
|