@riil-frontend/component-topology 9.0.0-a.1 → 9.0.0-a.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/index.css +1 -1
- package/build/index.js +7 -7
- package/es/components/VerticalIconTab/VerticalIconTab.module.scss +11 -5
- 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.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/LineType.js +1 -1
- package/es/core/event/topoEventListener.js +22 -0
- package/es/core/hooks/useAlarm.js +18 -12
- package/es/core/hooks/useCiAttributeChange.js +60 -0
- package/es/core/hooks/usePolling.js +163 -60
- package/es/core/hooks/useTopoEventListener.js +4 -18
- package/es/core/models/Alarm.js +4 -13
- package/es/core/models/AttributeMetricDisplay.js +44 -127
- package/es/core/models/TopoApp.js +4 -2
- package/es/core/models/attributeFormatter/index.js +5 -6
- package/es/core/models/cache/CiCache.d.ts +18 -0
- package/es/core/models/cache/CiCache.js +78 -0
- package/es/core/models/utils/linkUtils.js +10 -13
- package/es/core/store/models/topoBizMod.js +4 -0
- package/es/core/store/models/viewer/resourceDetail.js +7 -0
- package/es/core/viewer/components/plugins/ResourceDetail/ResourceDetailDrawer.js +10 -9
- package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/ResourceOverview.js +100 -46
- 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 +8 -26
- package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/hooks/useMetricModels.js +13 -52
- package/es/style.js +1 -1
- package/lib/components/VerticalIconTab/VerticalIconTab.module.scss +11 -5
- 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.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/LineType.js +1 -1
- package/lib/core/event/topoEventListener.js +27 -0
- package/lib/core/hooks/useAlarm.js +19 -12
- package/lib/core/hooks/useCiAttributeChange.js +70 -0
- package/lib/core/hooks/usePolling.js +166 -61
- package/lib/core/hooks/useTopoEventListener.js +3 -17
- package/lib/core/models/Alarm.js +5 -16
- package/lib/core/models/AttributeMetricDisplay.js +44 -126
- package/lib/core/models/TopoApp.js +4 -1
- package/lib/core/models/attributeFormatter/index.js +5 -7
- package/lib/core/models/cache/CiCache.d.ts +18 -0
- package/lib/core/models/cache/CiCache.js +89 -0
- package/lib/core/models/utils/linkUtils.js +10 -12
- package/lib/core/store/models/topoBizMod.js +4 -0
- package/lib/core/store/models/viewer/resourceDetail.js +7 -0
- package/lib/core/viewer/components/plugins/ResourceDetail/ResourceDetailDrawer.js +10 -9
- package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/ResourceOverview.js +99 -45
- 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 +8 -26
- package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/hooks/useMetricModels.js +13 -53
- package/lib/style.js +1 -1
- package/package.json +3 -3
@@ -30,7 +30,7 @@ import Configurator from "./components/Configurator";
|
|
30
30
|
import { formatMetric } from "../../../../../../models/attributeFormatter";
|
31
31
|
import LinkTopoCard from "./components/LinkTopo/LinkTopoCard";
|
32
32
|
import EventsCard from "./EventsCard";
|
33
|
-
import { queryLastestValue } from "./components/LinkTopo/services"; // url 处理,UICBB 的地址需截取前缀
|
33
|
+
import { checkMenu, isOpenFlow, queryLastestValue } from "./components/LinkTopo/services"; // url 处理,UICBB 的地址需截取前缀
|
34
34
|
|
35
35
|
function formatUrl(url) {
|
36
36
|
var _window, _window$location;
|
@@ -489,32 +489,39 @@ export default function ResourceOverview(props) {
|
|
489
489
|
switch (_context5.prev = _context5.next) {
|
490
490
|
case 0:
|
491
491
|
_context5.t0 = item.dataIndex;
|
492
|
-
_context5.next = _context5.t0 === 'display_name' ? 3 : _context5.t0 === 'ciName' ?
|
492
|
+
_context5.next = _context5.t0 === 'display_name' ? 3 : _context5.t0 === 'ciName' ? 6 : _context5.t0 === 'res_address' ? 9 : _context5.t0 === 'imageName' ? 16 : 20;
|
493
493
|
break;
|
494
494
|
|
495
495
|
case 3:
|
496
|
-
|
497
|
-
|
498
|
-
|
499
|
-
|
500
|
-
|
501
|
-
|
502
|
-
|
503
|
-
|
504
|
-
|
496
|
+
// 无监控模板不能跳转详情。跳转前需判定资源实例数据属性中是否包含support_templates属性。若不包含,则不能跳转
|
497
|
+
if (attributeMap.support_templates) {
|
498
|
+
link = "/default/pagecenter/resDetail/view/" + id + "?resId=" + id + "&domainCode=" + ciTypeMeta.domain + "&title=" + attributeMap.display_name + "&ciCode=" + ciType; // 资源跳转链接
|
499
|
+
|
500
|
+
value = /*#__PURE__*/React.createElement("span", {
|
501
|
+
onClick: onClose
|
502
|
+
}, /*#__PURE__*/React.createElement(Link, {
|
503
|
+
className: styles.link,
|
504
|
+
disabled: true,
|
505
|
+
title: attributeMap.display_name || '',
|
506
|
+
to: formatUrl(link)
|
507
|
+
}, attributeMap.display_name || '-'));
|
508
|
+
} else {
|
509
|
+
value = attributeMap.display_name || '-';
|
510
|
+
}
|
511
|
+
|
505
512
|
contentTitle = attributeMap.display_name || '-';
|
506
|
-
return _context5.abrupt("break",
|
513
|
+
return _context5.abrupt("break", 21);
|
507
514
|
|
508
|
-
case
|
515
|
+
case 6:
|
509
516
|
value = ciTypeMeta.displayName;
|
510
517
|
contentTitle = value;
|
511
|
-
return _context5.abrupt("break",
|
518
|
+
return _context5.abrupt("break", 21);
|
512
519
|
|
513
|
-
case
|
514
|
-
_context5.next =
|
520
|
+
case 9:
|
521
|
+
_context5.next = 11;
|
515
522
|
return getAddressFormat(attributeMap);
|
516
523
|
|
517
|
-
case
|
524
|
+
case 11:
|
518
525
|
address = _context5.sent;
|
519
526
|
owned_computer_room = attributeMap.owned_computer_room, owned_cabinet = attributeMap.owned_cabinet; // 跳转3D机房定位设备
|
520
527
|
|
@@ -534,18 +541,18 @@ export default function ResourceOverview(props) {
|
|
534
541
|
}
|
535
542
|
|
536
543
|
contentTitle = address;
|
537
|
-
return _context5.abrupt("break",
|
544
|
+
return _context5.abrupt("break", 21);
|
538
545
|
|
539
|
-
case
|
546
|
+
case 16:
|
540
547
|
node = topo.getDataModel().getDataByTag(id);
|
541
548
|
value = (node === null || node === void 0 ? void 0 : node.a('customName')) || (node === null || node === void 0 ? void 0 : node.a('name')) || '-';
|
542
549
|
contentTitle = value;
|
543
|
-
return _context5.abrupt("break",
|
550
|
+
return _context5.abrupt("break", 21);
|
544
551
|
|
545
|
-
case
|
546
|
-
return _context5.abrupt("break",
|
552
|
+
case 20:
|
553
|
+
return _context5.abrupt("break", 21);
|
547
554
|
|
548
|
-
case
|
555
|
+
case 21:
|
549
556
|
case "end":
|
550
557
|
return _context5.stop();
|
551
558
|
}
|
@@ -734,7 +741,9 @@ export default function ResourceOverview(props) {
|
|
734
741
|
case 11:
|
735
742
|
metricList = _context8.sent;
|
736
743
|
_context8.next = 14;
|
737
|
-
return
|
744
|
+
return queryMetricList({
|
745
|
+
'name': data.attributes.display_name
|
746
|
+
}, {
|
738
747
|
'id': data.attributes.name
|
739
748
|
});
|
740
749
|
|
@@ -776,36 +785,81 @@ export default function ResourceOverview(props) {
|
|
776
785
|
return _metricColChange.apply(this, arguments);
|
777
786
|
}
|
778
787
|
|
788
|
+
function queryMetricList(_x9, _x10) {
|
789
|
+
return _queryMetricList.apply(this, arguments);
|
790
|
+
}
|
791
|
+
|
792
|
+
function _queryMetricList() {
|
793
|
+
_queryMetricList = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee9(data, param) {
|
794
|
+
var checkMenus, isOpen, list;
|
795
|
+
return _regeneratorRuntime.wrap(function _callee9$(_context9) {
|
796
|
+
while (1) {
|
797
|
+
switch (_context9.prev = _context9.next) {
|
798
|
+
case 0:
|
799
|
+
if (!(ciType !== 'network_link')) {
|
800
|
+
_context9.next = 2;
|
801
|
+
break;
|
802
|
+
}
|
803
|
+
|
804
|
+
return _context9.abrupt("return", []);
|
805
|
+
|
806
|
+
case 2:
|
807
|
+
_context9.next = 4;
|
808
|
+
return checkMenu();
|
809
|
+
|
810
|
+
case 4:
|
811
|
+
checkMenus = _context9.sent;
|
812
|
+
|
813
|
+
if (!(checkMenus[0].passed == 'PASS')) {
|
814
|
+
_context9.next = 14;
|
815
|
+
break;
|
816
|
+
}
|
817
|
+
|
818
|
+
_context9.next = 8;
|
819
|
+
return isOpenFlow(data);
|
820
|
+
|
821
|
+
case 8:
|
822
|
+
isOpen = _context9.sent;
|
823
|
+
|
824
|
+
if (!isOpen) {
|
825
|
+
_context9.next = 14;
|
826
|
+
break;
|
827
|
+
}
|
828
|
+
|
829
|
+
_context9.next = 12;
|
830
|
+
return queryLastestValue(param);
|
831
|
+
|
832
|
+
case 12:
|
833
|
+
list = _context9.sent;
|
834
|
+
return _context9.abrupt("return", list);
|
835
|
+
|
836
|
+
case 14:
|
837
|
+
return _context9.abrupt("return", []);
|
838
|
+
|
839
|
+
case 15:
|
840
|
+
case "end":
|
841
|
+
return _context9.stop();
|
842
|
+
}
|
843
|
+
}
|
844
|
+
}, _callee9);
|
845
|
+
}));
|
846
|
+
return _queryMetricList.apply(this, arguments);
|
847
|
+
}
|
848
|
+
|
779
849
|
var getNewMetricList = function getNewMetricList(data) {
|
780
850
|
return [{
|
781
851
|
errorMsg: null,
|
782
|
-
mainCiId: "
|
783
|
-
metricCode: "
|
784
|
-
metricValue: data.downNetDelayRatio,
|
785
|
-
subCiId: '',
|
786
|
-
subCiType: null,
|
787
|
-
mainCiType: null
|
788
|
-
}, {
|
789
|
-
errorMsg: null,
|
790
|
-
mainCiId: "downRetansRatio",
|
791
|
-
metricCode: "downRetansRatio",
|
792
|
-
metricValue: data.downRetansRatio,
|
793
|
-
subCiId: '',
|
794
|
-
subCiType: null,
|
795
|
-
mainCiType: null
|
796
|
-
}, {
|
797
|
-
errorMsg: null,
|
798
|
-
mainCiId: "upNetDelayRatio",
|
799
|
-
metricCode: "upNetDelayRatio",
|
800
|
-
metricValue: data.upNetDelayRatio,
|
852
|
+
mainCiId: "netDelayRatio",
|
853
|
+
metricCode: "netDelayRatio",
|
854
|
+
metricValue: data.upNetDelayRatio + ' ms' + '|' + data.downNetDelayRatio + ' ms',
|
801
855
|
subCiId: '',
|
802
856
|
subCiType: null,
|
803
857
|
mainCiType: null
|
804
858
|
}, {
|
805
859
|
errorMsg: null,
|
806
|
-
mainCiId: "
|
807
|
-
metricCode: "
|
808
|
-
metricValue: data.upRetransRatio,
|
860
|
+
mainCiId: "retansRatio",
|
861
|
+
metricCode: "retansRatio",
|
862
|
+
metricValue: data.upRetransRatio + ' %' + '|' + data.downRetansRatio + ' %',
|
809
863
|
subCiId: '',
|
810
864
|
subCiType: null,
|
811
865
|
mainCiType: null
|
@@ -17,9 +17,9 @@ export default function LinkTopoCard(props) {
|
|
17
17
|
|
18
18
|
var supportTemplates = (data === null || data === void 0 ? void 0 : (_data$attributes = data.attributes) === null || _data$attributes === void 0 ? void 0 : _data$attributes.support_templates) || ''; // 该资源监控模板
|
19
19
|
|
20
|
-
var isCrucial = data === null || data === void 0 ? void 0 : data.attributes['network_link.is_crucial'];
|
20
|
+
var isCrucial = data === null || data === void 0 ? void 0 : data.attributes['network_link.is_crucial']; //是不是关键链路
|
21
21
|
|
22
|
-
var _useState = useState(
|
22
|
+
var _useState = useState(null),
|
23
23
|
openFlow = _useState[0],
|
24
24
|
setOpenFlow = _useState[1];
|
25
25
|
|
@@ -39,7 +39,7 @@ export default function LinkTopoCard(props) {
|
|
39
39
|
case 2:
|
40
40
|
checkMenus = _context.sent;
|
41
41
|
|
42
|
-
if (!(checkMenus[0].passed == 'PASS')) {
|
42
|
+
if (!(checkMenus[0].passed == 'PASS' && isCrucial)) {
|
43
43
|
_context.next = 10;
|
44
44
|
break;
|
45
45
|
}
|
@@ -55,12 +55,12 @@ export default function LinkTopoCard(props) {
|
|
55
55
|
//判断是不是有流量分析
|
56
56
|
if (isOpen) {
|
57
57
|
setOpenFlow({
|
58
|
-
name: '
|
58
|
+
name: '查看流量构成',
|
59
59
|
url: linkDetailsUrl
|
60
60
|
});
|
61
61
|
} else {
|
62
62
|
setOpenFlow({
|
63
|
-
name: '
|
63
|
+
name: '配置流量分析',
|
64
64
|
url: analysisUrl
|
65
65
|
});
|
66
66
|
}
|
@@ -101,7 +101,9 @@ export default function LinkTopoCard(props) {
|
|
101
101
|
})
|
102
102
|
}, /*#__PURE__*/React.createElement(LinkTopo, {
|
103
103
|
data: data,
|
104
|
-
linkMetricCodes: metricCodes
|
104
|
+
linkMetricCodes: openFlow && openFlow.name == '查看流量构成' ? metricCodes : metricCodes.filter(function (i) {
|
105
|
+
return i != 'netDelayRatio' && i != 'retansRatio';
|
106
|
+
}),
|
105
107
|
openFlow: openFlow
|
106
108
|
}));
|
107
109
|
}
|
@@ -8,7 +8,7 @@ export default function useMetricPolling(_ref) {
|
|
8
8
|
var linkCi = _ref.linkCi,
|
9
9
|
linkMetricCodes = _ref.linkMetricCodes;
|
10
10
|
var linkId = linkCi.id;
|
11
|
-
var arr = ['
|
11
|
+
var arr = ['netDelayRatio', 'retansRatio'];
|
12
12
|
var oldCodes = [];
|
13
13
|
var newCodes = [];
|
14
14
|
linkMetricCodes.map(function (item) {
|
@@ -36,39 +36,21 @@ export default function useMetricPolling(_ref) {
|
|
36
36
|
linkOther: []
|
37
37
|
};
|
38
38
|
|
39
|
-
if (newCodes.includes('
|
39
|
+
if (newCodes.includes('netDelayRatio')) {
|
40
40
|
datas.linkOther.push({
|
41
|
-
'code': '
|
41
|
+
'code': 'netDelayRatio',
|
42
42
|
'name': '下行RTT时延',
|
43
43
|
'ts': result.time,
|
44
|
-
'value': result.downNetDelayRatio + ' ms'
|
44
|
+
'value': result.upNetDelayRatio + ' ms' + '|' + result.downNetDelayRatio + ' ms'
|
45
45
|
});
|
46
46
|
}
|
47
47
|
|
48
|
-
if (newCodes.includes('
|
48
|
+
if (newCodes.includes('retansRatio')) {
|
49
49
|
datas.linkOther.push({
|
50
|
-
'code': '
|
51
|
-
'name': '
|
50
|
+
'code': 'retansRatio',
|
51
|
+
'name': '重传率',
|
52
52
|
'ts': result.time,
|
53
|
-
'value': result.downRetansRatio + ' %'
|
54
|
-
});
|
55
|
-
}
|
56
|
-
|
57
|
-
if (newCodes.includes('upNetDelayRatio')) {
|
58
|
-
datas.linkOther.push({
|
59
|
-
'code': 'upNetDelayRatio',
|
60
|
-
'name': '上行RTT时延',
|
61
|
-
'ts': result.time,
|
62
|
-
'value': result.upNetDelayRatio + ' ms'
|
63
|
-
});
|
64
|
-
}
|
65
|
-
|
66
|
-
if (newCodes.includes('upRetransRatio')) {
|
67
|
-
datas.linkOther.push({
|
68
|
-
'code': 'upRetransRatio',
|
69
|
-
'name': '上行重传率',
|
70
|
-
'ts': result.time,
|
71
|
-
'value': result.upRetransRatio + ' %'
|
53
|
+
'value': result.upRetransRatio + ' %' + '|' + result.downRetansRatio + ' %'
|
72
54
|
});
|
73
55
|
}
|
74
56
|
|
@@ -3,7 +3,6 @@ import _regeneratorRuntime from "@babel/runtime/regenerator";
|
|
3
3
|
import { useRequest } from 'ahooks';
|
4
4
|
import { useEffect, useState } from 'react';
|
5
5
|
import { queryCiMonitorMetricCodes } from "../../../getCiDisplayMetricModels";
|
6
|
-
import { checkMenu, isOpenFlow } from "../components/LinkTopo/services";
|
7
6
|
/**
|
8
7
|
* 概览指标定义
|
9
8
|
* @param {*} props
|
@@ -35,7 +34,7 @@ var useMetricModels = function useMetricModels(props) {
|
|
35
34
|
|
36
35
|
function _fetchData() {
|
37
36
|
_fetchData = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
|
38
|
-
var monitorMetrics, ciMonitorMetricModels,
|
37
|
+
var monitorMetrics, ciMonitorMetricModels, displayMetricModels, _metricCodes;
|
39
38
|
|
40
39
|
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
41
40
|
while (1) {
|
@@ -51,67 +50,29 @@ var useMetricModels = function useMetricModels(props) {
|
|
51
50
|
return item === m.code;
|
52
51
|
});
|
53
52
|
});
|
54
|
-
_context.next = 6;
|
55
|
-
return checkMenu();
|
56
53
|
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
if (!(checkMenus[0].passed == 'PASS' && resourceData.attributes.display_name && resourceData.attributes['network_link.is_crucial'])) {
|
61
|
-
_context.next = 12;
|
62
|
-
break;
|
63
|
-
}
|
64
|
-
|
65
|
-
_context.next = 10;
|
66
|
-
return isOpenFlow({
|
67
|
-
'name': resourceData.attributes.display_name
|
68
|
-
});
|
69
|
-
|
70
|
-
case 10:
|
71
|
-
isOpen = _context.sent;
|
72
|
-
|
73
|
-
//
|
74
|
-
if (isOpen) {
|
75
|
-
ciMonitorMetricModels.push({
|
76
|
-
changeValue: null,
|
77
|
-
code: "downNetDelayRatio",
|
78
|
-
id: "downNetDelayRatio",
|
79
|
-
isGoldMetric: true,
|
80
|
-
key: null,
|
81
|
-
name: "下行RTT时延",
|
82
|
-
unit: "ms"
|
83
|
-
});
|
84
|
-
ciMonitorMetricModels.push({
|
85
|
-
changeValue: null,
|
86
|
-
code: "downRetansRatio",
|
87
|
-
id: "downRetansRatio",
|
88
|
-
isGoldMetric: true,
|
89
|
-
key: null,
|
90
|
-
name: "下行重传率",
|
91
|
-
unit: "%"
|
92
|
-
});
|
93
|
-
ciMonitorMetricModels.push({
|
54
|
+
if (resourceData.attributes['network_link.is_crucial']) {
|
55
|
+
ciMonitorMetricModels.unshift({
|
94
56
|
changeValue: null,
|
95
|
-
code: "
|
96
|
-
id: "
|
57
|
+
code: "netDelayRatio",
|
58
|
+
id: "netDelayRatio",
|
97
59
|
isGoldMetric: true,
|
98
60
|
key: null,
|
99
|
-
name: "
|
61
|
+
name: "RTT时延",
|
100
62
|
unit: "ms"
|
101
63
|
});
|
102
|
-
ciMonitorMetricModels.
|
64
|
+
ciMonitorMetricModels.unshift({
|
103
65
|
changeValue: null,
|
104
|
-
code: "
|
105
|
-
id: "
|
66
|
+
code: "retansRatio",
|
67
|
+
id: "retansRatio",
|
106
68
|
isGoldMetric: true,
|
107
69
|
key: null,
|
108
|
-
name: "
|
70
|
+
name: "重传率",
|
109
71
|
unit: "%"
|
110
72
|
});
|
111
|
-
}
|
73
|
+
} // 未监控不显示指标,临时在这里处理
|
74
|
+
|
112
75
|
|
113
|
-
case 12:
|
114
|
-
// 未监控不显示指标,临时在这里处理
|
115
76
|
if (!isMonite) {
|
116
77
|
ciMonitorMetricModels = [];
|
117
78
|
}
|
@@ -143,7 +104,7 @@ var useMetricModels = function useMetricModels(props) {
|
|
143
104
|
|
144
105
|
return _context.abrupt("return", displayMetricModels);
|
145
106
|
|
146
|
-
case
|
107
|
+
case 10:
|
147
108
|
case "end":
|
148
109
|
return _context.stop();
|
149
110
|
}
|
package/es/style.js
CHANGED
@@ -3,10 +3,10 @@ import '@alifd/next/es/box/style';
|
|
3
3
|
import '@alifd/next/es/message/style';
|
4
4
|
import '@riil-frontend/component-topology-utils/es/style';
|
5
5
|
import '@riil-frontend/component-riil-event-emitter/es/style';
|
6
|
+
import '@riil-frontend/utils/es/style';
|
6
7
|
import '@alifd/next/es/drawer/style';
|
7
8
|
import '@alifd/next/es/menu-button/style';
|
8
9
|
import '@alifd/next/es/search/style';
|
9
|
-
import '@riil-frontend/utils/es/style';
|
10
10
|
import '@alifd/next/es/tab/style';
|
11
11
|
import '@alifd/next/es/table/style';
|
12
12
|
import '@riil-frontend/component-table-layout/es/style';
|
@@ -3,8 +3,8 @@
|
|
3
3
|
|
4
4
|
.tabs {
|
5
5
|
height: 100%;
|
6
|
-
|
7
|
-
}
|
6
|
+
display: flex;
|
7
|
+
}
|
8
8
|
|
9
9
|
// 导航
|
10
10
|
.nav {
|
@@ -49,17 +49,23 @@
|
|
49
49
|
|
50
50
|
// 标签页内容区
|
51
51
|
.content {
|
52
|
-
width: 260px;
|
52
|
+
// width: 260px;
|
53
53
|
height: 100%;
|
54
54
|
border-left: none !important;
|
55
|
-
border-right: 1px solid var(--tab-wrapped-border-line-color);
|
56
55
|
transition: width .1s linear;
|
56
|
+
overflow: initial !important;
|
57
57
|
|
58
58
|
:global {
|
59
59
|
.#{$css-prefix}tabs-tabpane {
|
60
|
-
|
60
|
+
position: absolute;
|
61
|
+
left: 0;
|
62
|
+
top: 0;
|
63
|
+
z-index: 1;
|
64
|
+
// width: 250px;
|
61
65
|
height: 100%;
|
62
66
|
overflow: auto;
|
67
|
+
background: #FFF;
|
68
|
+
border-right: 1px solid var(--tab-wrapped-border-line-color);
|
63
69
|
}
|
64
70
|
}
|
65
71
|
|
@@ -1,19 +1,19 @@
|
|
1
1
|
.sidebar {
|
2
2
|
// border-right: 1px solid #E6E7EB;
|
3
3
|
position: relative;
|
4
|
-
width: 60px;
|
4
|
+
// width: 60px;
|
5
5
|
|
6
6
|
.tabsContainer {
|
7
|
-
position: absolute;
|
8
|
-
|
7
|
+
// position: absolute;
|
8
|
+
// left: 0;
|
9
|
+
// top: 0;
|
10
|
+
// z-index: 1;
|
11
|
+
// width: 60px;
|
9
12
|
height: 100%;
|
10
|
-
left: 0;
|
11
|
-
top: 0;
|
12
|
-
z-index: 1;
|
13
13
|
background: #FFF;
|
14
14
|
|
15
15
|
&.expanded {
|
16
|
-
width: 320px;
|
16
|
+
// width: 320px;
|
17
17
|
}
|
18
18
|
}
|
19
19
|
}
|
@@ -0,0 +1,27 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
exports.__esModule = true;
|
4
|
+
exports.createTopoEventListener = createTopoEventListener;
|
5
|
+
var n = 0;
|
6
|
+
|
7
|
+
function createTopoEventListener(type, onMessage) {
|
8
|
+
var eventListenerName = "topo_" + n++;
|
9
|
+
var EE = window.EE;
|
10
|
+
|
11
|
+
if (EE) {
|
12
|
+
EE.on('topo', eventListenerName, function (data) {
|
13
|
+
if (data.type === type) {
|
14
|
+
onMessage(data.data);
|
15
|
+
}
|
16
|
+
});
|
17
|
+
}
|
18
|
+
|
19
|
+
return {
|
20
|
+
eventListenerName: eventListenerName,
|
21
|
+
close: function close() {
|
22
|
+
if (EE) {
|
23
|
+
window.EE.removeListener('topo', eventListenerName);
|
24
|
+
}
|
25
|
+
}
|
26
|
+
};
|
27
|
+
}
|
@@ -11,10 +11,10 @@ var _react = require("react");
|
|
11
11
|
|
12
12
|
var _rlog = _interopRequireDefault(require("@riil-frontend/component-topology-utils/es/rlog"));
|
13
13
|
|
14
|
-
var _componentRiilEventEmitter = require("@riil-frontend/component-riil-event-emitter");
|
15
|
-
|
16
14
|
var _useGraphAlarmDisplay = _interopRequireDefault(require("./useGraphAlarmDisplay"));
|
17
15
|
|
16
|
+
var _useTopoEventListener = _interopRequireDefault(require("./useTopoEventListener"));
|
17
|
+
|
18
18
|
/**
|
19
19
|
*
|
20
20
|
*
|
@@ -117,20 +117,27 @@ function useAlarm(options) {
|
|
117
117
|
received: data,
|
118
118
|
all: relateTopoAlarm
|
119
119
|
});
|
120
|
-
};
|
120
|
+
}; // 订阅消息
|
121
121
|
|
122
|
-
|
123
|
-
|
122
|
+
|
123
|
+
(0, _useTopoEventListener["default"])({
|
124
|
+
type: 'alarm',
|
124
125
|
onMessage: function onMessage(data) {
|
125
126
|
_rlog["default"].debug("Topoget--AlertMesage------------", topo, data);
|
126
127
|
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
128
|
+
topo.alarm.handleAlarmEvent(data);
|
129
|
+
}
|
130
|
+
});
|
131
|
+
(0, _useTopoEventListener["default"])({
|
132
|
+
type: 'risk',
|
133
|
+
onMessage: function onMessage(data) {
|
134
|
+
handleRiskData(data);
|
135
|
+
}
|
136
|
+
});
|
137
|
+
(0, _useTopoEventListener["default"])({
|
138
|
+
type: 'relateTopoAlarm',
|
139
|
+
onMessage: function onMessage(data) {
|
140
|
+
handleRelateTopoAlarm(data);
|
134
141
|
}
|
135
142
|
});
|
136
143
|
}
|