@riil-frontend/component-topology 7.0.0-dev.2 → 7.0.0-dev.20
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 +2 -2
- package/build/2.js +1 -1
- package/build/index.css +1 -1
- package/build/index.js +31 -31
- package/es/core/components/TopoView/topoView.js +2 -19
- package/es/core/components/titlebar/index.js +2 -1
- package/es/core/editor/components/EditorPlugin.js +1 -2
- package/es/core/editor/components/Toolbar/buttons.js +2 -2
- package/es/core/editor/components/Toolbar/widgets/components/textStyleSetting/ElementTextStyleSetting/elements/edgeTag.js +11 -3
- package/es/core/editor/components/Toolbar/widgets/components/textStyleSetting/ElementTextStyleSetting/elements/nodeTag.js +6 -1
- package/es/core/editor/components/Toolbar/widgets/components/textStyleSetting/ElementTextStyleSetting/textStyleUtil.js +5 -0
- package/es/core/editor/components/settings/PropertyView.js +11 -10
- package/es/core/editor/components/settings/Settings.js +8 -1
- package/es/core/editor/components/settings/core/PropertyViewManager.js +4 -3
- package/es/core/editor/components/settings/core/edgePropertyViewAdapter.js +1 -7
- package/es/core/editor/components/settings/propertyViews/node/data/Data.js +6 -3
- package/es/core/editor/components/settings/propertyViews/node/data/NodeRelateResourceButton.js +4 -2
- package/es/core/editor/components/settings/propertyViews/node/data/PlatformDisplay.js +10 -0
- package/es/core/editor/hooks/useKeyboardShortcut.js +1 -1
- package/es/core/hooks/usePolling.js +1 -6
- package/es/core/hooks/useTopoEdit.js +134 -170
- package/es/core/models/Alarm.js +12 -24
- package/es/core/models/TopoApp.js +1 -1
- package/es/core/models/topoData.js +3 -3
- package/es/core/models/utils/linkUtils.js +0 -3
- package/es/core/store/models/topoConfig.js +7 -5
- package/es/core/store/models/topoMod.js +8 -7
- package/es/core/utils/saveSerialize.js +2 -3
- package/es/core/viewer/components/plugins/ResourceDetail/ResourceDetailDrawer.js +13 -2
- package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/EventsCard.js +28 -25
- package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/ResourceOverview.js +4 -0
- package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/components/Configurator/index.js +17 -17
- package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/index.module.scss +1 -0
- package/es/core/viewer/components/titlebar/BasicTools.js +3 -16
- package/es/core/viewer/components/titlebar/widgets/AlarmButton.js +25 -0
- package/es/networkTopo/components/editor/propertyViews/edge/LinkPropertyView/Data/index.js +8 -2
- package/es/networkTopo/components/editor/propertyViews/edge/LinkPropertyView/LinkPropertyView.js +7 -9
- package/es/networkTopo/components/editor/propertyViews/edge/link/LinkInfoPreview.js +42 -16
- package/es/networkTopo/components/editor/useEditorProps.js +4 -5
- package/es/networkTopo/getTopoData.js +18 -30
- package/es/networkTopo/hooks/editor/useDeleteEdges.js +6 -3
- package/es/networkTopo/services/alert.js +55 -0
- package/es/networkTopo/services/authorization.js +135 -0
- package/es/networkTopo/services/cmdb.js +897 -0
- package/es/networkTopo/services/index.js +2 -26
- package/es/networkTopo/services/mdc.js +74 -0
- package/es/networkTopo/services/metric.js +68 -0
- package/es/networkTopo/services/model.js +1283 -0
- package/es/networkTopo/services/risk.js +29 -0
- package/es/networkTopo/services/topo/auth.js +67 -0
- package/es/networkTopo/services/topo/basic.js +727 -0
- package/es/networkTopo/services/topo/blacklist.js +60 -0
- package/es/networkTopo/services/topo/ciInfo.js +69 -0
- package/es/networkTopo/services/topo/constants.js +1 -0
- package/es/networkTopo/services/topo/icon.js +131 -0
- package/es/networkTopo/services/topo/index.js +18 -0
- package/es/networkTopo/services/topo/networkLink.js +33 -0
- package/es/networkTopo/services/topo/relation.js +27 -0
- package/es/networkTopo/services/topo/resourceWebUrl.js +84 -0
- package/es/networkTopo/utils/storage.js +38 -0
- package/es/style.js +21 -21
- package/es/utils/tree.js +1 -0
- package/lib/core/components/TopoView/topoView.js +2 -20
- package/lib/core/components/titlebar/index.js +5 -1
- package/lib/core/editor/components/EditorPlugin.js +1 -3
- package/lib/core/editor/components/Toolbar/buttons.js +2 -2
- package/lib/core/editor/components/Toolbar/widgets/components/textStyleSetting/ElementTextStyleSetting/elements/edgeTag.js +11 -4
- package/lib/core/editor/components/Toolbar/widgets/components/textStyleSetting/ElementTextStyleSetting/elements/nodeTag.js +6 -1
- package/lib/core/editor/components/Toolbar/widgets/components/textStyleSetting/ElementTextStyleSetting/textStyleUtil.js +5 -0
- package/lib/core/editor/components/settings/PropertyView.js +10 -10
- package/lib/core/editor/components/settings/Settings.js +9 -1
- package/lib/core/editor/components/settings/core/PropertyViewManager.js +4 -3
- package/lib/core/editor/components/settings/core/edgePropertyViewAdapter.js +1 -10
- package/lib/core/editor/components/settings/propertyViews/node/data/Data.js +7 -4
- package/lib/core/editor/components/settings/propertyViews/node/data/NodeRelateResourceButton.js +4 -2
- package/lib/core/editor/components/settings/propertyViews/node/data/PlatformDisplay.js +18 -0
- package/lib/core/editor/hooks/useKeyboardShortcut.js +1 -1
- package/lib/core/hooks/usePolling.js +1 -6
- package/lib/core/hooks/useTopoEdit.js +134 -170
- package/lib/core/models/Alarm.js +12 -24
- package/lib/core/models/TopoApp.js +1 -1
- package/lib/core/models/topoData.js +7 -11
- package/lib/core/models/utils/linkUtils.js +0 -5
- package/lib/core/store/models/topoConfig.js +7 -5
- package/lib/core/store/models/topoMod.js +10 -7
- package/lib/core/utils/saveSerialize.js +1 -3
- package/lib/core/viewer/components/plugins/ResourceDetail/ResourceDetailDrawer.js +13 -2
- package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/EventsCard.js +28 -26
- package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/ResourceOverview.js +4 -0
- package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/components/Configurator/index.js +17 -17
- package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/index.module.scss +1 -0
- package/lib/core/viewer/components/titlebar/BasicTools.js +3 -17
- package/lib/core/viewer/components/titlebar/widgets/AlarmButton.js +36 -0
- package/lib/networkTopo/components/editor/propertyViews/edge/LinkPropertyView/Data/index.js +8 -2
- package/lib/networkTopo/components/editor/propertyViews/edge/LinkPropertyView/LinkPropertyView.js +7 -9
- package/lib/networkTopo/components/editor/propertyViews/edge/link/LinkInfoPreview.js +42 -16
- package/lib/networkTopo/components/editor/useEditorProps.js +4 -6
- package/lib/networkTopo/getTopoData.js +19 -33
- package/lib/networkTopo/hooks/editor/useDeleteEdges.js +6 -4
- package/lib/networkTopo/services/alert.js +66 -0
- package/lib/networkTopo/services/authorization.js +145 -0
- package/lib/networkTopo/services/cmdb.js +977 -0
- package/lib/networkTopo/services/index.js +3 -29
- package/lib/networkTopo/services/mdc.js +91 -0
- package/lib/networkTopo/services/metric.js +82 -0
- package/lib/networkTopo/services/model.js +1387 -0
- package/lib/networkTopo/services/risk.js +40 -0
- package/lib/networkTopo/services/topo/auth.js +79 -0
- package/lib/networkTopo/services/topo/basic.js +753 -0
- package/lib/networkTopo/services/topo/blacklist.js +72 -0
- package/lib/networkTopo/services/topo/ciInfo.js +82 -0
- package/lib/networkTopo/services/topo/constants.js +6 -0
- package/lib/networkTopo/services/topo/icon.js +144 -0
- package/lib/networkTopo/services/topo/index.js +42 -0
- package/lib/networkTopo/services/topo/networkLink.js +45 -0
- package/lib/networkTopo/services/topo/relation.js +39 -0
- package/lib/networkTopo/services/topo/resourceWebUrl.js +95 -0
- package/lib/networkTopo/utils/storage.js +46 -0
- package/lib/style.js +21 -21
- package/lib/utils/tree.js +1 -0
- package/package.json +3 -3
- package/es/core/editor/components/plugins/MultipleResourceSelectPlugin.js +0 -15
- package/es/core/editor/components/settings/propertyViews/edge/addEdgeProps.js +0 -10
- package/es/networkTopo/components/editor/propertyViews/edge/addLinkDrawer/AddLinkDrawer.js +0 -630
- package/es/networkTopo/components/editor/propertyViews/edge/addLinkDrawer/components/NetworkLinkForm.js +0 -4
- package/es/networkTopo/components/editor/propertyViews/edge/addLinkDrawer/components/editLinkInfo.js +0 -458
- package/es/networkTopo/components/editor/propertyViews/edge/addLinkDrawer/components/index.module.scss +0 -34
- package/es/networkTopo/components/editor/propertyViews/edge/addLinkDrawer/hooks/useAddLink.js +0 -104
- package/es/networkTopo/components/editor/propertyViews/edge/addLinkDrawer/index.module.scss +0 -12
- package/es/networkTopo/components/editor/propertyViews/edge/addLinkDrawer/mock.js +0 -55
- package/es/networkTopo/components/editor/propertyViews/edge/addLinkDrawer/server.js +0 -187
- package/es/networkTopo/event/index.js +0 -6
- package/lib/core/editor/components/plugins/MultipleResourceSelectPlugin.js +0 -25
- package/lib/core/editor/components/settings/propertyViews/edge/addEdgeProps.js +0 -19
- package/lib/networkTopo/components/editor/propertyViews/edge/addLinkDrawer/AddLinkDrawer.js +0 -661
- package/lib/networkTopo/components/editor/propertyViews/edge/addLinkDrawer/components/NetworkLinkForm.js +0 -12
- package/lib/networkTopo/components/editor/propertyViews/edge/addLinkDrawer/components/editLinkInfo.js +0 -486
- package/lib/networkTopo/components/editor/propertyViews/edge/addLinkDrawer/components/index.module.scss +0 -34
- package/lib/networkTopo/components/editor/propertyViews/edge/addLinkDrawer/hooks/useAddLink.js +0 -120
- package/lib/networkTopo/components/editor/propertyViews/edge/addLinkDrawer/index.module.scss +0 -12
- package/lib/networkTopo/components/editor/propertyViews/edge/addLinkDrawer/mock.js +0 -60
- package/lib/networkTopo/components/editor/propertyViews/edge/addLinkDrawer/server.js +0 -207
- package/lib/networkTopo/event/index.js +0 -11
@@ -1,3 +1,4 @@
|
|
1
|
+
import _extends from "@babel/runtime/helpers/extends";
|
1
2
|
import _Box from "@alifd/next/es/box";
|
2
3
|
import _Collapse from "@alifd/next/es/collapse";
|
3
4
|
import React, { useEffect } from "react";
|
@@ -5,9 +6,40 @@ import styles from "./LinkInfoPreview.module.scss";
|
|
5
6
|
import { formatMetric } from "../../../../../../core/models/attributeFormatter";
|
6
7
|
import rlog from "@riil-frontend/component-topology-utils/es/rlog";
|
7
8
|
var CollapsePanel = _Collapse.Panel;
|
9
|
+
|
10
|
+
function Item(props) {
|
11
|
+
return /*#__PURE__*/React.createElement(_Box, {
|
12
|
+
key: props.name,
|
13
|
+
direction: "row",
|
14
|
+
spacing: 8,
|
15
|
+
className: styles.row
|
16
|
+
}, /*#__PURE__*/React.createElement(_Box, {
|
17
|
+
className: styles.label
|
18
|
+
}, props.label), /*#__PURE__*/React.createElement(_Box, {
|
19
|
+
className: props.name === "use" ? styles.uselabelValue : styles.labelValue,
|
20
|
+
flex: 1
|
21
|
+
}, props.content));
|
22
|
+
}
|
23
|
+
|
8
24
|
export default function LindInfoPreview(props) {
|
9
25
|
var topo = props.topo,
|
10
|
-
data = props.data
|
26
|
+
data = props.data,
|
27
|
+
isCmpTopo = props.isCmpTopo,
|
28
|
+
target = props.target;
|
29
|
+
var cmpFields = [];
|
30
|
+
var cmpFieldsSource = []; // 分级拓扑逻辑
|
31
|
+
|
32
|
+
if (isCmpTopo && target.id.indexOf("sub") >= 0) {
|
33
|
+
cmpFields.push({
|
34
|
+
label: "所属平台",
|
35
|
+
content: target.attributes.platform
|
36
|
+
});
|
37
|
+
cmpFieldsSource.push({
|
38
|
+
label: "所属平台",
|
39
|
+
content: '本级平台'
|
40
|
+
});
|
41
|
+
}
|
42
|
+
|
11
43
|
var fields = [{
|
12
44
|
label: "链路名称",
|
13
45
|
name: "display_name"
|
@@ -23,7 +55,7 @@ export default function LindInfoPreview(props) {
|
|
23
55
|
}, {
|
24
56
|
label: "源端IP",
|
25
57
|
name: "network_link.source_ipv4"
|
26
|
-
}, {
|
58
|
+
}].concat(cmpFieldsSource, [{
|
27
59
|
label: "目的节点名称",
|
28
60
|
name: "network_link.destination_device_id"
|
29
61
|
}, {
|
@@ -35,7 +67,7 @@ export default function LindInfoPreview(props) {
|
|
35
67
|
}, {
|
36
68
|
label: "目的端IP",
|
37
69
|
name: "network_link.destination_ipv4"
|
38
|
-
}, {
|
70
|
+
}], cmpFields, [{
|
39
71
|
label: "取值端口",
|
40
72
|
name: "network_link.value_port"
|
41
73
|
}, {
|
@@ -44,7 +76,7 @@ export default function LindInfoPreview(props) {
|
|
44
76
|
}, {
|
45
77
|
label: "用途",
|
46
78
|
name: "use"
|
47
|
-
}];
|
79
|
+
}]);
|
48
80
|
|
49
81
|
var getValue = function getValue(name) {
|
50
82
|
var value; // console.log('LindInfoPreview-getValue',data,name)
|
@@ -69,18 +101,12 @@ export default function LindInfoPreview(props) {
|
|
69
101
|
return value;
|
70
102
|
};
|
71
103
|
|
72
|
-
return fields.map(function (field) {
|
73
|
-
return /*#__PURE__*/React.createElement(
|
74
|
-
key:
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
}, /*#__PURE__*/React.createElement(_Box, {
|
79
|
-
className: styles.label
|
80
|
-
}, field.label), /*#__PURE__*/React.createElement(_Box, {
|
81
|
-
className: field.name === "use" ? styles.uselabelValue : styles.labelValue,
|
82
|
-
flex: 1
|
83
|
-
}, getValue(field.name)));
|
104
|
+
return fields.map(function (field, index) {
|
105
|
+
return /*#__PURE__*/React.createElement(Item, _extends({
|
106
|
+
key: index
|
107
|
+
}, field, {
|
108
|
+
content: field.content || getValue(field.name)
|
109
|
+
}));
|
84
110
|
}); // <Collapse
|
85
111
|
// defaultExpandedKeys={["相关资源"]}
|
86
112
|
// style={{ border: "none" }}
|
@@ -1,7 +1,6 @@
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
2
2
|
import _useGroupSortResources from "../../hooks/editor/useGroupSortResources";
|
3
3
|
import LayerConfigPlugin from "./plugins/LayerConfigPlugin";
|
4
|
-
import AddLinkDrawer from "./propertyViews/edge/addLinkDrawer/AddLinkDrawer";
|
5
4
|
import EdgePropertyView from "./propertyViews/edge/EdgePropertyView";
|
6
5
|
import LinkPropertyView from "./propertyViews/edge/LinkPropertyView";
|
7
6
|
import LayerRelatedResourceList from "./propertyViews/LayerRelatedResourceList";
|
@@ -25,8 +24,8 @@ export default function useEditorProps(props) {
|
|
25
24
|
var edge = _ref.edge;
|
26
25
|
return edge.getTag() ? 'link' : null;
|
27
26
|
},
|
28
|
-
showLinkConfig: true
|
29
|
-
|
30
|
-
plugins: [LayerConfigPlugin
|
31
|
-
}
|
27
|
+
showLinkConfig: true
|
28
|
+
}, customEditorProps, {
|
29
|
+
plugins: [LayerConfigPlugin].concat((customEditorProps === null || customEditorProps === void 0 ? void 0 : customEditorProps.plugins) || [])
|
30
|
+
});
|
32
31
|
}
|
@@ -1,9 +1,7 @@
|
|
1
1
|
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
|
-
import topoService from "@riil-frontend/component-topology-common/es/services/topo";
|
5
4
|
import { getLinksDetail } from "../core/models/utils/linkUtils";
|
6
|
-
import { queryCisByIds } from "../core/services";
|
7
5
|
import { addTopoDataResourcePermission } from "./utils/resourcePermissionUtil"; // import "./utils/__tests__/resourcePermissionUtil.test";
|
8
6
|
|
9
7
|
export function addLinkData(_x, _x2) {
|
@@ -17,7 +15,7 @@ export function addLinkData(_x, _x2) {
|
|
17
15
|
|
18
16
|
function _addLinkData() {
|
19
17
|
_addLinkData = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(oldLinks, nodes) {
|
20
|
-
var links;
|
18
|
+
var links, networkLinks, otherLinks;
|
21
19
|
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
22
20
|
while (1) {
|
23
21
|
switch (_context.prev = _context.next) {
|
@@ -33,18 +31,24 @@ function _addLinkData() {
|
|
33
31
|
}
|
34
32
|
|
35
33
|
return true;
|
36
|
-
});
|
34
|
+
}); // 如果是网络链路,补充详情信息
|
35
|
+
|
37
36
|
_context.next = 3;
|
38
|
-
return getLinksDetail(links
|
37
|
+
return getLinksDetail(links.filter(function (link) {
|
38
|
+
return !link.ciType;
|
39
|
+
}), nodes);
|
39
40
|
|
40
41
|
case 3:
|
41
|
-
|
42
|
+
networkLinks = _context.sent;
|
43
|
+
otherLinks = links.filter(function (link) {
|
44
|
+
return !!link.ciType;
|
45
|
+
});
|
42
46
|
return _context.abrupt("return", {
|
43
|
-
links:
|
47
|
+
links: [].concat(networkLinks, otherLinks),
|
44
48
|
linkGroups: []
|
45
49
|
});
|
46
50
|
|
47
|
-
case
|
51
|
+
case 6:
|
48
52
|
case "end":
|
49
53
|
return _context.stop();
|
50
54
|
}
|
@@ -73,7 +77,7 @@ export function buildData(_x3) {
|
|
73
77
|
|
74
78
|
function _buildData() {
|
75
79
|
_buildData = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2(data) {
|
76
|
-
var newData, nodes, _yield$Promise$all,
|
80
|
+
var newData, nodes, _yield$Promise$all, linkData;
|
77
81
|
|
78
82
|
return _regeneratorRuntime.wrap(function _callee2$(_context2) {
|
79
83
|
while (1) {
|
@@ -90,34 +94,18 @@ function _buildData() {
|
|
90
94
|
});
|
91
95
|
});
|
92
96
|
_context2.next = 4;
|
93
|
-
return Promise.all([
|
94
|
-
queryCisByIds(nodes.map(function (node) {
|
95
|
-
return node.id;
|
96
|
-
})), addLinkData(data.links || [], nodes)]);
|
97
|
+
return Promise.all([addLinkData(data.links || [], nodes)]);
|
97
98
|
|
98
99
|
case 4:
|
99
100
|
_yield$Promise$all = _context2.sent;
|
100
|
-
|
101
|
-
linkData = _yield$Promise$all[1];
|
102
|
-
nodes = nodes.map(function (node) {
|
103
|
-
var _node$attributes$find;
|
104
|
-
|
105
|
-
return _extends({}, node, {
|
106
|
-
ipAddress: Array.isArray(node.attributes) ? (_node$attributes$find = node.attributes.find(function (item) {
|
107
|
-
return item.code === 'ipAddress';
|
108
|
-
})) === null || _node$attributes$find === void 0 ? void 0 : _node$attributes$find.value : null,
|
109
|
-
attributes: nodeCis.find(function (ci) {
|
110
|
-
return ci.id === node.id;
|
111
|
-
}).attributes
|
112
|
-
});
|
113
|
-
});
|
101
|
+
linkData = _yield$Promise$all[0];
|
114
102
|
newData = _extends({}, newData, {
|
115
103
|
nodes: nodes
|
116
104
|
}, linkData);
|
117
105
|
newData = addTopoDataResourcePermission(newData);
|
118
106
|
return _context2.abrupt("return", newData);
|
119
107
|
|
120
|
-
case
|
108
|
+
case 9:
|
121
109
|
case "end":
|
122
110
|
return _context2.stop();
|
123
111
|
}
|
@@ -127,12 +115,12 @@ function _buildData() {
|
|
127
115
|
return _buildData.apply(this, arguments);
|
128
116
|
}
|
129
117
|
|
130
|
-
export default function getTopoData(_x4) {
|
118
|
+
export default function getTopoData(_x4, _x5) {
|
131
119
|
return _getTopoData.apply(this, arguments);
|
132
120
|
}
|
133
121
|
|
134
122
|
function _getTopoData() {
|
135
|
-
_getTopoData = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee3(id) {
|
123
|
+
_getTopoData = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee3(id, topoService) {
|
136
124
|
var data;
|
137
125
|
return _regeneratorRuntime.wrap(function _callee3$(_context3) {
|
138
126
|
while (1) {
|
@@ -4,7 +4,6 @@ import _Message from "@alifd/next/es/message";
|
|
4
4
|
import _Dialog from "@alifd/next/es/dialog";
|
5
5
|
import _regeneratorRuntime from "@babel/runtime/regenerator";
|
6
6
|
import rlog from '@riil-frontend/component-topology-utils/es/rlog';
|
7
|
-
import { isAggLink } from "../../../core/models/utils/linkUtils";
|
8
7
|
import linkService from "../../services/link";
|
9
8
|
import { getLinkPermission } from "../../utils/resourcePermissionUtil";
|
10
9
|
/**
|
@@ -33,6 +32,11 @@ export default (function (_ref) {
|
|
33
32
|
|
34
33
|
if (deleteable) {
|
35
34
|
return deleteable;
|
35
|
+
} // 分级管理 下级链路禁用删除
|
36
|
+
|
37
|
+
|
38
|
+
if (link.isSubResource) {
|
39
|
+
return false;
|
36
40
|
}
|
37
41
|
|
38
42
|
_Message.notice('无删除权限');
|
@@ -49,8 +53,7 @@ export default (function (_ref) {
|
|
49
53
|
switch (_context.prev = _context.next) {
|
50
54
|
case 0:
|
51
55
|
id = link.id;
|
52
|
-
isGroup = false;
|
53
|
-
|
56
|
+
isGroup = false;
|
54
57
|
_context.next = 4;
|
55
58
|
return linkService.deleteLink(id);
|
56
59
|
|
@@ -0,0 +1,55 @@
|
|
1
|
+
import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
|
2
|
+
import _regeneratorRuntime from "@babel/runtime/regenerator";
|
3
|
+
import { request } from '@riil-frontend/component-topology-utils';
|
4
|
+
export default {
|
5
|
+
/**
|
6
|
+
* 根据资源id获取告警
|
7
|
+
* @param {*} params Topo ID
|
8
|
+
*/
|
9
|
+
getAlarmByIds: function getAlarmByIds(params) {
|
10
|
+
return _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
|
11
|
+
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
12
|
+
while (1) {
|
13
|
+
switch (_context.prev = _context.next) {
|
14
|
+
case 0:
|
15
|
+
_context.next = 2;
|
16
|
+
return request.post('/alert/v1/api/alert/getAlertListInResource', params);
|
17
|
+
|
18
|
+
case 2:
|
19
|
+
return _context.abrupt("return", _context.sent);
|
20
|
+
|
21
|
+
case 3:
|
22
|
+
case "end":
|
23
|
+
return _context.stop();
|
24
|
+
}
|
25
|
+
}
|
26
|
+
}, _callee);
|
27
|
+
}))();
|
28
|
+
},
|
29
|
+
|
30
|
+
/**
|
31
|
+
* 通过ciId获取组件id
|
32
|
+
* ['xxxxxxx']
|
33
|
+
*
|
34
|
+
*/
|
35
|
+
getCisComponentIds: function getCisComponentIds(params) {
|
36
|
+
return _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2() {
|
37
|
+
return _regeneratorRuntime.wrap(function _callee2$(_context2) {
|
38
|
+
while (1) {
|
39
|
+
switch (_context2.prev = _context2.next) {
|
40
|
+
case 0:
|
41
|
+
_context2.next = 2;
|
42
|
+
return request.post('/topo/v1/api/structure/componentIds', params);
|
43
|
+
|
44
|
+
case 2:
|
45
|
+
return _context2.abrupt("return", _context2.sent);
|
46
|
+
|
47
|
+
case 3:
|
48
|
+
case "end":
|
49
|
+
return _context2.stop();
|
50
|
+
}
|
51
|
+
}
|
52
|
+
}, _callee2);
|
53
|
+
}))();
|
54
|
+
}
|
55
|
+
};
|
@@ -0,0 +1,135 @@
|
|
1
|
+
import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
|
2
|
+
import _regeneratorRuntime from "@babel/runtime/regenerator";
|
3
|
+
|
4
|
+
/**
|
5
|
+
* @Author: zhaoshenghua
|
6
|
+
* @Date: 2021-04-16 11:11:05
|
7
|
+
* @Last Modified by: zhaoshenghua
|
8
|
+
* @Last Modified time: 2021-09-27 17:02:55
|
9
|
+
*/
|
10
|
+
import { request } from '@riil-frontend/component-topology-utils';
|
11
|
+
export default {
|
12
|
+
/**
|
13
|
+
* 根据用户对菜单进行预鉴权
|
14
|
+
* @param {*} menus url对象数组
|
15
|
+
* [{url:'/admin/connectInfo'}]
|
16
|
+
* @return [{url:'/admin/connectInfo',passed:'PASS'}]
|
17
|
+
*/
|
18
|
+
checkMenuAuthentication: function checkMenuAuthentication(menus) {
|
19
|
+
return _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
|
20
|
+
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
21
|
+
while (1) {
|
22
|
+
switch (_context.prev = _context.next) {
|
23
|
+
case 0:
|
24
|
+
_context.next = 2;
|
25
|
+
return request.post('/authorization/v1/api/authority/check/checkMenuAuthentication', menus);
|
26
|
+
|
27
|
+
case 2:
|
28
|
+
return _context.abrupt("return", _context.sent);
|
29
|
+
|
30
|
+
case 3:
|
31
|
+
case "end":
|
32
|
+
return _context.stop();
|
33
|
+
}
|
34
|
+
}
|
35
|
+
}, _callee);
|
36
|
+
}))();
|
37
|
+
},
|
38
|
+
|
39
|
+
/**
|
40
|
+
* 资源预鉴权
|
41
|
+
* @param {Array} res id对象集合
|
42
|
+
* [{id:'000000000035f663'}]
|
43
|
+
* @return [{id:'000000000035f663',passed:'read'/'write'/'delete'/'impermissibility'}]
|
44
|
+
*/
|
45
|
+
checkSourceAuthentication: function checkSourceAuthentication(res) {
|
46
|
+
return _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2() {
|
47
|
+
return _regeneratorRuntime.wrap(function _callee2$(_context2) {
|
48
|
+
while (1) {
|
49
|
+
switch (_context2.prev = _context2.next) {
|
50
|
+
case 0:
|
51
|
+
_context2.next = 2;
|
52
|
+
return request.post('/authorization/v1/api/authority/check/checkSourceAuthentication', res);
|
53
|
+
|
54
|
+
case 2:
|
55
|
+
return _context2.abrupt("return", _context2.sent);
|
56
|
+
|
57
|
+
case 3:
|
58
|
+
case "end":
|
59
|
+
return _context2.stop();
|
60
|
+
}
|
61
|
+
}
|
62
|
+
}, _callee2);
|
63
|
+
}))();
|
64
|
+
},
|
65
|
+
|
66
|
+
/**
|
67
|
+
* 功能鉴权
|
68
|
+
*/
|
69
|
+
checkFuncAuthentication: function checkFuncAuthentication(param) {
|
70
|
+
return _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee3() {
|
71
|
+
return _regeneratorRuntime.wrap(function _callee3$(_context3) {
|
72
|
+
while (1) {
|
73
|
+
switch (_context3.prev = _context3.next) {
|
74
|
+
case 0:
|
75
|
+
_context3.next = 2;
|
76
|
+
return request.post('/authorization/v1/api/authority/check/checkFuncAuthentication', param);
|
77
|
+
|
78
|
+
case 2:
|
79
|
+
return _context3.abrupt("return", _context3.sent);
|
80
|
+
|
81
|
+
case 3:
|
82
|
+
case "end":
|
83
|
+
return _context3.stop();
|
84
|
+
}
|
85
|
+
}
|
86
|
+
}, _callee3);
|
87
|
+
}))();
|
88
|
+
},
|
89
|
+
|
90
|
+
/**
|
91
|
+
*获得角色列表
|
92
|
+
*@param {Array} orders 排序
|
93
|
+
*@param {Array} simpleFilter 过滤字段
|
94
|
+
* */
|
95
|
+
queryRolesList: function queryRolesList(param) {
|
96
|
+
return _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee4() {
|
97
|
+
return _regeneratorRuntime.wrap(function _callee4$(_context4) {
|
98
|
+
while (1) {
|
99
|
+
switch (_context4.prev = _context4.next) {
|
100
|
+
case 0:
|
101
|
+
_context4.next = 2;
|
102
|
+
return request.post('/authorization/v1/api/roles/list', param);
|
103
|
+
|
104
|
+
case 2:
|
105
|
+
return _context4.abrupt("return", _context4.sent);
|
106
|
+
|
107
|
+
case 3:
|
108
|
+
case "end":
|
109
|
+
return _context4.stop();
|
110
|
+
}
|
111
|
+
}
|
112
|
+
}, _callee4);
|
113
|
+
}))();
|
114
|
+
},
|
115
|
+
orgRolePostPage: function orgRolePostPage(param) {
|
116
|
+
return _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee5() {
|
117
|
+
return _regeneratorRuntime.wrap(function _callee5$(_context5) {
|
118
|
+
while (1) {
|
119
|
+
switch (_context5.prev = _context5.next) {
|
120
|
+
case 0:
|
121
|
+
_context5.next = 2;
|
122
|
+
return request.post('/identity/v1/api/user/orgRolePost/page', param);
|
123
|
+
|
124
|
+
case 2:
|
125
|
+
return _context5.abrupt("return", _context5.sent);
|
126
|
+
|
127
|
+
case 3:
|
128
|
+
case "end":
|
129
|
+
return _context5.stop();
|
130
|
+
}
|
131
|
+
}
|
132
|
+
}, _callee5);
|
133
|
+
}))();
|
134
|
+
}
|
135
|
+
};
|