@riil-frontend/component-topology 12.0.0-dev.7 → 12.0.0-dev.9
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/components/BatchAttrMetric/setting.js +1 -1
- package/es/components/ModelAttrSelectDrawer/components/MultipleTypeAttributeSelectDrawer.js +1 -1
- package/es/components/ResourceSelectDrawer/ResourceSelectDrawer.js +1 -1
- package/es/core/components/AlarmListPanel/index.js +1 -1
- package/es/core/components/DisplaySettingDrawer/DisplaySetting.js +1 -1
- package/es/core/components/DisplaySettingDrawer/DisplaySettingDrawer.js +1 -1
- package/es/core/components/DisplaySettingDrawer/ResourceDisplay/BasicConfig.js +1 -1
- package/es/core/components/DisplaySettingDrawer/components/NodeAttrSettingDrawer.js +1 -1
- package/es/core/components/ResourceViewAttributeSetting/Setting.js +1 -1
- package/es/core/components/TopoView/topoView.js +1 -1
- package/es/core/editor/components/BackgroundView/index.js +1 -1
- package/es/core/editor/components/CustomIconPlugin/UploadIconDialog.js +1 -1
- package/es/core/editor/components/EditorPlugin.js +1 -1
- package/es/core/editor/components/Sidebar/views/ComponentPanel.js +1 -1
- package/es/core/editor/components/Sidebar/views/ImagePanel/CiTypeImagePanel.js +1 -1
- package/es/core/editor/components/Sidebar/views/ImagePanel/CustomImagePanel.js +1 -1
- package/es/core/editor/components/Sidebar/views/ImagePanel/HtCustomImagePanel.js +1 -1
- package/es/core/editor/components/Sidebar/views/ImagePanel/HtImagePalette.js +1 -1
- package/es/core/editor/components/Sidebar/views/ImagePanel/ImagePalette.js +1 -1
- package/es/core/editor/components/Sidebar/views/LinkPanel.js +1 -1
- package/es/core/editor/components/settings/common/NodeSizeInput/NodeSizeInput.js +1 -1
- package/es/core/editor/components/settings/common/SizeInput/NodeSizeInput.js +1 -1
- package/es/core/editor/components/settings/propertyViews/layer/BasicSetting.js +1 -1
- package/es/core/editor/components/settings/propertyViews/layer/SettingTab/Setting.js +1 -1
- package/es/core/editor/components/settings/propertyViews/view/hooks/useBackgroundSizeConfig.js +1 -1
- package/es/core/editor/store/background.js +1 -1
- package/es/core/editor/store/historyManager.js +1 -1
- package/es/core/editor/store/topoEdit.js +1 -1
- package/es/core/hooks/ht/useHtDataPropertyChangeListener.js +1 -1
- package/es/core/hooks/useCiAttributeChange.js +1 -1
- package/es/core/hooks/useManageStatus.js +1 -1
- package/es/core/hooks/usePolling.js +1 -1
- package/es/core/hooks/useTopoEdit.js +21 -16
- package/es/core/models/Alarm.js +1 -1
- package/es/core/models/AttributeMetricDisplay.js +6 -3
- package/es/core/models/HistoryManager.js +1 -1
- package/es/core/models/SelectionModel.js +1 -1
- package/es/core/models/TopoApp.js +2 -2
- package/es/core/models/attributeFormatter/formatter/graphTransform.js +1 -1
- package/es/core/models/attributeFormatter/index.js +1 -1
- package/es/core/models/cache/CiTypeCache.js +5 -1
- package/es/core/models/cache/DictCache.js +1 -1
- package/es/core/models/plugins/resourceWebControllUrl.js +1 -1
- package/es/core/models/tagstips/ElementTagTipConfig.js +1 -1
- package/es/core/services/alarm.js +1 -1
- package/es/core/services/index.js +1 -1
- package/es/core/store/models/customIcon.js +1 -1
- package/es/core/store/models/displayConfig.js +1 -1
- package/es/core/store/models/selection.js +1 -1
- package/es/core/store/models/topoBaseInfoOverview.js +1 -1
- package/es/core/store/models/topoBizMod.js +1 -1
- package/es/core/store/models/topoGraphView.js +1 -1
- package/es/core/store/models/topoMod.js +1 -1
- package/es/core/store/models/viewer/lock.js +1 -1
- package/es/core/store/models/viewer/resourceDetail.js +1 -1
- package/es/core/store/models/viewer/resourceWebControllUrlSetting.js +1 -1
- package/es/core/utils/showMessage.js +1 -1
- package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/EventsCard.js +12 -13
- package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/components/LinkTopo/hooks/useMetricPolling.js +1 -1
- package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/components/LinkTopo/services/index.js +1 -1
- package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/hooks/useAlarmAndRiskData.js +20 -18
- package/es/core/viewer/components/plugins/ResourceDetail/components/WebConsole/WebConsoleForm/hooks/useWebConsole.js +1 -1
- package/es/networkTopo/components/Link/index.js +1 -1
- package/es/networkTopo/hooks/viewer/useRelateTopo.js +1 -1
- package/es/networkTopo/models/LinkDynamicStyleExecutor.js +1 -1
- package/es/networkTopo/models/LinkTagsTipsBuilder.js +1 -1
- package/es/networkTopo/models/TopoCenter.js +1 -1
- package/es/networkTopo/services/model.js +1 -1
- package/es/networkTopo/services/topo/basic.js +1 -1
- package/es/networkTopo/services/topo/ciInfo.js +1 -1
- package/es/networkTopo/store/functionAuth.js +1 -1
- package/es/networkTopo/store/topoCenter.js +1 -1
- package/es/networkTopo/store/topoTreeMod.js +1 -1
- package/es/networkTopo/utils/exportData.js +1 -1
- package/es/style.js +1 -1
- package/es/utils/ResourceConfigUtil.js +1 -1
- package/es/utils/ciRefAttributeTranslateUtil.d.ts +12 -0
- package/es/utils/ciRefAttributeTranslateUtil.js +156 -0
- package/es/utils/format.js +1 -1
- package/es/utils/topoData.js +4 -2
- package/lib/components/BatchAttrMetric/setting.js +2 -2
- package/lib/components/ModelAttrSelectDrawer/components/MultipleTypeAttributeSelectDrawer.js +2 -2
- package/lib/components/ResourceSelectDrawer/ResourceSelectDrawer.js +2 -2
- package/lib/core/components/AlarmListPanel/index.js +1 -1
- package/lib/core/components/DisplaySettingDrawer/DisplaySetting.js +2 -2
- package/lib/core/components/DisplaySettingDrawer/DisplaySettingDrawer.js +2 -2
- package/lib/core/components/DisplaySettingDrawer/ResourceDisplay/BasicConfig.js +3 -3
- package/lib/core/components/DisplaySettingDrawer/components/NodeAttrSettingDrawer.js +2 -2
- package/lib/core/components/ResourceViewAttributeSetting/Setting.js +2 -2
- package/lib/core/components/TopoView/topoView.js +9 -9
- package/lib/core/editor/components/BackgroundView/index.js +3 -3
- package/lib/core/editor/components/CustomIconPlugin/UploadIconDialog.js +2 -2
- package/lib/core/editor/components/EditorPlugin.js +3 -3
- package/lib/core/editor/components/Sidebar/views/ComponentPanel.js +2 -4
- package/lib/core/editor/components/Sidebar/views/ImagePanel/CiTypeImagePanel.js +1 -1
- package/lib/core/editor/components/Sidebar/views/ImagePanel/CustomImagePanel.js +1 -1
- package/lib/core/editor/components/Sidebar/views/ImagePanel/HtCustomImagePanel.js +2 -2
- package/lib/core/editor/components/Sidebar/views/ImagePanel/HtImagePalette.js +2 -2
- package/lib/core/editor/components/Sidebar/views/ImagePanel/ImagePalette.js +2 -4
- package/lib/core/editor/components/Sidebar/views/LinkPanel.js +2 -4
- package/lib/core/editor/components/settings/common/NodeSizeInput/NodeSizeInput.js +5 -5
- package/lib/core/editor/components/settings/common/SizeInput/NodeSizeInput.js +1 -1
- package/lib/core/editor/components/settings/propertyViews/layer/BasicSetting.js +1 -1
- package/lib/core/editor/components/settings/propertyViews/layer/SettingTab/Setting.js +3 -3
- package/lib/core/editor/components/settings/propertyViews/view/hooks/useBackgroundSizeConfig.js +2 -2
- package/lib/core/editor/store/background.js +1 -1
- package/lib/core/editor/store/historyManager.js +1 -1
- package/lib/core/editor/store/topoEdit.js +1 -1
- package/lib/core/hooks/ht/useHtDataPropertyChangeListener.js +1 -3
- package/lib/core/hooks/useCiAttributeChange.js +1 -1
- package/lib/core/hooks/useManageStatus.js +1 -1
- package/lib/core/hooks/usePolling.js +3 -3
- package/lib/core/hooks/useTopoEdit.js +21 -16
- package/lib/core/models/Alarm.js +10 -10
- package/lib/core/models/AttributeMetricDisplay.js +8 -4
- package/lib/core/models/HistoryManager.js +8 -8
- package/lib/core/models/SelectionModel.js +5 -5
- package/lib/core/models/TopoApp.js +4 -6
- package/lib/core/models/attributeFormatter/formatter/graphTransform.js +2 -4
- package/lib/core/models/attributeFormatter/index.js +1 -1
- package/lib/core/models/cache/CiTypeCache.js +6 -2
- package/lib/core/models/cache/DictCache.js +2 -2
- package/lib/core/models/plugins/resourceWebControllUrl.js +2 -2
- package/lib/core/models/tagstips/ElementTagTipConfig.js +2 -2
- package/lib/core/services/alarm.js +2 -2
- package/lib/core/services/index.js +1 -1
- package/lib/core/store/models/customIcon.js +3 -3
- package/lib/core/store/models/displayConfig.js +1 -1
- package/lib/core/store/models/selection.js +1 -1
- package/lib/core/store/models/topoBaseInfoOverview.js +1 -1
- package/lib/core/store/models/topoBizMod.js +1 -1
- package/lib/core/store/models/topoGraphView.js +1 -1
- package/lib/core/store/models/topoMod.js +9 -9
- package/lib/core/store/models/viewer/lock.js +1 -1
- package/lib/core/store/models/viewer/resourceDetail.js +1 -1
- package/lib/core/store/models/viewer/resourceWebControllUrlSetting.js +1 -1
- package/lib/core/utils/showMessage.js +2 -2
- package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/EventsCard.js +12 -13
- package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/components/LinkTopo/hooks/useMetricPolling.js +6 -6
- package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/components/LinkTopo/services/index.js +3 -5
- package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/hooks/useAlarmAndRiskData.js +20 -18
- package/lib/core/viewer/components/plugins/ResourceDetail/components/WebConsole/WebConsoleForm/hooks/useWebConsole.js +2 -2
- package/lib/networkTopo/components/Link/index.js +2 -2
- package/lib/networkTopo/hooks/viewer/useRelateTopo.js +4 -4
- package/lib/networkTopo/models/LinkDynamicStyleExecutor.js +3 -5
- package/lib/networkTopo/models/LinkTagsTipsBuilder.js +3 -3
- package/lib/networkTopo/models/TopoCenter.js +1 -1
- package/lib/networkTopo/services/model.js +1 -3
- package/lib/networkTopo/services/topo/basic.js +1 -3
- package/lib/networkTopo/services/topo/ciInfo.js +0 -2
- package/lib/networkTopo/store/functionAuth.js +1 -1
- package/lib/networkTopo/store/topoCenter.js +1 -1
- package/lib/networkTopo/store/topoTreeMod.js +5 -5
- package/lib/networkTopo/utils/exportData.js +1 -3
- package/lib/style.js +1 -1
- package/lib/utils/ResourceConfigUtil.js +2 -2
- package/lib/utils/ciRefAttributeTranslateUtil.d.ts +12 -0
- package/lib/utils/ciRefAttributeTranslateUtil.js +169 -0
- package/lib/utils/format.js +1 -1
- package/lib/utils/topoData.js +4 -2
- package/package.json +3 -3
@@ -2,7 +2,7 @@ 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
4
|
import topoServer from '@riil-frontend/component-topology-common/es/services/topo';
|
5
|
-
import rlog from '@riil-frontend/component-topology-utils
|
5
|
+
import { rlog } from '@riil-frontend/component-topology-utils';
|
6
6
|
export default function (engine) {
|
7
7
|
return {
|
8
8
|
state: {
|
@@ -5,7 +5,7 @@ import _regeneratorRuntime from "@babel/runtime/regenerator";
|
|
5
5
|
/**
|
6
6
|
* 拓扑图 Model
|
7
7
|
*/
|
8
|
-
import rlog from '@riil-frontend/component-topology-utils
|
8
|
+
import { rlog } from '@riil-frontend/component-topology-utils';
|
9
9
|
import topoService from '@riil-frontend/component-topology-common/es/services/topo';
|
10
10
|
export default {
|
11
11
|
// 定义 model 的初始 state
|
@@ -3,7 +3,7 @@ import _extends from "@babel/runtime/helpers/extends";
|
|
3
3
|
import _regeneratorRuntime from "@babel/runtime/regenerator";
|
4
4
|
import moment from 'moment';
|
5
5
|
import topoService from '@riil-frontend/component-topology-common/es/services/topo';
|
6
|
-
import rlog from '@riil-frontend/component-topology-utils
|
6
|
+
import { rlog } from '@riil-frontend/component-topology-utils';
|
7
7
|
import { combTopoData, getCiTypes, parseTopoData } from "../../../utils/topoData";
|
8
8
|
import { loopTreeByKey } from "../../../utils/tree";
|
9
9
|
import topoPermissonUtil from "../../../utils/topoPermissionUtil";
|
@@ -3,7 +3,7 @@ import _extends from "@babel/runtime/helpers/extends";
|
|
3
3
|
/**
|
4
4
|
* 资源web控制台url配置 Model
|
5
5
|
*/
|
6
|
-
import rlog from '@riil-frontend/component-topology-utils
|
6
|
+
import { rlog } from '@riil-frontend/component-topology-utils';
|
7
7
|
import topoService from '@riil-frontend/component-topology-common/es/services/topo';
|
8
8
|
export default {
|
9
9
|
// 定义 model 的初始 state
|
package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/EventsCard.js
CHANGED
@@ -20,32 +20,31 @@ function EventsCard(props) {
|
|
20
20
|
onHandleAlarm = props.onHandleAlarm; // 告警table列配置
|
21
21
|
|
22
22
|
var columns = [{
|
23
|
-
title:
|
24
|
-
dataIndex:
|
25
|
-
key:
|
23
|
+
title: "描述",
|
24
|
+
dataIndex: "title",
|
25
|
+
key: "title",
|
26
26
|
cell: function cell(value, index, record) {
|
27
27
|
return /*#__PURE__*/React.createElement("div", {
|
28
|
-
className: styles[
|
28
|
+
className: styles["alarm-title"],
|
29
29
|
title: value,
|
30
30
|
onClick: closeDetailDrawer
|
31
31
|
}, /*#__PURE__*/React.createElement(_Icon, {
|
32
32
|
type: record.icon,
|
33
33
|
size: "xs",
|
34
|
-
className: styles[
|
35
|
-
}), /*#__PURE__*/React.createElement(
|
36
|
-
|
37
|
-
href: formatUrl(record.link)
|
34
|
+
className: styles["alarm-color-icon"] + " " + record.className
|
35
|
+
}), /*#__PURE__*/React.createElement(Link, {
|
36
|
+
to: formatUrl(record.link)
|
38
37
|
}, value));
|
39
38
|
}
|
40
39
|
}, {
|
41
|
-
title:
|
42
|
-
dataIndex:
|
43
|
-
key:
|
40
|
+
title: "时间",
|
41
|
+
dataIndex: "time",
|
42
|
+
key: "time",
|
44
43
|
width: 144,
|
45
44
|
cell: function cell(value, index, record) {
|
46
45
|
return /*#__PURE__*/React.createElement("div", {
|
47
|
-
title: moment(value).format(
|
48
|
-
}, moment(value).format(
|
46
|
+
title: moment(value).format("YYYY-MM-DD HH:mm:ss")
|
47
|
+
}, moment(value).format("YYYY-MM-DD HH:mm:ss"));
|
49
48
|
}
|
50
49
|
} // 临时屏蔽告警操作列,后续版本按权限显示 2023-3-6 20:23:45
|
51
50
|
// {
|
@@ -2,7 +2,7 @@ import _extends from "@babel/runtime/helpers/extends";
|
|
2
2
|
import React, { useEffect, useState } from 'react';
|
3
3
|
import { useRequest } from 'ahooks';
|
4
4
|
import { queryLinkInterfacesLatestMetrics, queryLinkLatestMetrics, queryRetansRatioNetDelayRatio } from "../services";
|
5
|
-
import rlog from '@riil-frontend/component-topology-utils
|
5
|
+
import { rlog } from '@riil-frontend/component-topology-utils'; // 资源节点上方色块展示资源的发送速率发送带宽利用率、接收速率发送接收利用率、总错包数
|
6
6
|
|
7
7
|
export default function useMetricPolling(_ref) {
|
8
8
|
var linkCi = _ref.linkCi,
|
@@ -1,7 +1,7 @@
|
|
1
1
|
import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
|
2
2
|
import _regeneratorRuntime from "@babel/runtime/regenerator";
|
3
3
|
import { request } from '@riil-frontend/component-topology-utils';
|
4
|
-
import rlog from '@riil-frontend/component-topology-utils
|
4
|
+
import { rlog } from '@riil-frontend/component-topology-utils';
|
5
5
|
import ciTypeCache from "../../../../../../../../../models/cache/CiTypeCache";
|
6
6
|
import { INTERFACE_METRIC_CODES } from "../constants";
|
7
7
|
import { formatMetric } from "../../../../../../../../../utils/metricUtil";
|
@@ -34,7 +34,7 @@ var useAlarmAndRiskData = function useAlarmAndRiskData(props) {
|
|
34
34
|
while (1) switch (_context.prev = _context.next) {
|
35
35
|
case 0:
|
36
36
|
if (!isAppTopo) {
|
37
|
-
_context.next =
|
37
|
+
_context.next = 10;
|
38
38
|
break;
|
39
39
|
}
|
40
40
|
|
@@ -49,27 +49,29 @@ var useAlarmAndRiskData = function useAlarmAndRiskData(props) {
|
|
49
49
|
alarmList = _yield$resourceOvervi2.alarms;
|
50
50
|
alarmList = ((_alarmList = alarmList) === null || _alarmList === void 0 ? void 0 : _alarmList.map(function (item) {
|
51
51
|
return {
|
52
|
-
|
53
|
-
|
52
|
+
alarmInfo: item,
|
53
|
+
type: "alarm",
|
54
|
+
icon: "gaojing-3",
|
54
55
|
className: "alarm-color-icon-lv" + item.alertLevel,
|
55
56
|
title: "[" + item.alertObject + "] " + item.alertTitle,
|
56
|
-
link: "/default/pagecenter/alertDetail/view/" + item.alertId + "?alertId=" + item.alertId + "&resId=" + item.ciId + "&title=" + item.alertObject + "&ruleId=" + item.ruleId,
|
57
|
+
link: "/default/pagecenter/alertDetail/view/" + item.alertId + "?alertId=" + item.alertId + "&resId=" + item.ciId + "&title=" + encodeURI(encodeURI(item.alertObject)) + "&ruleId=" + item.ruleId,
|
57
58
|
time: item.createTime,
|
58
59
|
status: item.status,
|
59
60
|
params: [{
|
60
61
|
alertId: item.alertId,
|
61
|
-
status:
|
62
|
+
status: "dealing",
|
62
63
|
userId: userId,
|
63
64
|
isBaseAlert: false
|
64
65
|
}]
|
65
66
|
};
|
66
67
|
})) || [];
|
68
|
+
console.log("setAlarmRiskList", alarmList);
|
67
69
|
setAlarmRiskList(alarmList);
|
68
|
-
_context.next =
|
70
|
+
_context.next = 25;
|
69
71
|
break;
|
70
72
|
|
71
|
-
case
|
72
|
-
_context.next =
|
73
|
+
case 10:
|
74
|
+
_context.next = 12;
|
73
75
|
return alarmService.getAlarmByIds([id].concat(childrenIds), {
|
74
76
|
alertStatusList: ['toDeal', 'woDealing', 'dealing'],
|
75
77
|
// toDeal: 待处理, dealing:处理中
|
@@ -79,7 +81,7 @@ var useAlarmAndRiskData = function useAlarmAndRiskData(props) {
|
|
79
81
|
sortOrder: 'asc'
|
80
82
|
});
|
81
83
|
|
82
|
-
case
|
84
|
+
case 12:
|
83
85
|
_yield$alarmService$g2 = _context.sent;
|
84
86
|
_alarmList2 = _yield$alarmService$g2.datas;
|
85
87
|
// 2022-07-16 后端不支持多列排序,暂通过前端实现,按创建时间倒序
|
@@ -88,28 +90,28 @@ var useAlarmAndRiskData = function useAlarmAndRiskData(props) {
|
|
88
90
|
});
|
89
91
|
_alarmList2 = _alarmList2.map(function (item) {
|
90
92
|
return {
|
91
|
-
type:
|
92
|
-
icon:
|
93
|
+
type: "alarm",
|
94
|
+
icon: "gaojing-3",
|
93
95
|
className: "alarm-color-icon-lv" + item.alertLevel,
|
94
96
|
title: "" + item.alertObject + item.alertTitle,
|
95
|
-
link: "/default/pagecenter/alertDetail/view/" + item.alertId + "?alertId=" + item.alertId + "&resId=" + item.ciId + "&title=" + item.alertObject + "&ruleId=" + item.ruleId,
|
97
|
+
link: "/default/pagecenter/alertDetail/view/" + item.alertId + "?alertId=" + item.alertId + "&resId=" + item.ciId + "&title=" + encodeURI(encodeURI(item.alertObject)) + "&ruleId=" + item.ruleId,
|
96
98
|
time: item.createTime,
|
97
99
|
status: item.status,
|
98
100
|
params: [{
|
99
101
|
alertId: item.alertId,
|
100
|
-
status:
|
102
|
+
status: "dealing",
|
101
103
|
userId: userId,
|
102
104
|
isBaseAlert: false
|
103
105
|
}]
|
104
106
|
};
|
105
107
|
}); // fix NEWITOM-33635【南昌大学】网络拓扑上双击设备拉开的抽屉中无法看到风险
|
106
108
|
|
107
|
-
_context.next =
|
109
|
+
_context.next = 18;
|
108
110
|
return service.queryAllComponentsByCiId(id);
|
109
111
|
|
110
|
-
case
|
112
|
+
case 18:
|
111
113
|
AllComponentsByCiId = _context.sent;
|
112
|
-
_context.next =
|
114
|
+
_context.next = 21;
|
113
115
|
return service.getRiskByIds({
|
114
116
|
ciIdList: [id].concat(childrenIds, AllComponentsByCiId.map(function (item) {
|
115
117
|
return item.id;
|
@@ -119,7 +121,7 @@ var useAlarmAndRiskData = function useAlarmAndRiskData(props) {
|
|
119
121
|
pageSize: 10000
|
120
122
|
});
|
121
123
|
|
122
|
-
case
|
124
|
+
case 21:
|
123
125
|
_yield$service$getRis2 = _context.sent;
|
124
126
|
riskList = _yield$service$getRis2.content;
|
125
127
|
riskList = riskList.map(function (item) {
|
@@ -135,7 +137,7 @@ var useAlarmAndRiskData = function useAlarmAndRiskData(props) {
|
|
135
137
|
|
136
138
|
setAlarmRiskList([].concat(_alarmList2, riskList));
|
137
139
|
|
138
|
-
case
|
140
|
+
case 25:
|
139
141
|
case "end":
|
140
142
|
return _context.stop();
|
141
143
|
}
|
@@ -3,7 +3,7 @@ import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
|
|
3
3
|
import _regeneratorRuntime from "@babel/runtime/regenerator";
|
4
4
|
import { useRequest } from 'ahooks';
|
5
5
|
import topoService from '@riil-frontend/component-topology-common/es/services/topo';
|
6
|
-
import rlog from '@riil-frontend/component-topology-utils
|
6
|
+
import { rlog } from '@riil-frontend/component-topology-utils';
|
7
7
|
import { useEffect, useState } from 'react';
|
8
8
|
|
9
9
|
function queryWebConsoleUrlById(_x) {
|
@@ -4,7 +4,7 @@ import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
|
|
4
4
|
import _regeneratorRuntime from "@babel/runtime/regenerator";
|
5
5
|
import React, { forwardRef, useCallback, useEffect, useImperativeHandle, useState } from 'react';
|
6
6
|
import { useBoolean } from 'ahooks';
|
7
|
-
import rlog from '@riil-frontend/component-topology-utils
|
7
|
+
import { rlog } from '@riil-frontend/component-topology-utils';
|
8
8
|
import { TopoEvent } from '@riil-frontend/component-topology-graph';
|
9
9
|
import styles from "./index.module.scss";
|
10
10
|
import LinkSetting from "./setting";
|
@@ -1,7 +1,7 @@
|
|
1
1
|
import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
|
2
2
|
import _regeneratorRuntime from "@babel/runtime/regenerator";
|
3
3
|
import { TopoEvent } from '@riil-frontend/component-topology-graph';
|
4
|
-
import rlog from '@riil-frontend/component-topology-utils
|
4
|
+
import { rlog } from '@riil-frontend/component-topology-utils';
|
5
5
|
import { loopTreeFun } from "../../../utils/tree";
|
6
6
|
/**
|
7
7
|
* 关联拓扑
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import rlog from '@riil-frontend/component-topology-utils
|
1
|
+
import { rlog } from '@riil-frontend/component-topology-utils';
|
2
2
|
import { isClusterHtElement } from "../../utils/clusterUtil";
|
3
3
|
import { getEdgeGroupByNodeTags, getEdges, isNode } from "../../utils/htElementUtils";
|
4
4
|
import { getLinksBetweenNodes } from "../utils/linkUtil"; // network_link.actual_bandwidth
|
@@ -3,7 +3,7 @@ import _extends from "@babel/runtime/helpers/extends";
|
|
3
3
|
/**
|
4
4
|
* 连线组标注、悬浮框数据构建
|
5
5
|
*/
|
6
|
-
import rlog from '@riil-frontend/component-topology-utils
|
6
|
+
import { rlog } from '@riil-frontend/component-topology-utils';
|
7
7
|
import { getEdgeGroups } from "../../utils/htElementUtils";
|
8
8
|
import AttributeFormatter from "../../core/models/attributeFormatter"; // 参与计算的链路指标
|
9
9
|
|
@@ -3,7 +3,7 @@ import _extends from "@babel/runtime/helpers/extends";
|
|
3
3
|
import _assertThisInitialized from "@babel/runtime/helpers/assertThisInitialized";
|
4
4
|
import _inheritsLoose from "@babel/runtime/helpers/inheritsLoose";
|
5
5
|
import _regeneratorRuntime from "@babel/runtime/regenerator";
|
6
|
-
import rlog from '@riil-frontend/component-topology-utils
|
6
|
+
import { rlog } from '@riil-frontend/component-topology-utils';
|
7
7
|
import TopoApp from "../../core/models/TopoApp";
|
8
8
|
import createMenuCommands from "../../contextmenu/createMenuCommands";
|
9
9
|
import getTopoData from "../getTopoData";
|
@@ -3,7 +3,7 @@ import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
|
|
3
3
|
import _regeneratorRuntime from "@babel/runtime/regenerator";
|
4
4
|
import { request } from '@riil-frontend/component-topology-utils';
|
5
5
|
import { isNull } from '@riil-frontend/utils';
|
6
|
-
import rlog from '@riil-frontend/component-topology-utils
|
6
|
+
import { rlog } from '@riil-frontend/component-topology-utils';
|
7
7
|
import { DICT } from "../utils/storage";
|
8
8
|
import { modelDictList } from "./mdc";
|
9
9
|
/**
|
@@ -4,7 +4,7 @@ import _extends from "@babel/runtime/helpers/extends";
|
|
4
4
|
var _excluded = ["groups", "resources", "exportLinkIdList"];
|
5
5
|
import _regeneratorRuntime from "@babel/runtime/regenerator";
|
6
6
|
import { request } from '@riil-frontend/component-topology-utils';
|
7
|
-
import rlog from '@riil-frontend/component-topology-utils
|
7
|
+
import { rlog } from '@riil-frontend/component-topology-utils';
|
8
8
|
import blackList from "./blacklist";
|
9
9
|
import { TOPO_API_ROOT } from "./constants";
|
10
10
|
import { getBatchCi as _getBatchCi, getBatchCiMetric as _getBatchCiMetric } from "../model";
|
@@ -1,6 +1,6 @@
|
|
1
1
|
import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
|
2
2
|
import _regeneratorRuntime from "@babel/runtime/regenerator";
|
3
|
-
import rlog from '@riil-frontend/component-topology-utils
|
3
|
+
import { rlog } from '@riil-frontend/component-topology-utils';
|
4
4
|
import { request } from '@riil-frontend/component-topology-utils';
|
5
5
|
import { TOPO_API_ROOT } from "./constants";
|
6
6
|
export default {
|
@@ -5,7 +5,7 @@ import _regeneratorRuntime from "@babel/runtime/regenerator";
|
|
5
5
|
/**
|
6
6
|
* 功能权限 Model
|
7
7
|
*/
|
8
|
-
import rlog from '@riil-frontend/component-topology-utils
|
8
|
+
import { rlog } from '@riil-frontend/component-topology-utils';
|
9
9
|
export default function (topo) {
|
10
10
|
return {
|
11
11
|
// 定义 model 的初始 state
|
@@ -7,7 +7,7 @@ import _regeneratorRuntime from "@babel/runtime/regenerator";
|
|
7
7
|
*
|
8
8
|
*
|
9
9
|
*/
|
10
|
-
import rlog from '@riil-frontend/component-topology-utils
|
10
|
+
import { rlog } from '@riil-frontend/component-topology-utils';
|
11
11
|
export default {
|
12
12
|
// 定义 model 的初始 state
|
13
13
|
state: {
|
@@ -2,7 +2,7 @@ import _Message from "@alifd/next/es/message";
|
|
2
2
|
import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
|
3
3
|
import _extends from "@babel/runtime/helpers/extends";
|
4
4
|
import _regeneratorRuntime from "@babel/runtime/regenerator";
|
5
|
-
import rlog from '@riil-frontend/component-topology-utils
|
5
|
+
import { rlog } from '@riil-frontend/component-topology-utils';
|
6
6
|
import { formatTree, loopTree, loopTreeFun, findParentIdsById, treeNodeCount } from "../../utils/tree";
|
7
7
|
|
8
8
|
var clone = function clone(data) {
|
@@ -1,7 +1,7 @@
|
|
1
1
|
import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
|
2
2
|
import _regeneratorRuntime from "@babel/runtime/regenerator";
|
3
3
|
import { request } from '@riil-frontend/component-topology-utils';
|
4
|
-
import rlog from '@riil-frontend/component-topology-utils
|
4
|
+
import { rlog } from '@riil-frontend/component-topology-utils';
|
5
5
|
import { findClusters, isCluster } from "../../utils/clusterUtil";
|
6
6
|
export default function (_x) {
|
7
7
|
return _ref.apply(this, arguments);
|
package/es/style.js
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
import '@riil-frontend/component-topology-graph/es/style';
|
2
2
|
import '@alifd/next/es/box/style';
|
3
|
-
import '@alifd/next/es/message/style';
|
4
3
|
import '@riil-frontend/component-topology-utils/es/style';
|
4
|
+
import '@alifd/next/es/message/style';
|
5
5
|
import '@riil-frontend/component-riil-event-emitter/es/style';
|
6
6
|
import '@riil-frontend/utils/es/style';
|
7
7
|
import '@alifd/next/es/menu-button/style';
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import rlog from '@riil-frontend/component-topology-utils
|
1
|
+
import { rlog } from '@riil-frontend/component-topology-utils';
|
2
2
|
import sortBy from 'lodash/sortBy';
|
3
3
|
import { isExitLink } from "../core/models/utils/linkUtils";
|
4
4
|
import { isClusterHtElement } from "./clusterUtil";
|
@@ -0,0 +1,12 @@
|
|
1
|
+
/**
|
2
|
+
* 翻译ci列表引用属性名称
|
3
|
+
* @param ciDatas
|
4
|
+
* @returns
|
5
|
+
*/
|
6
|
+
export declare function translateCisRefAttributeName(ciDatas: Array<any>): Promise<Array<any>>;
|
7
|
+
/**
|
8
|
+
* 翻译ci引用属性名称
|
9
|
+
* @param ciData
|
10
|
+
* @returns
|
11
|
+
*/
|
12
|
+
export declare function translateCiRefAttributeName(ciData: any): Promise<any>;
|
@@ -0,0 +1,156 @@
|
|
1
|
+
import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
|
2
|
+
import _extends from "@babel/runtime/helpers/extends";
|
3
|
+
import _regeneratorRuntime from "@babel/runtime/regenerator";
|
4
|
+
import { rlog } from '@riil-frontend/component-topology-utils';
|
5
|
+
import ciTypeCache from "../core/models/cache/CiTypeCache";
|
6
|
+
import ciCache from "../core/models/cache/CiCache";
|
7
|
+
import { getCiTypesFromCiElements } from "./topoData";
|
8
|
+
|
9
|
+
/**
|
10
|
+
* 获取ci列表的引用字段列表
|
11
|
+
*/
|
12
|
+
function getCiRefAttributesMap(ciDatas, ciTypeMap) {
|
13
|
+
// ci引用字段列表
|
14
|
+
var ciRefAttributeMap = {};
|
15
|
+
ciDatas.forEach(function (ciData) {
|
16
|
+
var id = ciData.id;
|
17
|
+
var attributeMap = ciData.attributeMap || ciData.attributes;
|
18
|
+
ciRefAttributeMap[id] = [];
|
19
|
+
var typeCode = ciData.typeCode || ciData.ciType;
|
20
|
+
var ciTypeMeta = ciTypeMap[typeCode];
|
21
|
+
|
22
|
+
if (ciTypeMeta) {
|
23
|
+
ciTypeMeta.attributes.filter(function (attributeMeta) {
|
24
|
+
return !!attributeMeta.refCi;
|
25
|
+
}).forEach(function (attributeMeta) {
|
26
|
+
var refId = attributeMap[attributeMeta.code];
|
27
|
+
|
28
|
+
if (refId) {
|
29
|
+
var ciRefAttributeData = {
|
30
|
+
attrCode: attributeMeta.code,
|
31
|
+
id: refId
|
32
|
+
};
|
33
|
+
ciRefAttributeMap[ciData.id].push(ciRefAttributeData);
|
34
|
+
}
|
35
|
+
});
|
36
|
+
} else {
|
37
|
+
rlog.warn("\u7FFB\u8BD1\u5F15\u7528\u5B57\u6BB5\u540D\u79F0\uFF1A\u672A\u67E5\u8BE2\u5230ciType " + typeCode, ciData);
|
38
|
+
}
|
39
|
+
});
|
40
|
+
return ciRefAttributeMap;
|
41
|
+
}
|
42
|
+
|
43
|
+
function getRefIds(ciRefAttributesMap) {
|
44
|
+
var refIds = [];
|
45
|
+
Object.keys(ciRefAttributesMap).forEach(function (ciId) {
|
46
|
+
var ciRefAttributeDatas = ciRefAttributesMap[ciId];
|
47
|
+
ciRefAttributeDatas.forEach(function (ciRefAttributeData) {
|
48
|
+
var refId = ciRefAttributeData.id;
|
49
|
+
|
50
|
+
if (!refIds.includes(refId)) {
|
51
|
+
refIds.push(refId);
|
52
|
+
}
|
53
|
+
});
|
54
|
+
});
|
55
|
+
return refIds;
|
56
|
+
}
|
57
|
+
|
58
|
+
function addRefCiNameToCiDatas(ciDatas, ciRefAttributesMap, refCiMap) {
|
59
|
+
return ciDatas.map(function (ciData) {
|
60
|
+
var id = ciData.id;
|
61
|
+
|
62
|
+
var attributeMap = _extends({}, ciData.attributeMap || ciData.attributes);
|
63
|
+
|
64
|
+
ciRefAttributesMap[id].forEach(function (refAttrs) {
|
65
|
+
var refCi = refCiMap[refAttrs.id];
|
66
|
+
|
67
|
+
if (refCi) {
|
68
|
+
// 引用ci名称获取规则:如果ci是树形结构(例如区域),取 tree_name_path;非树形,取display_name
|
69
|
+
var displayName = refCi.attributes.tree_name_path || refCi.attributes.display_name;
|
70
|
+
attributeMap[refAttrs.attrCode + "_object"] = {
|
71
|
+
displayName: displayName
|
72
|
+
};
|
73
|
+
}
|
74
|
+
});
|
75
|
+
return _extends({}, ciData, {
|
76
|
+
attributeMap: attributeMap
|
77
|
+
});
|
78
|
+
});
|
79
|
+
}
|
80
|
+
/**
|
81
|
+
* 翻译ci列表引用属性名称
|
82
|
+
* @param ciDatas
|
83
|
+
* @returns
|
84
|
+
*/
|
85
|
+
|
86
|
+
|
87
|
+
export function translateCisRefAttributeName(_x) {
|
88
|
+
return _translateCisRefAttributeName.apply(this, arguments);
|
89
|
+
}
|
90
|
+
/**
|
91
|
+
* 翻译ci引用属性名称
|
92
|
+
* @param ciData
|
93
|
+
* @returns
|
94
|
+
*/
|
95
|
+
|
96
|
+
function _translateCisRefAttributeName() {
|
97
|
+
_translateCisRefAttributeName = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(ciDatas) {
|
98
|
+
var ciTypeMap, ciRefAttributesMap, refIds, refCiMap;
|
99
|
+
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
100
|
+
while (1) switch (_context.prev = _context.next) {
|
101
|
+
case 0:
|
102
|
+
_context.next = 2;
|
103
|
+
return ciTypeCache.load(getCiTypesFromCiElements(ciDatas));
|
104
|
+
|
105
|
+
case 2:
|
106
|
+
ciTypeMap = _context.sent;
|
107
|
+
// 2. 查找引用字段及值
|
108
|
+
ciRefAttributesMap = getCiRefAttributesMap(ciDatas, ciTypeMap); // 3. 引用id列表
|
109
|
+
|
110
|
+
refIds = getRefIds(ciRefAttributesMap);
|
111
|
+
|
112
|
+
if (refIds.length) {
|
113
|
+
_context.next = 7;
|
114
|
+
break;
|
115
|
+
}
|
116
|
+
|
117
|
+
return _context.abrupt("return", ciDatas);
|
118
|
+
|
119
|
+
case 7:
|
120
|
+
_context.next = 9;
|
121
|
+
return ciCache.load(refIds);
|
122
|
+
|
123
|
+
case 9:
|
124
|
+
refCiMap = _context.sent;
|
125
|
+
return _context.abrupt("return", addRefCiNameToCiDatas(ciDatas, ciRefAttributesMap, refCiMap));
|
126
|
+
|
127
|
+
case 11:
|
128
|
+
case "end":
|
129
|
+
return _context.stop();
|
130
|
+
}
|
131
|
+
}, _callee);
|
132
|
+
}));
|
133
|
+
return _translateCisRefAttributeName.apply(this, arguments);
|
134
|
+
}
|
135
|
+
|
136
|
+
export function translateCiRefAttributeName(_x2) {
|
137
|
+
return _translateCiRefAttributeName.apply(this, arguments);
|
138
|
+
}
|
139
|
+
|
140
|
+
function _translateCiRefAttributeName() {
|
141
|
+
_translateCiRefAttributeName = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2(ciData) {
|
142
|
+
var result;
|
143
|
+
return _regeneratorRuntime.wrap(function _callee2$(_context2) {
|
144
|
+
while (1) switch (_context2.prev = _context2.next) {
|
145
|
+
case 0:
|
146
|
+
result = translateCisRefAttributeName([]);
|
147
|
+
return _context2.abrupt("return", result[0]);
|
148
|
+
|
149
|
+
case 2:
|
150
|
+
case "end":
|
151
|
+
return _context2.stop();
|
152
|
+
}
|
153
|
+
}, _callee2);
|
154
|
+
}));
|
155
|
+
return _translateCiRefAttributeName.apply(this, arguments);
|
156
|
+
}
|
package/es/utils/format.js
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
2
|
-
import rlog from '@riil-frontend/component-topology-utils
|
2
|
+
import { rlog } from '@riil-frontend/component-topology-utils';
|
3
3
|
import { isAvailableArray, isNull } from '@riil-frontend/utils';
|
4
4
|
export function formatDataForTable(dataSource, total, currentPage, pageSize) {
|
5
5
|
// 权限过滤 (无权限时:ip地址,类型,厂家为'未知')
|
package/es/utils/topoData.js
CHANGED
@@ -97,8 +97,10 @@ var tfLink = function tfLink(engine, link) {
|
|
97
97
|
export function getCiTypesFromCiElements(allCi) {
|
98
98
|
var ciTypes = [];
|
99
99
|
allCi.forEach(function (element) {
|
100
|
-
|
101
|
-
|
100
|
+
var typeCode = element.typeCode || element.ciType;
|
101
|
+
|
102
|
+
if (typeCode && ciTypes.indexOf(typeCode) < 0) {
|
103
|
+
ciTypes.push(typeCode);
|
102
104
|
}
|
103
105
|
});
|
104
106
|
return ciTypes;
|
@@ -21,7 +21,7 @@ var _objectWithoutPropertiesLoose2 = _interopRequireDefault(require("@babel/runt
|
|
21
21
|
|
22
22
|
var _react = _interopRequireWildcard(require("react"));
|
23
23
|
|
24
|
-
var
|
24
|
+
var _componentTopologyUtils = require("@riil-frontend/component-topology-utils");
|
25
25
|
|
26
26
|
var _componentActionTree = _interopRequireDefault(require("@riil-frontend/component-action-tree"));
|
27
27
|
|
@@ -112,7 +112,7 @@ var Setting = function Setting(_ref) {
|
|
112
112
|
var onTableSelect = function onTableSelect(selectedKeys) {
|
113
113
|
var values = (0, _extends2["default"])({}, selected);
|
114
114
|
|
115
|
-
|
115
|
+
_componentTopologyUtils.rlog.debug('Setting-allCiSet-onTableSelect', limit, selectedKeys, selected);
|
116
116
|
|
117
117
|
values[ciType] = selectedKeys;
|
118
118
|
setSelected(values);
|
package/lib/components/ModelAttrSelectDrawer/components/MultipleTypeAttributeSelectDrawer.js
CHANGED
@@ -7,7 +7,7 @@ exports["default"] = void 0;
|
|
7
7
|
|
8
8
|
var _react = _interopRequireWildcard(require("react"));
|
9
9
|
|
10
|
-
var
|
10
|
+
var _componentTopologyUtils = require("@riil-frontend/component-topology-utils");
|
11
11
|
|
12
12
|
var _ModelAttrSelectDrawer = _interopRequireDefault(require("./ModelAttrSelectDrawer"));
|
13
13
|
|
@@ -62,7 +62,7 @@ var MultipleTypeAttributeSelectDrawer = /*#__PURE__*/(0, _react.forwardRef)(func
|
|
62
62
|
}); // 保存指标设置
|
63
63
|
|
64
64
|
var save = function save(xx, parm) {
|
65
|
-
|
65
|
+
_componentTopologyUtils.rlog.debug('saveMarkSetting', parm);
|
66
66
|
|
67
67
|
var newSelected = {};
|
68
68
|
Object.keys(parm).forEach(function (ciType) {
|
@@ -13,7 +13,7 @@ var _react = _interopRequireWildcard(require("react"));
|
|
13
13
|
|
14
14
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
15
15
|
|
16
|
-
var
|
16
|
+
var _componentTopologyUtils = require("@riil-frontend/component-topology-utils");
|
17
17
|
|
18
18
|
var _Drawer = _interopRequireDefault(require("../Drawer"));
|
19
19
|
|
@@ -83,7 +83,7 @@ function ResourceSelectDrawer(props) {
|
|
83
83
|
_context.t0 = _context["catch"](1);
|
84
84
|
setLoading(false);
|
85
85
|
|
86
|
-
|
86
|
+
_componentTopologyUtils.rlog.error('ResourceSelectDrawer.handleOk', _context.t0);
|
87
87
|
|
88
88
|
case 13:
|
89
89
|
case "end":
|