@riil-frontend/component-topology 2.15.53 → 3.0.0-a.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/index.css +1 -1
- package/build/index.js +10 -10
- package/es/components/ResourceSelectDrawer/ResourceSelectList.js +0 -1
- package/es/components/index.module.scss +4 -4
- package/es/core/components/DisplaySettingDrawer/DisplaySetting.js +15 -3
- package/es/core/components/DisplaySettingDrawer/EdgeFlow.js +27 -0
- package/es/core/components/DisplaySettingDrawer/{LineFlow.js → EdgeFlowDirection.js} +8 -8
- package/es/core/components/DisplaySettingDrawer/hooks/useDisplaySetting.js +12 -2
- package/es/core/components/TopoView/topoView.js +2 -1
- package/es/core/models/Alarm.js +16 -16
- package/es/core/models/TopoApp.js +12 -8
- package/es/core/models/topoData.js +0 -1
- package/es/core/store/coreModels.js +1 -9
- package/es/hooks/usePolling.js +1 -1
- package/es/models/topoAlarm.js +6 -14
- package/es/models/topoBizMod.js +2 -40
- package/es/models/topoConfig.js +1 -1
- package/es/models/topoMod.js +32 -22
- package/es/topoCenter/models/TopoCenter.js +2 -0
- package/es/topoCenter/store/index.js +10 -0
- package/es/utils/topoData.js +57 -29
- package/lib/components/ResourceSelectDrawer/ResourceSelectList.js +0 -1
- package/lib/components/index.module.scss +4 -4
- package/lib/core/components/DisplaySettingDrawer/DisplaySetting.js +16 -3
- package/lib/core/components/DisplaySettingDrawer/EdgeFlow.js +38 -0
- package/lib/core/components/DisplaySettingDrawer/EdgeFlowDirection.js +34 -0
- package/lib/core/components/DisplaySettingDrawer/hooks/useDisplaySetting.js +12 -2
- package/lib/core/components/TopoView/topoView.js +2 -1
- package/lib/core/models/Alarm.js +16 -16
- package/lib/core/models/TopoApp.js +12 -8
- package/lib/core/models/topoData.js +0 -2
- package/lib/core/store/coreModels.js +1 -13
- package/lib/hooks/usePolling.js +1 -1
- package/lib/models/topoAlarm.js +6 -14
- package/lib/models/topoBizMod.js +2 -40
- package/lib/models/topoConfig.js +1 -1
- package/lib/models/topoMod.js +32 -22
- package/lib/topoCenter/models/TopoCenter.js +3 -0
- package/lib/topoCenter/store/index.js +22 -0
- package/lib/utils/topoData.js +57 -29
- package/package.json +2 -2
- package/lib/core/components/DisplaySettingDrawer/LineFlow.js +0 -38
|
@@ -20,7 +20,6 @@ function ResourceSelectList(props, ref) {
|
|
|
20
20
|
|
|
21
21
|
return /*#__PURE__*/React.createElement(CommonResList, {
|
|
22
22
|
ref: ref,
|
|
23
|
-
innerTreeFilters: ['monitorable', 'discoverable'],
|
|
24
23
|
limitTypes: limitTypes || RESOURCE_LIMIT_TYPES,
|
|
25
24
|
defaultCondition: excludeIds.length ? "!id('" + excludeIds.join('\',\'') + "')" : undefined,
|
|
26
25
|
request: getRequest(),
|
|
@@ -3,10 +3,10 @@
|
|
|
3
3
|
.topo-center-view {
|
|
4
4
|
height: 100%;
|
|
5
5
|
|
|
6
|
-
border-radius: 4px;
|
|
7
|
-
box-shadow: 0px 0px 4px 0px rgba(0, 0, 0, 0.16);
|
|
8
|
-
box-shadow: $shadow-1;
|
|
9
|
-
background: #fff;
|
|
6
|
+
// border-radius: 4px;
|
|
7
|
+
// box-shadow: 0px 0px 4px 0px rgba(0, 0, 0, 0.16);
|
|
8
|
+
// box-shadow: $shadow-1;
|
|
9
|
+
// background: #fff;
|
|
10
10
|
overflow: hidden;
|
|
11
11
|
padding: 0;
|
|
12
12
|
|
|
@@ -6,11 +6,12 @@ import _regeneratorRuntime from "@babel/runtime/regenerator";
|
|
|
6
6
|
import React, { useEffect, useImperativeHandle, useState } from 'react';
|
|
7
7
|
import rlog from '@riil-frontend/component-topology-utils/es/rlog';
|
|
8
8
|
import NodeTag from "./NodeTag";
|
|
9
|
-
import
|
|
9
|
+
import EdgeFlow from "./EdgeFlow";
|
|
10
10
|
import NodeTip from "./NodeTip";
|
|
11
11
|
import LinkTip from "./LinkTip";
|
|
12
12
|
import LinkTag from "./LinkTag";
|
|
13
13
|
import LineExpandAllRadioGroup from "./LineExpandAllRadioGroup";
|
|
14
|
+
import EdgeFlowDirection from "./EdgeFlowDirection";
|
|
14
15
|
/**
|
|
15
16
|
* 显示设置
|
|
16
17
|
*
|
|
@@ -31,8 +32,9 @@ function DisplaySetting(props, ref) {
|
|
|
31
32
|
nodeTip: displayConfig.nodeTip,
|
|
32
33
|
linkTag: displayConfig.linkTag,
|
|
33
34
|
linkTip: displayConfig.linkTip,
|
|
34
|
-
|
|
35
|
-
|
|
35
|
+
expandAllEdges: displayConfig.expandAllEdges,
|
|
36
|
+
edgeFlow: displayConfig.edgeFlow,
|
|
37
|
+
edgeFlowDirection: displayConfig.edgeFlowDirection
|
|
36
38
|
},
|
|
37
39
|
onChange: function onChange(name, value) {
|
|
38
40
|
rlog.debug('DisplaySetting-onChange', name, value);
|
|
@@ -105,6 +107,16 @@ function DisplaySetting(props, ref) {
|
|
|
105
107
|
patternTrigger: "onChange"
|
|
106
108
|
}, /*#__PURE__*/React.createElement(LineExpandAllRadioGroup, {
|
|
107
109
|
name: "expandAllEdges"
|
|
110
|
+
})), showLinkConfig && /*#__PURE__*/React.createElement(_Form.Item, {
|
|
111
|
+
label: "\u94FE\u8DEF\u52A8\u6001\u6548\u679C",
|
|
112
|
+
patternTrigger: "onChange"
|
|
113
|
+
}, /*#__PURE__*/React.createElement(EdgeFlow, {
|
|
114
|
+
name: "edgeFlow"
|
|
115
|
+
})), showLinkConfig && field.getValue('edgeFlow') && /*#__PURE__*/React.createElement(_Form.Item, {
|
|
116
|
+
label: "\u94FE\u8DEF\u6D41\u5411",
|
|
117
|
+
patternTrigger: "onChange"
|
|
118
|
+
}, /*#__PURE__*/React.createElement(EdgeFlowDirection, {
|
|
119
|
+
name: "edgeFlowDirection"
|
|
108
120
|
}))));
|
|
109
121
|
}
|
|
110
122
|
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import _Radio from "@alifd/next/es/radio";
|
|
2
|
+
import React from 'react';
|
|
3
|
+
|
|
4
|
+
function EdgeFlow(props) {
|
|
5
|
+
var value = props.value,
|
|
6
|
+
onChange = props.onChange;
|
|
7
|
+
|
|
8
|
+
var handleTypeChange = function handleTypeChange(newValue) {
|
|
9
|
+
onChange(newValue === 'none' ? null : newValue);
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
return /*#__PURE__*/React.createElement(_Radio.Group, {
|
|
13
|
+
value: value || 'none',
|
|
14
|
+
onChange: handleTypeChange
|
|
15
|
+
}, /*#__PURE__*/React.createElement(_Radio, {
|
|
16
|
+
value: "none"
|
|
17
|
+
}, "\u65E0"), /*#__PURE__*/React.createElement(_Radio, {
|
|
18
|
+
value: "drip"
|
|
19
|
+
}, "\u4F20\u9001\u5E26"), /*#__PURE__*/React.createElement(_Radio, {
|
|
20
|
+
value: "point"
|
|
21
|
+
}, "\u5149\u70B9"), /*#__PURE__*/React.createElement(_Radio, {
|
|
22
|
+
value: "arrow"
|
|
23
|
+
}, "\u7BAD\u5934"));
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
;
|
|
27
|
+
export default /*#__PURE__*/React.forwardRef(EdgeFlow);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import _Radio from "@alifd/next/es/radio";
|
|
2
|
-
import React
|
|
2
|
+
import React from 'react';
|
|
3
3
|
|
|
4
|
-
function
|
|
4
|
+
function EdgeFlowDirection(props) {
|
|
5
5
|
var value = props.value,
|
|
6
6
|
onChange = props.onChange;
|
|
7
7
|
|
|
@@ -10,14 +10,14 @@ function LineFlow(props) {
|
|
|
10
10
|
};
|
|
11
11
|
|
|
12
12
|
return /*#__PURE__*/React.createElement(_Radio.Group, {
|
|
13
|
-
value: value || '
|
|
13
|
+
value: value || 'from',
|
|
14
14
|
onChange: handleTypeChange
|
|
15
15
|
}, /*#__PURE__*/React.createElement(_Radio, {
|
|
16
|
-
value: "
|
|
17
|
-
}, "\
|
|
18
|
-
value: "
|
|
19
|
-
}, "\
|
|
16
|
+
value: "from"
|
|
17
|
+
}, "\u4E0A\u884C"), /*#__PURE__*/React.createElement(_Radio, {
|
|
18
|
+
value: "to"
|
|
19
|
+
}, "\u4E0B\u884C"));
|
|
20
20
|
}
|
|
21
21
|
|
|
22
22
|
;
|
|
23
|
-
export default /*#__PURE__*/React.forwardRef(
|
|
23
|
+
export default /*#__PURE__*/React.forwardRef(EdgeFlowDirection);
|
|
@@ -9,6 +9,7 @@ export default (function (props) {
|
|
|
9
9
|
|
|
10
10
|
var executeByConfig = /*#__PURE__*/function () {
|
|
11
11
|
var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(config) {
|
|
12
|
+
var edgeFlowConfig;
|
|
12
13
|
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
|
13
14
|
while (1) {
|
|
14
15
|
switch (_context.prev = _context.next) {
|
|
@@ -27,9 +28,18 @@ export default (function (props) {
|
|
|
27
28
|
if (topo.linkDynamicStyleExecutor) {
|
|
28
29
|
topo.linkDynamicStyleExecutor.execute();
|
|
29
30
|
}
|
|
30
|
-
}
|
|
31
|
+
} // 更新连线流动效果
|
|
31
32
|
|
|
32
|
-
|
|
33
|
+
|
|
34
|
+
edgeFlowConfig = config.edgeFlow ? {
|
|
35
|
+
type: config.edgeFlow,
|
|
36
|
+
// 必填,支持传送带drip、光点point、箭头arrow
|
|
37
|
+
direction: config.edgeFlowDirection || 'from' // 流动方向,可为空,默认源到目的
|
|
38
|
+
|
|
39
|
+
} : null;
|
|
40
|
+
topo.getHtTopo().setGlobalEdgeFlow(edgeFlowConfig);
|
|
41
|
+
|
|
42
|
+
case 4:
|
|
33
43
|
case "end":
|
|
34
44
|
return _context.stop();
|
|
35
45
|
}
|
|
@@ -38,6 +38,7 @@ var Topology = function Topology(props) {
|
|
|
38
38
|
graphViewProps = _props$graphViewProps === void 0 ? {} : _props$graphViewProps,
|
|
39
39
|
viewerProps = props.viewerProps,
|
|
40
40
|
editorProps = props.editorProps;
|
|
41
|
+
topo.viewProps = props;
|
|
41
42
|
var store = topo.store;
|
|
42
43
|
|
|
43
44
|
var _store$useModel = store.useModel("topoMod"),
|
|
@@ -90,7 +91,7 @@ var Topology = function Topology(props) {
|
|
|
90
91
|
rlog.debug("Topoget--AlertMesage------------", topo, data);
|
|
91
92
|
|
|
92
93
|
if (data.type === "alarm") {
|
|
93
|
-
topo.alarm.
|
|
94
|
+
topo.alarm.handleAlarmEvent(data.data);
|
|
94
95
|
}
|
|
95
96
|
}
|
|
96
97
|
});
|
package/es/core/models/Alarm.js
CHANGED
|
@@ -103,12 +103,6 @@ var Alarm = /*#__PURE__*/function () {
|
|
|
103
103
|
};
|
|
104
104
|
|
|
105
105
|
_proto.getAlarms = function getAlarms() {}
|
|
106
|
-
/**
|
|
107
|
-
* 处理告警推送事件
|
|
108
|
-
*/
|
|
109
|
-
;
|
|
110
|
-
|
|
111
|
-
_proto.handleAlarmEvent = function handleAlarmEvent() {}
|
|
112
106
|
/**
|
|
113
107
|
* 增加告警
|
|
114
108
|
*/
|
|
@@ -179,7 +173,7 @@ var Alarm = /*#__PURE__*/function () {
|
|
|
179
173
|
result = _context2.sent;
|
|
180
174
|
rlog.debug("getAlarmById-result", result); // if (alarmIsOpened) {
|
|
181
175
|
// //this.topo.loadAlarm(result.datas);
|
|
182
|
-
// this.
|
|
176
|
+
// this.handleAlarmEvent({ type: "alarm", data: result.datas });
|
|
183
177
|
// }
|
|
184
178
|
|
|
185
179
|
this.updateState({
|
|
@@ -283,7 +277,7 @@ var Alarm = /*#__PURE__*/function () {
|
|
|
283
277
|
EE.on("topo", "topo", function (data, other) {
|
|
284
278
|
rlog.debug("openTopoAlarm 获取初始化告警------收到信息", data);
|
|
285
279
|
|
|
286
|
-
_this.
|
|
280
|
+
_this.handleAlarmEvent(data);
|
|
287
281
|
});
|
|
288
282
|
this.updateState({
|
|
289
283
|
alarmOpening: false,
|
|
@@ -401,15 +395,14 @@ var Alarm = /*#__PURE__*/function () {
|
|
|
401
395
|
return restart;
|
|
402
396
|
}()
|
|
403
397
|
/**
|
|
404
|
-
*
|
|
405
|
-
* @param {} data
|
|
398
|
+
* 处理告警推送事件
|
|
406
399
|
*/
|
|
407
400
|
;
|
|
408
401
|
|
|
409
|
-
_proto.
|
|
402
|
+
_proto.handleAlarmEvent =
|
|
410
403
|
/*#__PURE__*/
|
|
411
404
|
function () {
|
|
412
|
-
var
|
|
405
|
+
var _handleAlarmEvent = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee7(alertData) {
|
|
413
406
|
var _this$getState4, alarmIsOpened, resAndMetrics, resIdsList, nodeIdsList, linkIdsList, alarmDispatchers, sendAl, idsList, operations, _yield$alarmDispatche, eqFlag, alarmlist;
|
|
414
407
|
|
|
415
408
|
return _regeneratorRuntime.wrap(function _callee7$(_context7) {
|
|
@@ -421,7 +414,7 @@ var Alarm = /*#__PURE__*/function () {
|
|
|
421
414
|
resIdsList = resAndMetrics.resIdsList, nodeIdsList = resAndMetrics.nodeIdsList, linkIdsList = resAndMetrics.linkIdsList;
|
|
422
415
|
alarmDispatchers = this.topo.store.getModelDispatchers("topoAlarm"); // 添加事件
|
|
423
416
|
|
|
424
|
-
console.log("
|
|
417
|
+
console.log("handleAlarmEvent-接收到推送的原始告警信息", alertData);
|
|
425
418
|
|
|
426
419
|
if (!(isAvailableArray(alertData) && isAvailableArray(resIdsList))) {
|
|
427
420
|
_context7.next = 25;
|
|
@@ -476,6 +469,13 @@ var Alarm = /*#__PURE__*/function () {
|
|
|
476
469
|
if (alarmIsOpened && !eqFlag) {
|
|
477
470
|
this.topo.loadAlarm(alarmlist);
|
|
478
471
|
this.hmGetTopoAlarm();
|
|
472
|
+
|
|
473
|
+
if (this.topo.viewProps.onAlarm) {
|
|
474
|
+
// 通知所有告警
|
|
475
|
+
this.topo.viewProps.onAlarm(sendAl.map(function (item) {
|
|
476
|
+
return item.obj;
|
|
477
|
+
}));
|
|
478
|
+
}
|
|
479
479
|
}
|
|
480
480
|
|
|
481
481
|
_context7.next = 25;
|
|
@@ -494,11 +494,11 @@ var Alarm = /*#__PURE__*/function () {
|
|
|
494
494
|
}, _callee7, this, [[13, 22]]);
|
|
495
495
|
}));
|
|
496
496
|
|
|
497
|
-
function
|
|
498
|
-
return
|
|
497
|
+
function handleAlarmEvent(_x5) {
|
|
498
|
+
return _handleAlarmEvent.apply(this, arguments);
|
|
499
499
|
}
|
|
500
500
|
|
|
501
|
-
return
|
|
501
|
+
return handleAlarmEvent;
|
|
502
502
|
}();
|
|
503
503
|
|
|
504
504
|
_proto.setAlarms = function setAlarms(alarmList) {
|
|
@@ -20,7 +20,7 @@ import { updateEdgeExpanded } from "../utils/edgeUtil";
|
|
|
20
20
|
import PluginManager from "./PluginManager";
|
|
21
21
|
import topoFactory from "./topoFactory"; // eslint-disable-next-line no-undef
|
|
22
22
|
|
|
23
|
-
var version = typeof "
|
|
23
|
+
var version = typeof "3.0.0-a.2" === 'string' ? "3.0.0-a.2" : null;
|
|
24
24
|
console.info("\u62D3\u6251\u7248\u672C: " + version);
|
|
25
25
|
/**
|
|
26
26
|
* 拓扑显示和编辑
|
|
@@ -529,23 +529,27 @@ var Topo = /*#__PURE__*/function () {
|
|
|
529
529
|
switch (_context12.prev = _context12.next) {
|
|
530
530
|
case 0:
|
|
531
531
|
topoDispatchers = this.store.getModelDispatchers('topoMod');
|
|
532
|
-
|
|
532
|
+
_context12.next = 3;
|
|
533
|
+
return topoDispatchers.update({
|
|
533
534
|
viewState: 'edit'
|
|
534
535
|
});
|
|
535
536
|
|
|
537
|
+
case 3:
|
|
538
|
+
this.fitContent();
|
|
539
|
+
|
|
536
540
|
if (!this.options.onSwitchToEditModeBegin) {
|
|
537
|
-
_context12.next =
|
|
541
|
+
_context12.next = 7;
|
|
538
542
|
break;
|
|
539
543
|
}
|
|
540
544
|
|
|
541
|
-
_context12.next =
|
|
545
|
+
_context12.next = 7;
|
|
542
546
|
return this.options.onSwitchToEditModeBegin(this);
|
|
543
547
|
|
|
544
|
-
case
|
|
545
|
-
_context12.next =
|
|
548
|
+
case 7:
|
|
549
|
+
_context12.next = 9;
|
|
546
550
|
return this.view.switchToEditMode();
|
|
547
551
|
|
|
548
|
-
case
|
|
552
|
+
case 9:
|
|
549
553
|
updateEdgeExpanded(this);
|
|
550
554
|
editDispatchers = this.store.getModelDispatchers('topoConfig');
|
|
551
555
|
editDispatchers.switchToEditMode();
|
|
@@ -558,7 +562,7 @@ var Topo = /*#__PURE__*/function () {
|
|
|
558
562
|
iconManageDispatchers = this.store.getModelDispatchers('customIcon');
|
|
559
563
|
iconManageDispatchers.loadEditorIcons();
|
|
560
564
|
|
|
561
|
-
case
|
|
565
|
+
case 15:
|
|
562
566
|
case "end":
|
|
563
567
|
return _context12.stop();
|
|
564
568
|
}
|
|
@@ -2,7 +2,6 @@ import _extends from "@babel/runtime/helpers/extends";
|
|
|
2
2
|
import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
|
|
3
3
|
import _regeneratorRuntime from "@babel/runtime/regenerator";
|
|
4
4
|
import topoService, { TOPO_PARENT_ID } from '@riil-frontend/component-topology-common/es/services/topo';
|
|
5
|
-
import { combSaveTopoData } from "../../utils/topoData";
|
|
6
5
|
export function getLayoutId(layout) {
|
|
7
6
|
if (!layout || typeof layout === 'string') {
|
|
8
7
|
return layout;
|
|
@@ -12,10 +12,6 @@ import background from "../../models/background";
|
|
|
12
12
|
import displayConfig from "../../models/displayConfig";
|
|
13
13
|
import resourceWebControllUrlSetting from "../../models/resourceWebControllUrlSetting";
|
|
14
14
|
import topoBaseInfoOverview from "../../models/topoBaseInfoOverview";
|
|
15
|
-
import topoCenter from "../../topoCenter/store/topoCenter";
|
|
16
|
-
import functionAuth from "../../topoCenter/store/functionAuth";
|
|
17
|
-
import topoLinkMod from "../../topoCenter/store/topoLinkMod";
|
|
18
|
-
import topoTreeMod from "../../topoCenter/store/topoTreeMod";
|
|
19
15
|
export default {
|
|
20
16
|
topoMod: topoMod,
|
|
21
17
|
customIcon: customIcon,
|
|
@@ -23,7 +19,6 @@ export default {
|
|
|
23
19
|
resourceWebControllUrlSetting: resourceWebControllUrlSetting,
|
|
24
20
|
topoBizMod: topoBizMod,
|
|
25
21
|
topoConfig: topoConfig,
|
|
26
|
-
topoLinkMod: topoLinkMod,
|
|
27
22
|
topoView: topoView,
|
|
28
23
|
background: background,
|
|
29
24
|
topoGraphView: topoGraphView,
|
|
@@ -31,8 +26,5 @@ export default {
|
|
|
31
26
|
displayConfig: displayConfig,
|
|
32
27
|
topoBaseInfoOverview: topoBaseInfoOverview,
|
|
33
28
|
ciModel: ciModel,
|
|
34
|
-
|
|
35
|
-
topoEdit: topoEdit,
|
|
36
|
-
topoCenter: topoCenter,
|
|
37
|
-
topoTreeMod: topoTreeMod
|
|
29
|
+
topoEdit: topoEdit
|
|
38
30
|
};
|
package/es/hooks/usePolling.js
CHANGED
package/es/models/topoAlarm.js
CHANGED
|
@@ -11,7 +11,7 @@ import { getCiMeta } from "@riil-frontend/component-topology-common/es/services/
|
|
|
11
11
|
import rlog from "@riil-frontend/component-topology-utils/es/rlog";
|
|
12
12
|
import _ from "lodash";
|
|
13
13
|
import { findItem, findItemIndex, sortList } from "../utils/topoData";
|
|
14
|
-
var showAlarmStatus = ["toDeal", "dealing"
|
|
14
|
+
var showAlarmStatus = ["toDeal", "dealing"];
|
|
15
15
|
export default {
|
|
16
16
|
// 定义 model 的初始 state
|
|
17
17
|
state: {
|
|
@@ -127,21 +127,13 @@ export default {
|
|
|
127
127
|
// );
|
|
128
128
|
|
|
129
129
|
if (showAlarmStatus.indexOf(item.status) >= 0) {
|
|
130
|
-
if (
|
|
131
|
-
var
|
|
130
|
+
if (doc[rid][sliceTag].level !== item.level) {
|
|
131
|
+
var _newArr = [].concat(doc[rid]);
|
|
132
132
|
|
|
133
|
-
|
|
134
|
-
var _newArr = [].concat(doc[rid]);
|
|
133
|
+
_newArr.splice(sliceTag, 1, item);
|
|
135
134
|
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
}));
|
|
139
|
-
|
|
140
|
-
doc[rid] = _newArr.sort(sortList);
|
|
141
|
-
rlog.debug("告警级别变更", doc[rid], item);
|
|
142
|
-
} else {
|
|
143
|
-
rlog.debug("接收到异常的重复告警", item);
|
|
144
|
-
}
|
|
135
|
+
doc[rid] = _newArr.sort(sortList);
|
|
136
|
+
rlog.debug("告警变更", doc[rid], item);
|
|
145
137
|
} else {// rlog.debug("重复告警", item);
|
|
146
138
|
}
|
|
147
139
|
} else {
|
package/es/models/topoBizMod.js
CHANGED
|
@@ -39,17 +39,16 @@ export default function (engine) {
|
|
|
39
39
|
var _this = this;
|
|
40
40
|
|
|
41
41
|
return _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
|
|
42
|
-
var ciDoc,
|
|
42
|
+
var ciDoc, newCiDoc;
|
|
43
43
|
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
|
44
44
|
while (1) {
|
|
45
45
|
switch (_context.prev = _context.next) {
|
|
46
46
|
case 0:
|
|
47
|
-
// const { res } = state.topoMod.resAndMetrics;
|
|
48
47
|
_this.update({
|
|
49
48
|
resAndMetrics: conditions
|
|
50
49
|
});
|
|
51
50
|
|
|
52
|
-
ciDoc = conditions.ciDoc
|
|
51
|
+
ciDoc = conditions.ciDoc;
|
|
53
52
|
newCiDoc = _extends({}, ciDoc); // rlog.debug('topoBizMod.combBatchCiInfo getBatchCiInfo', conditions);
|
|
54
53
|
|
|
55
54
|
_this.update({
|
|
@@ -101,43 +100,6 @@ export default function (engine) {
|
|
|
101
100
|
}, _callee2, null, [[1, 8]]);
|
|
102
101
|
}))();
|
|
103
102
|
},
|
|
104
|
-
// 初始化,统一获取指标和属性
|
|
105
|
-
getCiBizByIds: function getCiBizByIds(conditions, state) {
|
|
106
|
-
return _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee3() {
|
|
107
|
-
var _conditions$ciIds, _conditions$codes;
|
|
108
|
-
|
|
109
|
-
var _state$topoBizMod$res, resIdsList, metrics, ciIds, codes, metricResult, arrResult;
|
|
110
|
-
|
|
111
|
-
return _regeneratorRuntime.wrap(function _callee3$(_context3) {
|
|
112
|
-
while (1) {
|
|
113
|
-
switch (_context3.prev = _context3.next) {
|
|
114
|
-
case 0:
|
|
115
|
-
_state$topoBizMod$res = state.topoBizMod.resAndMetrics, resIdsList = _state$topoBizMod$res.resIdsList, metrics = _state$topoBizMod$res.metrics;
|
|
116
|
-
ciIds = encodeURIComponent((_conditions$ciIds = conditions === null || conditions === void 0 ? void 0 : conditions.ciIds) !== null && _conditions$ciIds !== void 0 ? _conditions$ciIds : resIdsList);
|
|
117
|
-
codes = encodeURIComponent((_conditions$codes = conditions === null || conditions === void 0 ? void 0 : conditions.codes) !== null && _conditions$codes !== void 0 ? _conditions$codes : metrics);
|
|
118
|
-
_context3.next = 5;
|
|
119
|
-
return getLatestMetrics(ciIds, codes);
|
|
120
|
-
|
|
121
|
-
case 5:
|
|
122
|
-
metricResult = _context3.sent;
|
|
123
|
-
_context3.next = 8;
|
|
124
|
-
return topoServer.getBatchCiArr(ciIds);
|
|
125
|
-
|
|
126
|
-
case 8:
|
|
127
|
-
arrResult = _context3.sent;
|
|
128
|
-
return _context3.abrupt("return", {
|
|
129
|
-
metricResult: metricResult,
|
|
130
|
-
arrResult: arrResult
|
|
131
|
-
});
|
|
132
|
-
|
|
133
|
-
case 10:
|
|
134
|
-
case "end":
|
|
135
|
-
return _context3.stop();
|
|
136
|
-
}
|
|
137
|
-
}
|
|
138
|
-
}, _callee3);
|
|
139
|
-
}))();
|
|
140
|
-
},
|
|
141
103
|
|
|
142
104
|
/**
|
|
143
105
|
* 设置属性和指标
|
package/es/models/topoConfig.js
CHANGED
|
@@ -342,7 +342,7 @@ export default function (topoApp) {
|
|
|
342
342
|
engine: topoApp,
|
|
343
343
|
data: data,
|
|
344
344
|
linkTo: null,
|
|
345
|
-
globalConfig: state.
|
|
345
|
+
globalConfig: state.topoMod.globalConfig,
|
|
346
346
|
ciTypeMap: ciTypeMap
|
|
347
347
|
}), topoData = _combTopoData.topoData, resAndMetrics = _combTopoData.resAndMetrics;
|
|
348
348
|
dispatch.topoMod.update({
|
package/es/models/topoMod.js
CHANGED
|
@@ -22,18 +22,22 @@ export default function (topoApp) {
|
|
|
22
22
|
id: undefined,
|
|
23
23
|
topoId: "",
|
|
24
24
|
type: undefined,
|
|
25
|
+
// 拓扑类型
|
|
26
|
+
currentTopo: undefined,
|
|
27
|
+
// 基本信息
|
|
25
28
|
data: null,
|
|
26
29
|
// 后端返回的分组、连线、节点数据
|
|
30
|
+
globalConfig: null,
|
|
31
|
+
// 全局配置
|
|
27
32
|
topoData: null,
|
|
28
33
|
// ht 拓扑数据,用于首次load
|
|
29
|
-
currentTopo: undefined,
|
|
30
34
|
topoPermission: undefined,
|
|
31
35
|
resAndMetrics: {
|
|
32
36
|
res: [],
|
|
33
|
-
metrics: []
|
|
34
|
-
metricsDoc: null
|
|
37
|
+
metrics: []
|
|
35
38
|
},
|
|
36
|
-
linkTo: null
|
|
39
|
+
linkTo: null // 关联拓扑来源
|
|
40
|
+
|
|
37
41
|
},
|
|
38
42
|
reducers: {
|
|
39
43
|
update: function update(prevState, payload) {
|
|
@@ -182,11 +186,13 @@ export default function (topoApp) {
|
|
|
182
186
|
},
|
|
183
187
|
clearData: function clearData() {
|
|
184
188
|
this.update({
|
|
189
|
+
graphLoaded: false,
|
|
185
190
|
topoId: "",
|
|
186
191
|
topoData: null,
|
|
187
|
-
|
|
192
|
+
currentTopo: undefined,
|
|
188
193
|
data: null,
|
|
189
|
-
|
|
194
|
+
globalConfig: null // 全局配置
|
|
195
|
+
|
|
190
196
|
});
|
|
191
197
|
},
|
|
192
198
|
switchToViewMode: function switchToViewMode(playload, rootState) {
|
|
@@ -292,7 +298,7 @@ export default function (topoApp) {
|
|
|
292
298
|
return _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee6() {
|
|
293
299
|
var _result$config;
|
|
294
300
|
|
|
295
|
-
var startTime, topoId, data, linkToData, refresh, clear, linkTo, startState, permission, result, topoConfig, _yield$Promise$all, ciTypeMap, customIcons,
|
|
301
|
+
var startTime, topoId, data, linkToData, refresh, clear, linkTo, startState, permission, result, topoConfig, _yield$Promise$all, ciTypeMap, customIcons, extraConfig, _combTopoData, topoData, resAndMetrics, endTime;
|
|
296
302
|
|
|
297
303
|
return _regeneratorRuntime.wrap(function _callee6$(_context6) {
|
|
298
304
|
while (1) {
|
|
@@ -316,7 +322,9 @@ export default function (topoApp) {
|
|
|
316
322
|
if (clear === true || topoId < 0) {
|
|
317
323
|
Object.assign(startState, {
|
|
318
324
|
topoData: null,
|
|
319
|
-
data: null
|
|
325
|
+
data: null,
|
|
326
|
+
globalConfig: null // 全局配置
|
|
327
|
+
|
|
320
328
|
});
|
|
321
329
|
}
|
|
322
330
|
|
|
@@ -345,9 +353,11 @@ export default function (topoApp) {
|
|
|
345
353
|
}
|
|
346
354
|
|
|
347
355
|
_this5.update({
|
|
356
|
+
loading: false,
|
|
348
357
|
topoData: null,
|
|
349
358
|
data: null,
|
|
350
|
-
|
|
359
|
+
globalConfig: null // 全局配置
|
|
360
|
+
|
|
351
361
|
});
|
|
352
362
|
|
|
353
363
|
topoApp.options.onLoad();
|
|
@@ -397,9 +407,11 @@ export default function (topoApp) {
|
|
|
397
407
|
}
|
|
398
408
|
|
|
399
409
|
_this5.update({
|
|
400
|
-
|
|
410
|
+
loading: false,
|
|
401
411
|
data: null,
|
|
402
|
-
|
|
412
|
+
globalConfig: null,
|
|
413
|
+
// 全局配置
|
|
414
|
+
topoData: null
|
|
403
415
|
});
|
|
404
416
|
|
|
405
417
|
topoApp.options.onLoad();
|
|
@@ -416,36 +428,34 @@ export default function (topoApp) {
|
|
|
416
428
|
ciTypeMap = _yield$Promise$all[0];
|
|
417
429
|
customIcons = _yield$Promise$all[1];
|
|
418
430
|
rlog.debug("topoMod.initTopoData Ci属性指标元数据", ciTypeMap);
|
|
419
|
-
|
|
431
|
+
extraConfig = result.global.extraConfig;
|
|
420
432
|
_context6.next = 47;
|
|
421
|
-
return dispatch.displayConfig.setConfig(
|
|
433
|
+
return dispatch.displayConfig.setConfig(extraConfig);
|
|
422
434
|
|
|
423
435
|
case 47:
|
|
424
436
|
_combTopoData = combTopoData({
|
|
425
437
|
engine: topoApp,
|
|
426
438
|
data: result,
|
|
427
439
|
linkTo: linkTo,
|
|
428
|
-
globalConfig:
|
|
440
|
+
globalConfig: extraConfig,
|
|
429
441
|
ciTypeMap: ciTypeMap,
|
|
430
442
|
permission: permission
|
|
431
443
|
}), topoData = _combTopoData.topoData, resAndMetrics = _combTopoData.resAndMetrics; // rlog.debug("topoMod.initTopoData combTopoData", { topoData, resAndMetrics, });
|
|
432
444
|
|
|
433
445
|
_this5.update({
|
|
434
|
-
|
|
446
|
+
loading: false,
|
|
435
447
|
currentTopo: topoData.config,
|
|
436
448
|
data: result,
|
|
449
|
+
globalConfig: extraConfig,
|
|
450
|
+
type: (_result$config = result.config) === null || _result$config === void 0 ? void 0 : _result$config.showType,
|
|
437
451
|
topoData: topoData,
|
|
438
|
-
resAndMetrics: resAndMetrics
|
|
439
|
-
loading: false
|
|
452
|
+
resAndMetrics: resAndMetrics
|
|
440
453
|
});
|
|
441
454
|
|
|
442
455
|
dispatch.topoBizMod.combBatchCiInfo(resAndMetrics);
|
|
443
|
-
dispatch.background.init(
|
|
444
|
-
|
|
445
|
-
if (getAlarmSwitch(topoData)) {
|
|
446
|
-
topoApp.alarm.open();
|
|
447
|
-
}
|
|
456
|
+
dispatch.background.init(extraConfig); // TODO 优化打开拓扑图显示告警速度:打开拓扑图立即请求告警
|
|
448
457
|
|
|
458
|
+
topoApp.alarm.open();
|
|
449
459
|
topoApp.onTopoDataLoaded(topoData);
|
|
450
460
|
endTime = moment();
|
|
451
461
|
rlog.info("topoMod.initTopoData 初始化拓扑图数据完成. 耗时: ", endTime.diff(startTime, "seconds", true));
|
|
@@ -8,6 +8,7 @@ import createMenuCommands from "../../contextmenu/createMenuCommands";
|
|
|
8
8
|
import getTopoData from "../getTopoData";
|
|
9
9
|
import _sortResources from "../utils/SortResourcesUtil";
|
|
10
10
|
import rlog from "@riil-frontend/component-topology-utils/es/rlog";
|
|
11
|
+
import customStoreModels from "../store";
|
|
11
12
|
|
|
12
13
|
var TopoCenter = /*#__PURE__*/function (_TopoApp) {
|
|
13
14
|
_inheritsLoose(TopoCenter, _TopoApp);
|
|
@@ -19,6 +20,7 @@ var TopoCenter = /*#__PURE__*/function (_TopoApp) {
|
|
|
19
20
|
loadData: getTopoData
|
|
20
21
|
}, options, {
|
|
21
22
|
usePermission: true,
|
|
23
|
+
storeModels: _extends({}, customStoreModels, options.storeModels),
|
|
22
24
|
onSwitchToEditModeBegin: function () {
|
|
23
25
|
var _onSwitchToEditModeBegin = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(topo) {
|
|
24
26
|
var topoDispatchers;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import topoCenter from "./topoCenter";
|
|
2
|
+
import functionAuth from "./functionAuth";
|
|
3
|
+
import topoLinkMod from "./topoLinkMod";
|
|
4
|
+
import topoTreeMod from "./topoTreeMod";
|
|
5
|
+
export default {
|
|
6
|
+
topoCenter: topoCenter,
|
|
7
|
+
topoLinkMod: topoLinkMod,
|
|
8
|
+
functionAuth: functionAuth,
|
|
9
|
+
topoTreeMod: topoTreeMod
|
|
10
|
+
};
|