@riil-frontend/component-topology 12.1.0-dev.9 → 12.1.2
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 +14 -14
- package/es/components/ResourceSelectDrawer/ResourceSelectDrawer.js +1 -1
- package/es/core/components/TopoView/topoView.js +7 -4
- package/es/core/editor/components/Sidebar/views/ImagePanel/ImagePanel.js +11 -3
- package/es/core/editor/components/settings/core/updateElementProperty.js +3 -2
- package/es/core/editor/components/settings/propertyViews/view/GlobalEdgeToggle.js +2 -2
- package/es/core/editor/hooks/useKeyboardShortcut.js +4 -0
- package/es/core/editor/hooks/useNewElementTheme.js +20 -16
- package/es/core/hooks/useGraphAlarmDisplay.js +4 -0
- package/es/core/hooks/usePolling.js +2 -1
- package/es/core/hooks/useTopoEdit.js +208 -243
- package/es/core/models/AttributeMetricDisplay.js +4 -3
- package/es/core/models/HistoryManager.js +11 -9
- package/es/core/models/TopoApp.js +17 -15
- package/es/core/models/topoData.js +7 -14
- package/es/core/models/utils/linkUtils.js +2 -2
- package/es/core/store/models/topoConfig.js +7 -11
- package/es/core/utils/edgeUtil.js +7 -11
- package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/EventsCard.js +1 -1
- package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/components/LinkTopo/LinkTopo.module.scss +1 -1
- package/es/networkTopo/models/LinkDynamicStyleExecutor.js +7 -63
- package/es/networkTopo/utils/exitLinkUtil.js +23 -11
- package/es/style.js +1 -1
- package/es/utils/clusterUtil.js +3 -3
- package/es/utils/htElementUtils.js +11 -109
- package/lib/components/ResourceSelectDrawer/ResourceSelectDrawer.js +1 -1
- package/lib/core/components/TopoView/topoView.js +15 -19
- package/lib/core/editor/components/Sidebar/views/ImagePanel/ImagePanel.js +12 -3
- package/lib/core/editor/components/settings/core/updateElementProperty.js +7 -2
- package/lib/core/editor/components/settings/propertyViews/view/GlobalEdgeToggle.js +2 -2
- package/lib/core/editor/hooks/useKeyboardShortcut.js +4 -0
- package/lib/core/editor/hooks/useNewElementTheme.js +20 -16
- package/lib/core/hooks/useGraphAlarmDisplay.js +4 -0
- package/lib/core/hooks/usePolling.js +6 -5
- package/lib/core/hooks/useTopoEdit.js +214 -267
- package/lib/core/models/AttributeMetricDisplay.js +6 -6
- package/lib/core/models/HistoryManager.js +13 -17
- package/lib/core/models/TopoApp.js +18 -15
- package/lib/core/models/topoData.js +7 -14
- package/lib/core/models/utils/linkUtils.js +1 -1
- package/lib/core/store/models/topoConfig.js +13 -25
- package/lib/core/utils/edgeUtil.js +6 -10
- package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/EventsCard.js +1 -1
- package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/components/LinkTopo/LinkTopo.module.scss +1 -1
- package/lib/networkTopo/models/LinkDynamicStyleExecutor.js +6 -64
- package/lib/networkTopo/utils/exitLinkUtil.js +23 -11
- package/lib/style.js +1 -1
- package/lib/utils/clusterUtil.js +2 -2
- package/lib/utils/htElementUtils.js +12 -120
- package/package.json +2 -2
- package/es/networkTopo/models/LinkTagsTipsBuilder.js +0 -235
- package/lib/networkTopo/models/LinkTagsTipsBuilder.js +0 -245
@@ -64,7 +64,7 @@ function ResourceSelectDrawer(props) {
|
|
64
64
|
_context.prev = 9;
|
65
65
|
_context.t0 = _context["catch"](1);
|
66
66
|
setLoading(false);
|
67
|
-
rlog.error('ResourceSelectDrawer.handleOk', _context.t0);
|
67
|
+
rlog.error('ResourceSelectDrawer.handleOk', _context.t0, _context.t0.stack);
|
68
68
|
|
69
69
|
case 13:
|
70
70
|
case "end":
|
@@ -5,7 +5,7 @@ import PropTypes from 'prop-types';
|
|
5
5
|
import classnames from 'classnames';
|
6
6
|
import TopoGraph, { TopoEvent } from '@riil-frontend/component-topology-graph';
|
7
7
|
import PortalContainer from '@riil-frontend/component-topology-graph/es/components/PortalContainer';
|
8
|
-
import
|
8
|
+
import Logger from 'loglevel'; // 通用
|
9
9
|
|
10
10
|
import showMessage from "../../utils/showMessage";
|
11
11
|
import { TPL_TREE } from "../../../utils/template";
|
@@ -28,6 +28,7 @@ import editorStyles from "./editor.module.scss";
|
|
28
28
|
import basicIcons from "../../common/icons/basicIcons";
|
29
29
|
import HelpIcon from "../../editor/components/BottomFloatTool/HelpIcon";
|
30
30
|
import { updateNodesNameVisible } from "../../models/utils/nodeNameVisibleUtil";
|
31
|
+
var rlog = Logger.getLogger('topo');
|
31
32
|
|
32
33
|
var Topology = function Topology(props) {
|
33
34
|
var _classnames;
|
@@ -115,7 +116,7 @@ var Topology = function Topology(props) {
|
|
115
116
|
}
|
116
117
|
}, []);
|
117
118
|
var handleGraphDataLoaded = useCallback(function () {
|
118
|
-
rlog.info('TopoView.handleGraphDataLoaded', new Date().toString(), {
|
119
|
+
rlog.info('TopoView.handleGraphDataLoaded: 数据加载完成', new Date().toString(), {
|
119
120
|
topoMod: topo.store.getState().topoMod,
|
120
121
|
topoData: topoData,
|
121
122
|
htElements: topo.getDataModel().getDatas().toArray()
|
@@ -125,13 +126,15 @@ var Topology = function Topology(props) {
|
|
125
126
|
fixLink(topo);
|
126
127
|
handleClusterNoPermission(topo);
|
127
128
|
updateEdgeExpanded(topo);
|
129
|
+
topo.selectionModel.init();
|
128
130
|
var htHistoryManager = topo.getDataModel().getHistoryManager();
|
129
131
|
|
130
|
-
if (htHistoryManager) {
|
132
|
+
if (topo.store.getState().topoMod.viewState === 'edit' && htHistoryManager) {
|
131
133
|
topo.historyManager = new HistoryManager(topo, htHistoryManager);
|
134
|
+
topo.historyManager.clear();
|
135
|
+
rlog.info('TopoView.handleGraphDataLoaded: 初始化HistoryManager ', topo.historyManager.toString());
|
132
136
|
}
|
133
137
|
|
134
|
-
topo.selectionModel.init();
|
135
138
|
topoDispatchers.update({
|
136
139
|
graphLoaded2: true
|
137
140
|
});
|
@@ -4,6 +4,7 @@ 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 React, { useMemo, useState } from 'react';
|
7
|
+
import NoDataPage from '@riil-frontend/component-no-data-page';
|
7
8
|
import Collapse from "../../../../../../components/collapse/Collapse";
|
8
9
|
import CiTypeImagePanel from "./CiTypeImagePanel";
|
9
10
|
import CustomImagePanel from "./CustomImagePanel";
|
@@ -106,12 +107,16 @@ export default function ImagePanel(props) {
|
|
106
107
|
}].filter(function (panel) {
|
107
108
|
return !panel.hidden;
|
108
109
|
});
|
110
|
+
|
111
|
+
if (!panels.length) {
|
112
|
+
return /*#__PURE__*/React.createElement(NoDataPage, null);
|
113
|
+
}
|
114
|
+
|
109
115
|
return /*#__PURE__*/React.createElement(Collapse, {
|
110
116
|
accordion: true,
|
111
117
|
defaultExpandedKeys: ['资源图片'],
|
112
118
|
style: {
|
113
|
-
border: 'none'
|
114
|
-
minWidth: '300px'
|
119
|
+
border: 'none'
|
115
120
|
},
|
116
121
|
fullheight: true,
|
117
122
|
noContentPadding: true
|
@@ -140,6 +145,9 @@ export default function ImagePanel(props) {
|
|
140
145
|
width: '100%'
|
141
146
|
}
|
142
147
|
})), /*#__PURE__*/React.createElement(_Box, {
|
143
|
-
flex: 1
|
148
|
+
flex: 1,
|
149
|
+
style: {
|
150
|
+
minWidth: '300px'
|
151
|
+
}
|
144
152
|
}, renderImageContent()));
|
145
153
|
}
|
@@ -1,7 +1,8 @@
|
|
1
|
+
import Logger from 'loglevel';
|
2
|
+
var rlog = Logger.getLogger('topo');
|
1
3
|
export default function updateElementProperty(topo, name, value) {
|
2
|
-
// const element = topo.getDataModel().getDataById(selection[0].id);
|
3
4
|
var element = topo.getSelectionModel().getFirstData();
|
4
|
-
|
5
|
+
rlog.debug("updateElementProperty. ", {
|
5
6
|
element: element,
|
6
7
|
name: name,
|
7
8
|
value: value
|
@@ -23,13 +23,13 @@ function GlobalEdgeToggle(props) {
|
|
23
23
|
topo: topo,
|
24
24
|
showType: 4
|
25
25
|
});
|
26
|
-
topo.getHtTopo().
|
26
|
+
topo.getHtTopo().toggleAllEdgeGroups(true);
|
27
27
|
} else {
|
28
28
|
showLinkByConfig({
|
29
29
|
topo: topo,
|
30
30
|
showType: 1
|
31
31
|
});
|
32
|
-
topo.getHtTopo().
|
32
|
+
topo.getHtTopo().toggleAllEdgeGroups(false);
|
33
33
|
}
|
34
34
|
|
35
35
|
displayConfigDispatchers.update({
|
@@ -16,26 +16,30 @@ function useNewElementTheme(props) {
|
|
16
16
|
inited = true;
|
17
17
|
}
|
18
18
|
|
19
|
-
function
|
20
|
-
var
|
21
|
-
data = e.data;
|
19
|
+
function handleAddElement(e) {
|
20
|
+
var data = e.data; // 设置主题样式
|
22
21
|
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
return item.name === theme;
|
29
|
-
});
|
22
|
+
var displayConfig = topo.store.getModelState('displayConfig');
|
23
|
+
var theme = displayConfig.canvasTheme || 'white';
|
24
|
+
var themeConfig = THEMES.find(function (item) {
|
25
|
+
return item.name === theme;
|
26
|
+
});
|
30
27
|
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
28
|
+
var _ThemeUtil = ThemeUtil({
|
29
|
+
topo: topo
|
30
|
+
}),
|
31
|
+
setElementTheme = _ThemeUtil.setElementTheme;
|
35
32
|
|
36
|
-
|
33
|
+
setElementTheme(data, themeConfig); // 临时放这里,新加入节点按配置显示隐藏名称
|
34
|
+
|
35
|
+
setNewNodeNameVisible(topo, data);
|
36
|
+
}
|
37
37
|
|
38
|
-
|
38
|
+
function handleDataModelChangeListener(e) {
|
39
|
+
var kind = e.kind;
|
40
|
+
|
41
|
+
if (kind === 'add') {
|
42
|
+
handleAddElement(e);
|
39
43
|
}
|
40
44
|
}
|
41
45
|
|
@@ -126,6 +126,8 @@ export default function useGraphAlarmDisplay(options) {
|
|
126
126
|
});
|
127
127
|
|
128
128
|
function showAlarm() {
|
129
|
+
var _topo$historyManager, _topo$historyManager2;
|
130
|
+
|
129
131
|
if (!graphLoaded) {
|
130
132
|
return;
|
131
133
|
}
|
@@ -156,7 +158,9 @@ export default function useGraphAlarmDisplay(options) {
|
|
156
158
|
relateTopoAlarms: relateTopoAlarms
|
157
159
|
}); // 更新到ht拓扑
|
158
160
|
|
161
|
+
(_topo$historyManager = topo.historyManager) === null || _topo$historyManager === void 0 ? void 0 : _topo$historyManager.setDisabled(true, '推送告警');
|
159
162
|
topo.view.loadAlarm(elementsAlarmLevels);
|
163
|
+
(_topo$historyManager2 = topo.historyManager) === null || _topo$historyManager2 === void 0 ? void 0 : _topo$historyManager2.setDisabled(false, '推送告警');
|
160
164
|
}
|
161
165
|
|
162
166
|
return function () {
|
@@ -4,11 +4,12 @@ import _regeneratorRuntime from "@babel/runtime/regenerator";
|
|
4
4
|
import { useEffect } from 'react';
|
5
5
|
import { useRequest } from 'ahooks';
|
6
6
|
import _ from 'lodash';
|
7
|
-
import
|
7
|
+
import Logger from 'loglevel';
|
8
8
|
import { useCbbEventListener } from '@riil-frontend/component-riil-event-emitter';
|
9
9
|
import DictCache from "../models/cache/DictCache";
|
10
10
|
import useCiAttributeChange from "./useCiAttributeChange";
|
11
11
|
import useHtDataPropertyChangeListener from "./ht/useHtDataPropertyChangeListener";
|
12
|
+
var rlog = Logger.getLogger('topo');
|
12
13
|
/**
|
13
14
|
* 轮询获取指标hooks
|
14
15
|
* @param {*} props
|