@riil-frontend/component-topology 9.0.0-a.3 → 9.0.0-a.30
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.css +1 -1
- package/build/index.js +12 -12
- package/es/components/VerticalIconTab/VerticalIconTab.module.scss +11 -5
- package/es/core/components/TopoView/GraphViewPanel.js +17 -4
- package/es/core/components/TopoView/TopoView.module.scss +17 -3
- package/es/core/editor/components/BackgroundView/index.module.scss +3 -0
- package/es/core/editor/components/Sidebar/Sidebar.module.scss +7 -7
- package/es/core/editor/components/Sidebar/views/CanvasPanel/CanvasPanel.js +1 -1
- package/es/core/editor/components/Sidebar/views/CanvasPanel/CanvasPanel.module.scss +1 -0
- package/es/core/editor/components/Sidebar/views/ComponentPanel.js +1 -1
- package/es/core/editor/components/Sidebar/views/ImagePanel/ImagePanel.js +2 -1
- package/es/core/editor/components/Sidebar/views/LinkPanel.js +1 -1
- package/es/core/editor/components/Toolbar/widgets/EdgeTypeButton/EdgeType.js +21 -5
- package/es/core/editor/components/Toolbar/widgets/EdgeTypeButton/EdgeType.module.scss +5 -1
- package/es/core/editor/components/Toolbar/widgets/EdgeTypeButton/LineType.js +31 -12
- package/es/core/editor/components/Toolbar/widgets/EdgeTypeButton/LineType.module.scss +12 -2
- package/es/core/editor/components/Toolbar/widgets/EdgeTypeButton/index.js +6 -0
- package/es/core/editor/components/Toolbar/widgets/FontSizeWidget.js +1 -1
- package/es/core/editor/components/Toolbar/widgets/components/textStyleSetting/ElementTextStyleSetting/elements/groupTitle.js +1 -1
- package/es/core/editor/components/settings/core/updateElementProperty.js +6 -1
- package/es/core/editor/components/settings/propertyViews/group/DataTab/hoooks/useGroupRelateResource.js +4 -3
- package/es/core/editor/components/settings/propertyViews/node/data/BindIpInput.js +95 -0
- package/es/core/editor/components/settings/propertyViews/node/data/Data.js +46 -14
- package/es/core/editor/config/themes.js +53 -2
- package/es/core/event/topoEventListener.js +22 -0
- package/es/core/hooks/useAlarm.js +18 -12
- package/es/core/hooks/useCanvasTheme.js +12 -4
- package/es/core/hooks/useResourceConfig.js +2 -1
- package/es/core/hooks/useTopoEdit.js +97 -19
- package/es/core/hooks/useTopoEventListener.js +4 -18
- package/es/core/hooks/useTopoFullscreen.js +32 -0
- package/es/core/models/Alarm.js +4 -13
- package/es/core/models/TopoApp.js +1 -1
- package/es/core/models/topoData.js +16 -9
- package/es/core/models/utils/linkUtils.js +52 -27
- package/es/core/store/models/topoConfig.js +51 -20
- package/es/core/test/Test.js +52 -0
- package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/ResourceOverview.js +11 -35
- package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/components/LinkTopo/LinkTopo.js +14 -0
- package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/components/LinkTopo/LinkTopoCard.js +8 -6
- package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/components/LinkTopo/hooks/useMetricPolling.js +28 -56
- package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/components/LinkTopo/services/index.js +57 -1
- package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/hooks/useMetricModels.js +13 -52
- package/es/networkTopo/getTopoData.js +2 -1
- package/es/networkTopo/models/LinkDynamicStyleExecutor.js +5 -5
- package/es/networkTopo/services/link.js +1 -1
- package/es/networkTopo/services/topo/basic.js +27 -26
- package/es/networkTopo/services/topo/networkLink.js +45 -3
- package/es/networkTopo/utils/exitLinkUtil.js +257 -0
- package/es/utils/ResourceConfigUtil.js +5 -4
- package/es/utils/htElementDataUtil.js +1 -7
- package/es/utils/htElementUtils.js +21 -21
- package/lib/components/VerticalIconTab/VerticalIconTab.module.scss +11 -5
- package/lib/core/components/TopoView/GraphViewPanel.js +18 -3
- package/lib/core/components/TopoView/TopoView.module.scss +17 -3
- package/lib/core/editor/components/BackgroundView/index.module.scss +3 -0
- package/lib/core/editor/components/Sidebar/Sidebar.module.scss +7 -7
- package/lib/core/editor/components/Sidebar/views/CanvasPanel/CanvasPanel.js +1 -1
- package/lib/core/editor/components/Sidebar/views/CanvasPanel/CanvasPanel.module.scss +1 -0
- package/lib/core/editor/components/Sidebar/views/ComponentPanel.js +1 -1
- package/lib/core/editor/components/Sidebar/views/ImagePanel/ImagePanel.js +2 -1
- package/lib/core/editor/components/Sidebar/views/LinkPanel.js +1 -1
- package/lib/core/editor/components/Toolbar/widgets/EdgeTypeButton/EdgeType.js +21 -4
- package/lib/core/editor/components/Toolbar/widgets/EdgeTypeButton/EdgeType.module.scss +5 -1
- package/lib/core/editor/components/Toolbar/widgets/EdgeTypeButton/LineType.js +31 -12
- package/lib/core/editor/components/Toolbar/widgets/EdgeTypeButton/LineType.module.scss +12 -2
- package/lib/core/editor/components/Toolbar/widgets/EdgeTypeButton/index.js +6 -0
- package/lib/core/editor/components/Toolbar/widgets/FontSizeWidget.js +1 -1
- package/lib/core/editor/components/Toolbar/widgets/components/textStyleSetting/ElementTextStyleSetting/elements/groupTitle.js +1 -1
- package/lib/core/editor/components/settings/core/updateElementProperty.js +6 -1
- package/lib/core/editor/components/settings/propertyViews/group/DataTab/hoooks/useGroupRelateResource.js +3 -3
- package/lib/core/editor/components/settings/propertyViews/node/data/BindIpInput.js +111 -0
- package/lib/core/editor/components/settings/propertyViews/node/data/Data.js +48 -14
- package/lib/core/editor/config/themes.js +53 -2
- package/lib/core/event/topoEventListener.js +27 -0
- package/lib/core/hooks/useAlarm.js +19 -12
- package/lib/core/hooks/useCanvasTheme.js +12 -4
- package/lib/core/hooks/useResourceConfig.js +2 -1
- package/lib/core/hooks/useTopoEdit.js +98 -18
- package/lib/core/hooks/useTopoEventListener.js +3 -17
- package/lib/core/hooks/useTopoFullscreen.js +42 -0
- package/lib/core/models/Alarm.js +5 -16
- package/lib/core/models/TopoApp.js +1 -1
- package/lib/core/models/topoData.js +16 -9
- package/lib/core/models/utils/linkUtils.js +53 -26
- package/lib/core/store/models/topoConfig.js +56 -19
- package/lib/core/test/Test.js +52 -0
- package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/ResourceOverview.js +10 -35
- package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/components/LinkTopo/LinkTopo.js +14 -0
- package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/components/LinkTopo/LinkTopoCard.js +8 -6
- package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/components/LinkTopo/hooks/useMetricPolling.js +28 -55
- package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/components/LinkTopo/services/index.js +58 -1
- package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/hooks/useMetricModels.js +13 -53
- package/lib/networkTopo/getTopoData.js +2 -1
- package/lib/networkTopo/models/LinkDynamicStyleExecutor.js +5 -5
- package/lib/networkTopo/services/topo/basic.js +28 -28
- package/lib/networkTopo/services/topo/networkLink.js +45 -3
- package/lib/networkTopo/utils/exitLinkUtil.js +269 -0
- package/lib/utils/ResourceConfigUtil.js +4 -4
- package/lib/utils/htElementDataUtil.js +0 -10
- package/lib/utils/htElementUtils.js +21 -21
- package/package.json +3 -3
@@ -55,7 +55,7 @@ function getElementData(element) {
|
|
55
55
|
styleMap: element.getStyleMap()
|
56
56
|
};
|
57
57
|
|
58
|
-
if (className ===
|
58
|
+
if (className === "ht.Edge") {
|
59
59
|
return (0, _extends3["default"])({}, commonData);
|
60
60
|
}
|
61
61
|
|
@@ -67,7 +67,7 @@ function getElementData(element) {
|
|
67
67
|
function isNode(element) {
|
68
68
|
// HT为了支持区域内无节点可展开增加了站位节点,因此 节点的layer等于container_blank的过滤掉就可以了
|
69
69
|
// eslint-disable-next-line no-underscore-dangle
|
70
|
-
return element instanceof ht.Node && !isLayer(element) && element._layer !==
|
70
|
+
return element instanceof ht.Node && !isLayer(element) && element._layer !== "container_blank";
|
71
71
|
}
|
72
72
|
|
73
73
|
function isEdge(element) {
|
@@ -80,7 +80,7 @@ function isValidEdge(element) {
|
|
80
80
|
}
|
81
81
|
|
82
82
|
if (!element.getSource() || !element.getTarget()) {
|
83
|
-
_rlog["default"].error(
|
83
|
+
_rlog["default"].error("isValidEdge 连线异常:源或目的为空", element);
|
84
84
|
|
85
85
|
return false;
|
86
86
|
}
|
@@ -97,7 +97,7 @@ function isLayer(element) {
|
|
97
97
|
}
|
98
98
|
|
99
99
|
function isText(element) {
|
100
|
-
return element instanceof ht.Text && element.a(
|
100
|
+
return element instanceof ht.Text && element.a("isText");
|
101
101
|
}
|
102
102
|
|
103
103
|
function getElements(dataModel) {
|
@@ -123,7 +123,7 @@ function getGroupDatas(dataModel) {
|
|
123
123
|
|
124
124
|
function getGroupElementByTag(dataModel, tag) {
|
125
125
|
return dataModel.getDataByTag(tag) || dataModel.getDatas().toArray().filter(function (item) {
|
126
|
-
return item.a(
|
126
|
+
return item.a("tag") === tag;
|
127
127
|
})[0];
|
128
128
|
}
|
129
129
|
|
@@ -135,14 +135,14 @@ function getGroupData(element) {
|
|
135
135
|
var parent = element.getParent();
|
136
136
|
var groupInfo = parent ? {
|
137
137
|
groupId: parent.getTag(),
|
138
|
-
groupTag: parent.a(
|
138
|
+
groupTag: parent.a("tag") // 父容器
|
139
139
|
|
140
140
|
} : {};
|
141
141
|
return (0, _extends3["default"])({
|
142
142
|
name: element.getStyleMap().label
|
143
143
|
}, element.getAttrObject(), {
|
144
144
|
id: element.getTag(),
|
145
|
-
tag: element.a(
|
145
|
+
tag: element.a("tag"),
|
146
146
|
image: element.getImage()
|
147
147
|
}, groupInfo);
|
148
148
|
}
|
@@ -159,7 +159,7 @@ function getNodeData(element) {
|
|
159
159
|
var parent = element.getParent();
|
160
160
|
var groupInfo = parent ? {
|
161
161
|
groupId: parent.getTag(),
|
162
|
-
groupTag: parent.a(
|
162
|
+
groupTag: parent.a("tag") // 父容器
|
163
163
|
|
164
164
|
} : {};
|
165
165
|
return (0, _extends3["default"])({}, element.getAttrObject(), {
|
@@ -173,12 +173,12 @@ function getEdges(dataModel) {
|
|
173
173
|
}
|
174
174
|
|
175
175
|
function isEdgeGroupExpanded(edge) {
|
176
|
-
return isEdge(edge) && edge.getEdgeGroup() && !!edge.s(
|
176
|
+
return isEdge(edge) && edge.getEdgeGroup() && !!edge.s("edge.expanded");
|
177
177
|
}
|
178
178
|
/**
|
179
179
|
* 是否连线组代理
|
180
|
-
* @param {*} edge
|
181
|
-
* @returns
|
180
|
+
* @param {*} edge
|
181
|
+
* @returns
|
182
182
|
*/
|
183
183
|
|
184
184
|
|
@@ -187,9 +187,9 @@ function isEdgeGroupAgent(edge) {
|
|
187
187
|
}
|
188
188
|
/**
|
189
189
|
* 获得两个节点间的连线列表
|
190
|
-
* @param {*} node1
|
191
|
-
* @param {*} node2
|
192
|
-
* @returns
|
190
|
+
* @param {*} node1
|
191
|
+
* @param {*} node2
|
192
|
+
* @returns
|
193
193
|
*/
|
194
194
|
|
195
195
|
|
@@ -212,7 +212,7 @@ function getEdgesBetweenNodes(node1, node2) {
|
|
212
212
|
}
|
213
213
|
/**
|
214
214
|
* 获得节点间的连线组,连线<=1时返回null
|
215
|
-
* @returns
|
215
|
+
* @returns
|
216
216
|
*/
|
217
217
|
|
218
218
|
|
@@ -232,7 +232,7 @@ function getEdgeGroupByNodes(node1, node2) {
|
|
232
232
|
}
|
233
233
|
/**
|
234
234
|
* 获得节点间的连线组,连线<=1时返回null
|
235
|
-
* @returns
|
235
|
+
* @returns
|
236
236
|
*/
|
237
237
|
|
238
238
|
|
@@ -241,7 +241,7 @@ function getEdgeGroupByNodeTags(dataModel, nodeTag1, nodeTag2) {
|
|
241
241
|
var node2 = dataModel.getDataByTag(nodeTag2);
|
242
242
|
|
243
243
|
if (!node1 || !node2) {
|
244
|
-
console.warn(
|
244
|
+
console.warn("getEdgeGroupByNodes 未找到节点", {
|
245
245
|
node1: node1,
|
246
246
|
node2: node2,
|
247
247
|
nodeTag1: nodeTag1,
|
@@ -328,7 +328,7 @@ function getGroupChildren(group) {
|
|
328
328
|
|
329
329
|
|
330
330
|
return group.getChildren().getArray().filter(function (node) {
|
331
|
-
return node._layer !==
|
331
|
+
return node._layer !== "container_blank";
|
332
332
|
});
|
333
333
|
}
|
334
334
|
/**
|
@@ -361,7 +361,7 @@ function getGroupChildrenData(group) {
|
|
361
361
|
function setElementRuntimeStyle(element, name, value) {
|
362
362
|
var _extends2;
|
363
363
|
|
364
|
-
var prevRuntimeStyle = element.a(
|
364
|
+
var prevRuntimeStyle = element.a("runtimeStyles") || {};
|
365
365
|
var runtimeStyle = (0, _extends3["default"])({}, prevRuntimeStyle, (_extends2 = {}, _extends2[name] = value, _extends2)); // if (prevRuntimeStyle[name] === undefined && value === undefined) {
|
366
366
|
// return
|
367
367
|
// }
|
@@ -370,7 +370,7 @@ function setElementRuntimeStyle(element, name, value) {
|
|
370
370
|
runtimeStyle[name] = undefined; // delete runtimeStyle[name]
|
371
371
|
}
|
372
372
|
|
373
|
-
element.a(
|
373
|
+
element.a("runtimeStyles", runtimeStyle);
|
374
374
|
}
|
375
375
|
/**
|
376
376
|
* 判断拓扑图是否存在元素
|
@@ -384,7 +384,7 @@ function isExistedElement(htTopo, dataModel, data) {
|
|
384
384
|
|
385
385
|
|
386
386
|
var element = getElements(dataModel).find(function (item) {
|
387
|
-
return data.tag && item.a(
|
387
|
+
return data.tag && item.a("tag") === data.tag;
|
388
388
|
});
|
389
389
|
|
390
390
|
if (element) {
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@riil-frontend/component-topology",
|
3
|
-
"version": "9.0.0-a.
|
3
|
+
"version": "9.0.0-a.30",
|
4
4
|
"description": "拓扑",
|
5
5
|
"scripts": {
|
6
6
|
"start": "build-scripts start",
|
@@ -55,7 +55,7 @@
|
|
55
55
|
},
|
56
56
|
"devDependencies": {
|
57
57
|
"@alifd/next": "1.21.16",
|
58
|
-
"@alifd/theme-19926": "^0.
|
58
|
+
"@alifd/theme-19926": "^0.48.2",
|
59
59
|
"@formily/next": "1.3.13",
|
60
60
|
"@formily/next-components": "1.3.13",
|
61
61
|
"@iceworks/spec": "^1.0.0",
|
@@ -116,6 +116,6 @@
|
|
116
116
|
"access": "public"
|
117
117
|
},
|
118
118
|
"license": "MIT",
|
119
|
-
"homepage": "https://unpkg.com/@riil-frontend/component-topology@9.0.0-a.
|
119
|
+
"homepage": "https://unpkg.com/@riil-frontend/component-topology@9.0.0-a.30/build/index.html",
|
120
120
|
"gitHead": "2da19ffccbb7ca60a8acf396e39f542c68bb33f5"
|
121
121
|
}
|