@riil-frontend/component-topology 7.0.0-dev.19 → 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 +29 -29
- package/es/core/models/TopoApp.js +1 -1
- 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/lib/core/models/TopoApp.js +1 -1
- 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/package.json +2 -2
@@ -0,0 +1,60 @@
|
|
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
|
+
import { TOPO_API_ROOT } from "./constants";
|
5
|
+
export default {
|
6
|
+
/**
|
7
|
+
* 查询黑名单列表
|
8
|
+
*/
|
9
|
+
queryBlackList: function queryBlackList(topoId) {
|
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(TOPO_API_ROOT + "/blackList/" + topoId);
|
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
|
+
* (批量)添加节点到黑名单
|
32
|
+
* @param {*} id 拓扑ID
|
33
|
+
* @param {*} ciIdList 节点ID
|
34
|
+
* @returns
|
35
|
+
*/
|
36
|
+
addToBlocklist: function addToBlocklist(id, ciIdList) {
|
37
|
+
return _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2() {
|
38
|
+
var ciIds;
|
39
|
+
return _regeneratorRuntime.wrap(function _callee2$(_context2) {
|
40
|
+
while (1) {
|
41
|
+
switch (_context2.prev = _context2.next) {
|
42
|
+
case 0:
|
43
|
+
ciIds = ciIdList.join(',');
|
44
|
+
|
45
|
+
if (!(ciIdList.length > 0)) {
|
46
|
+
_context2.next = 3;
|
47
|
+
break;
|
48
|
+
}
|
49
|
+
|
50
|
+
return _context2.abrupt("return", request.post(TOPO_API_ROOT + "/blackList/add?topoId=" + id + "&ciList=" + (encodeURIComponent(ciIds) || '""')));
|
51
|
+
|
52
|
+
case 3:
|
53
|
+
case "end":
|
54
|
+
return _context2.stop();
|
55
|
+
}
|
56
|
+
}
|
57
|
+
}, _callee2);
|
58
|
+
}))();
|
59
|
+
}
|
60
|
+
};
|
@@ -0,0 +1,69 @@
|
|
1
|
+
import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
|
2
|
+
import _regeneratorRuntime from "@babel/runtime/regenerator";
|
3
|
+
import rlog from '@riil-frontend/component-topology-utils/es/rlog';
|
4
|
+
import { request } from '@riil-frontend/component-topology-utils';
|
5
|
+
import { TOPO_API_ROOT } from "./constants";
|
6
|
+
export default {
|
7
|
+
/**
|
8
|
+
* 批量查询ci类型的属性和指标定义
|
9
|
+
* @param {string[]} ciTypes
|
10
|
+
*/
|
11
|
+
batchQueryCiTypeInfo: function batchQueryCiTypeInfo(ciTypes) {
|
12
|
+
return _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
|
13
|
+
var param;
|
14
|
+
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
15
|
+
while (1) {
|
16
|
+
switch (_context.prev = _context.next) {
|
17
|
+
case 0:
|
18
|
+
if (ciTypes.length) {
|
19
|
+
_context.next = 2;
|
20
|
+
break;
|
21
|
+
}
|
22
|
+
|
23
|
+
return _context.abrupt("return", []);
|
24
|
+
|
25
|
+
case 2:
|
26
|
+
param = {
|
27
|
+
typeCodes: ciTypes
|
28
|
+
}; // rlog.debug('getBatchCi', param);
|
29
|
+
|
30
|
+
_context.next = 5;
|
31
|
+
return request.post(TOPO_API_ROOT + "/attributes/once", param);
|
32
|
+
|
33
|
+
case 5:
|
34
|
+
return _context.abrupt("return", _context.sent);
|
35
|
+
|
36
|
+
case 6:
|
37
|
+
case "end":
|
38
|
+
return _context.stop();
|
39
|
+
}
|
40
|
+
}
|
41
|
+
}, _callee);
|
42
|
+
}))();
|
43
|
+
},
|
44
|
+
|
45
|
+
/**
|
46
|
+
* 批量查询ci的属性和指标
|
47
|
+
* @param {*} params Topo ID
|
48
|
+
*/
|
49
|
+
batchQueryCiInfo: function batchQueryCiInfo(params) {
|
50
|
+
return _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2() {
|
51
|
+
return _regeneratorRuntime.wrap(function _callee2$(_context2) {
|
52
|
+
while (1) {
|
53
|
+
switch (_context2.prev = _context2.next) {
|
54
|
+
case 0:
|
55
|
+
_context2.next = 2;
|
56
|
+
return request.post(TOPO_API_ROOT + "/attributes/polling", params);
|
57
|
+
|
58
|
+
case 2:
|
59
|
+
return _context2.abrupt("return", _context2.sent);
|
60
|
+
|
61
|
+
case 3:
|
62
|
+
case "end":
|
63
|
+
return _context2.stop();
|
64
|
+
}
|
65
|
+
}
|
66
|
+
}, _callee2);
|
67
|
+
}))();
|
68
|
+
}
|
69
|
+
};
|
@@ -0,0 +1 @@
|
|
1
|
+
export var TOPO_API_ROOT = '/topo/v1/api';
|
@@ -0,0 +1,131 @@
|
|
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
|
+
import { TOPO_API_ROOT } from "./constants";
|
5
|
+
var API_ROOT = TOPO_API_ROOT;
|
6
|
+
export var UPLOAD_ICON_URL = API_ROOT + "/shape/upload";
|
7
|
+
export default {
|
8
|
+
UPLOAD_ICON_URL: UPLOAD_ICON_URL,
|
9
|
+
listAll: function listAll() {
|
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.get(API_ROOT + "/shape");
|
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
|
+
* 批量重命名
|
32
|
+
* @param data {[{id, name}]}
|
33
|
+
*/
|
34
|
+
batchRename: function batchRename(data) {
|
35
|
+
return _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2() {
|
36
|
+
return _regeneratorRuntime.wrap(function _callee2$(_context2) {
|
37
|
+
while (1) {
|
38
|
+
switch (_context2.prev = _context2.next) {
|
39
|
+
case 0:
|
40
|
+
_context2.next = 2;
|
41
|
+
return request.post(API_ROOT + "/shape/batch", data);
|
42
|
+
|
43
|
+
case 2:
|
44
|
+
return _context2.abrupt("return", _context2.sent);
|
45
|
+
|
46
|
+
case 3:
|
47
|
+
case "end":
|
48
|
+
return _context2.stop();
|
49
|
+
}
|
50
|
+
}
|
51
|
+
}, _callee2);
|
52
|
+
}))();
|
53
|
+
},
|
54
|
+
|
55
|
+
/**
|
56
|
+
* 重命名
|
57
|
+
*/
|
58
|
+
rename: function rename(_ref) {
|
59
|
+
return _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee3() {
|
60
|
+
var id, name;
|
61
|
+
return _regeneratorRuntime.wrap(function _callee3$(_context3) {
|
62
|
+
while (1) {
|
63
|
+
switch (_context3.prev = _context3.next) {
|
64
|
+
case 0:
|
65
|
+
id = _ref.id, name = _ref.name;
|
66
|
+
_context3.next = 3;
|
67
|
+
return request.post(API_ROOT + "/shape/batch", [{
|
68
|
+
id: id,
|
69
|
+
name: name
|
70
|
+
}]);
|
71
|
+
|
72
|
+
case 3:
|
73
|
+
return _context3.abrupt("return", _context3.sent);
|
74
|
+
|
75
|
+
case 4:
|
76
|
+
case "end":
|
77
|
+
return _context3.stop();
|
78
|
+
}
|
79
|
+
}
|
80
|
+
}, _callee3);
|
81
|
+
}))();
|
82
|
+
},
|
83
|
+
"delete": function _delete(id) {
|
84
|
+
return _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee4() {
|
85
|
+
return _regeneratorRuntime.wrap(function _callee4$(_context4) {
|
86
|
+
while (1) {
|
87
|
+
switch (_context4.prev = _context4.next) {
|
88
|
+
case 0:
|
89
|
+
_context4.next = 2;
|
90
|
+
return request["delete"](API_ROOT + "/shape/" + id);
|
91
|
+
|
92
|
+
case 2:
|
93
|
+
return _context4.abrupt("return", _context4.sent);
|
94
|
+
|
95
|
+
case 3:
|
96
|
+
case "end":
|
97
|
+
return _context4.stop();
|
98
|
+
}
|
99
|
+
}
|
100
|
+
}, _callee4);
|
101
|
+
}))();
|
102
|
+
},
|
103
|
+
getIconJsonUrl: function getIconJsonUrl(id) {
|
104
|
+
return API_ROOT + "/shape/" + id + ".json";
|
105
|
+
},
|
106
|
+
getIconImageUrl: function getIconImageUrl(id) {
|
107
|
+
return API_ROOT + "/shape/download/" + id;
|
108
|
+
},
|
109
|
+
getIconJson: function getIconJson(id) {
|
110
|
+
var _this = this;
|
111
|
+
|
112
|
+
return _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee5() {
|
113
|
+
return _regeneratorRuntime.wrap(function _callee5$(_context5) {
|
114
|
+
while (1) {
|
115
|
+
switch (_context5.prev = _context5.next) {
|
116
|
+
case 0:
|
117
|
+
_context5.next = 2;
|
118
|
+
return request.get(_this.getDownloadUrl(id));
|
119
|
+
|
120
|
+
case 2:
|
121
|
+
return _context5.abrupt("return", _context5.sent);
|
122
|
+
|
123
|
+
case 3:
|
124
|
+
case "end":
|
125
|
+
return _context5.stop();
|
126
|
+
}
|
127
|
+
}
|
128
|
+
}, _callee5);
|
129
|
+
}))();
|
130
|
+
}
|
131
|
+
};
|
@@ -0,0 +1,18 @@
|
|
1
|
+
import _extends from "@babel/runtime/helpers/extends";
|
2
|
+
import icon from "./icon";
|
3
|
+
import basic, { TOPO_GROUP_ID, TOPO_PARENT_ID } from "./basic";
|
4
|
+
import auth from "./auth";
|
5
|
+
import alert from "../alert";
|
6
|
+
import resourceWebUrl from "./resourceWebUrl";
|
7
|
+
import relation from "./relation";
|
8
|
+
import ciInfo from "./ciInfo";
|
9
|
+
import networkLink from "./networkLink";
|
10
|
+
export { TOPO_GROUP_ID, TOPO_PARENT_ID };
|
11
|
+
export default _extends({}, basic, alert, {
|
12
|
+
ciInfo: ciInfo,
|
13
|
+
relation: relation,
|
14
|
+
auth: auth,
|
15
|
+
icon: icon,
|
16
|
+
resourceWebUrl: resourceWebUrl,
|
17
|
+
networkLink: networkLink
|
18
|
+
});
|
@@ -0,0 +1,33 @@
|
|
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
|
+
import { TOPO_API_ROOT } from "./constants";
|
5
|
+
var API_ROOT = TOPO_API_ROOT;
|
6
|
+
export default {
|
7
|
+
/**
|
8
|
+
* 批量查询ci类型是否可创建链路
|
9
|
+
*
|
10
|
+
* @param {*} typeCodes
|
11
|
+
* @returns
|
12
|
+
*/
|
13
|
+
getCiTypesConnectable: function getCiTypesConnectable(typeCodes) {
|
14
|
+
return _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
|
15
|
+
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
16
|
+
while (1) {
|
17
|
+
switch (_context.prev = _context.next) {
|
18
|
+
case 0:
|
19
|
+
_context.next = 2;
|
20
|
+
return request.post(API_ROOT + "/networkLink/ciTypesConnectable", typeCodes);
|
21
|
+
|
22
|
+
case 2:
|
23
|
+
return _context.abrupt("return", _context.sent);
|
24
|
+
|
25
|
+
case 3:
|
26
|
+
case "end":
|
27
|
+
return _context.stop();
|
28
|
+
}
|
29
|
+
}
|
30
|
+
}, _callee);
|
31
|
+
}))();
|
32
|
+
}
|
33
|
+
};
|
@@ -0,0 +1,27 @@
|
|
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
|
+
import { TOPO_API_ROOT } from "./constants";
|
5
|
+
var API_ROOT = TOPO_API_ROOT;
|
6
|
+
export default {
|
7
|
+
batchQueryRelation: function batchQueryRelation(ids) {
|
8
|
+
return _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
|
9
|
+
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
10
|
+
while (1) {
|
11
|
+
switch (_context.prev = _context.next) {
|
12
|
+
case 0:
|
13
|
+
_context.next = 2;
|
14
|
+
return request.post(API_ROOT + "/structure/relationList", ids);
|
15
|
+
|
16
|
+
case 2:
|
17
|
+
return _context.abrupt("return", _context.sent);
|
18
|
+
|
19
|
+
case 3:
|
20
|
+
case "end":
|
21
|
+
return _context.stop();
|
22
|
+
}
|
23
|
+
}
|
24
|
+
}, _callee);
|
25
|
+
}))();
|
26
|
+
}
|
27
|
+
};
|
@@ -0,0 +1,84 @@
|
|
1
|
+
import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
|
2
|
+
import _regeneratorRuntime from "@babel/runtime/regenerator";
|
3
|
+
|
4
|
+
/**
|
5
|
+
* 资源 web 控制台地址
|
6
|
+
*/
|
7
|
+
import { request } from '@riil-frontend/component-topology-utils';
|
8
|
+
import { TOPO_API_ROOT } from "./constants";
|
9
|
+
var API_ROOT = TOPO_API_ROOT;
|
10
|
+
export default {
|
11
|
+
list: function list(ids) {
|
12
|
+
return _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
|
13
|
+
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
14
|
+
while (1) {
|
15
|
+
switch (_context.prev = _context.next) {
|
16
|
+
case 0:
|
17
|
+
_context.next = 2;
|
18
|
+
return request.post(API_ROOT + "/webUrl/list", ids);
|
19
|
+
|
20
|
+
case 2:
|
21
|
+
return _context.abrupt("return", _context.sent);
|
22
|
+
|
23
|
+
case 3:
|
24
|
+
case "end":
|
25
|
+
return _context.stop();
|
26
|
+
}
|
27
|
+
}
|
28
|
+
}, _callee);
|
29
|
+
}))();
|
30
|
+
},
|
31
|
+
save: function save(id, url) {
|
32
|
+
var _this = this;
|
33
|
+
|
34
|
+
return _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2() {
|
35
|
+
return _regeneratorRuntime.wrap(function _callee2$(_context2) {
|
36
|
+
while (1) {
|
37
|
+
switch (_context2.prev = _context2.next) {
|
38
|
+
case 0:
|
39
|
+
if (!url) {
|
40
|
+
_context2.next = 6;
|
41
|
+
break;
|
42
|
+
}
|
43
|
+
|
44
|
+
_context2.next = 3;
|
45
|
+
return request.post(API_ROOT + "/webUrl", {
|
46
|
+
ciId: id,
|
47
|
+
webUrl: url
|
48
|
+
});
|
49
|
+
|
50
|
+
case 3:
|
51
|
+
return _context2.abrupt("return", _context2.sent);
|
52
|
+
|
53
|
+
case 6:
|
54
|
+
return _context2.abrupt("return", _this.deleteByIds([id]));
|
55
|
+
|
56
|
+
case 7:
|
57
|
+
case "end":
|
58
|
+
return _context2.stop();
|
59
|
+
}
|
60
|
+
}
|
61
|
+
}, _callee2);
|
62
|
+
}))();
|
63
|
+
},
|
64
|
+
deleteByIds: function deleteByIds(ids) {
|
65
|
+
return _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee3() {
|
66
|
+
return _regeneratorRuntime.wrap(function _callee3$(_context3) {
|
67
|
+
while (1) {
|
68
|
+
switch (_context3.prev = _context3.next) {
|
69
|
+
case 0:
|
70
|
+
_context3.next = 2;
|
71
|
+
return request.put(API_ROOT + "/webUrl/list/delete", ids);
|
72
|
+
|
73
|
+
case 2:
|
74
|
+
return _context3.abrupt("return", _context3.sent);
|
75
|
+
|
76
|
+
case 3:
|
77
|
+
case "end":
|
78
|
+
return _context3.stop();
|
79
|
+
}
|
80
|
+
}
|
81
|
+
}, _callee3);
|
82
|
+
}))();
|
83
|
+
}
|
84
|
+
};
|
@@ -0,0 +1,38 @@
|
|
1
|
+
// 数据字典缓存
|
2
|
+
import { isAvailableArray } from '@riil-frontend/utils';
|
3
|
+
export var DICT = {
|
4
|
+
getAll: function getAll() {
|
5
|
+
return JSON.parse(window.sessionStorage.getItem('dists'));
|
6
|
+
},
|
7
|
+
get: function get(code) {
|
8
|
+
if (isAvailableArray(this.getAll())) {
|
9
|
+
return this.getAll().find(function (item) {
|
10
|
+
return item.code === code;
|
11
|
+
});
|
12
|
+
}
|
13
|
+
|
14
|
+
return null;
|
15
|
+
},
|
16
|
+
set: function set(dists) {
|
17
|
+
window.sessionStorage.setItem('dists', JSON.stringify(dists));
|
18
|
+
},
|
19
|
+
isEmpty: function isEmpty() {
|
20
|
+
return !window.sessionStorage.getItem('dists');
|
21
|
+
}
|
22
|
+
}; // storage 方法封装
|
23
|
+
|
24
|
+
export var SessionStorage = {
|
25
|
+
get: function get(key) {
|
26
|
+
if (window.sessionStorage.getItem(key)) {
|
27
|
+
return JSON.parse(window.sessionStorage.getItem(key));
|
28
|
+
}
|
29
|
+
|
30
|
+
return null;
|
31
|
+
},
|
32
|
+
set: function set(key, value) {
|
33
|
+
window.sessionStorage.setItem(key, JSON.stringify(value));
|
34
|
+
},
|
35
|
+
remove: function remove(key) {
|
36
|
+
window.sessionStorage.removeItem(key);
|
37
|
+
}
|
38
|
+
};
|
@@ -54,7 +54,7 @@ var _ElementTagTipConfig = _interopRequireDefault(require("./tagstips/ElementTag
|
|
54
54
|
var _SelectionModel = _interopRequireDefault(require("./SelectionModel"));
|
55
55
|
|
56
56
|
// eslint-disable-next-line no-undef
|
57
|
-
var version = typeof "7.0.0-dev.
|
57
|
+
var version = typeof "7.0.0-dev.20" === 'string' ? "7.0.0-dev.20" : null;
|
58
58
|
console.info("\u62D3\u6251\u7248\u672C: " + version);
|
59
59
|
/**
|
60
60
|
* 拓扑显示和编辑
|
@@ -0,0 +1,66 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
4
|
+
|
5
|
+
exports.__esModule = true;
|
6
|
+
exports["default"] = void 0;
|
7
|
+
|
8
|
+
var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
|
9
|
+
|
10
|
+
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
|
11
|
+
|
12
|
+
var _componentTopologyUtils = require("@riil-frontend/component-topology-utils");
|
13
|
+
|
14
|
+
var _default = {
|
15
|
+
/**
|
16
|
+
* 根据资源id获取告警
|
17
|
+
* @param {*} params Topo ID
|
18
|
+
*/
|
19
|
+
getAlarmByIds: function getAlarmByIds(params) {
|
20
|
+
return (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee() {
|
21
|
+
return _regenerator["default"].wrap(function _callee$(_context) {
|
22
|
+
while (1) {
|
23
|
+
switch (_context.prev = _context.next) {
|
24
|
+
case 0:
|
25
|
+
_context.next = 2;
|
26
|
+
return _componentTopologyUtils.request.post('/alert/v1/api/alert/getAlertListInResource', params);
|
27
|
+
|
28
|
+
case 2:
|
29
|
+
return _context.abrupt("return", _context.sent);
|
30
|
+
|
31
|
+
case 3:
|
32
|
+
case "end":
|
33
|
+
return _context.stop();
|
34
|
+
}
|
35
|
+
}
|
36
|
+
}, _callee);
|
37
|
+
}))();
|
38
|
+
},
|
39
|
+
|
40
|
+
/**
|
41
|
+
* 通过ciId获取组件id
|
42
|
+
* ['xxxxxxx']
|
43
|
+
*
|
44
|
+
*/
|
45
|
+
getCisComponentIds: function getCisComponentIds(params) {
|
46
|
+
return (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee2() {
|
47
|
+
return _regenerator["default"].wrap(function _callee2$(_context2) {
|
48
|
+
while (1) {
|
49
|
+
switch (_context2.prev = _context2.next) {
|
50
|
+
case 0:
|
51
|
+
_context2.next = 2;
|
52
|
+
return _componentTopologyUtils.request.post('/topo/v1/api/structure/componentIds', params);
|
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
|
+
exports["default"] = _default;
|
@@ -0,0 +1,145 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
4
|
+
|
5
|
+
exports.__esModule = true;
|
6
|
+
exports["default"] = void 0;
|
7
|
+
|
8
|
+
var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
|
9
|
+
|
10
|
+
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
|
11
|
+
|
12
|
+
var _componentTopologyUtils = require("@riil-frontend/component-topology-utils");
|
13
|
+
|
14
|
+
/**
|
15
|
+
* @Author: zhaoshenghua
|
16
|
+
* @Date: 2021-04-16 11:11:05
|
17
|
+
* @Last Modified by: zhaoshenghua
|
18
|
+
* @Last Modified time: 2021-09-27 17:02:55
|
19
|
+
*/
|
20
|
+
var _default = {
|
21
|
+
/**
|
22
|
+
* 根据用户对菜单进行预鉴权
|
23
|
+
* @param {*} menus url对象数组
|
24
|
+
* [{url:'/admin/connectInfo'}]
|
25
|
+
* @return [{url:'/admin/connectInfo',passed:'PASS'}]
|
26
|
+
*/
|
27
|
+
checkMenuAuthentication: function checkMenuAuthentication(menus) {
|
28
|
+
return (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee() {
|
29
|
+
return _regenerator["default"].wrap(function _callee$(_context) {
|
30
|
+
while (1) {
|
31
|
+
switch (_context.prev = _context.next) {
|
32
|
+
case 0:
|
33
|
+
_context.next = 2;
|
34
|
+
return _componentTopologyUtils.request.post('/authorization/v1/api/authority/check/checkMenuAuthentication', menus);
|
35
|
+
|
36
|
+
case 2:
|
37
|
+
return _context.abrupt("return", _context.sent);
|
38
|
+
|
39
|
+
case 3:
|
40
|
+
case "end":
|
41
|
+
return _context.stop();
|
42
|
+
}
|
43
|
+
}
|
44
|
+
}, _callee);
|
45
|
+
}))();
|
46
|
+
},
|
47
|
+
|
48
|
+
/**
|
49
|
+
* 资源预鉴权
|
50
|
+
* @param {Array} res id对象集合
|
51
|
+
* [{id:'000000000035f663'}]
|
52
|
+
* @return [{id:'000000000035f663',passed:'read'/'write'/'delete'/'impermissibility'}]
|
53
|
+
*/
|
54
|
+
checkSourceAuthentication: function checkSourceAuthentication(res) {
|
55
|
+
return (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee2() {
|
56
|
+
return _regenerator["default"].wrap(function _callee2$(_context2) {
|
57
|
+
while (1) {
|
58
|
+
switch (_context2.prev = _context2.next) {
|
59
|
+
case 0:
|
60
|
+
_context2.next = 2;
|
61
|
+
return _componentTopologyUtils.request.post('/authorization/v1/api/authority/check/checkSourceAuthentication', res);
|
62
|
+
|
63
|
+
case 2:
|
64
|
+
return _context2.abrupt("return", _context2.sent);
|
65
|
+
|
66
|
+
case 3:
|
67
|
+
case "end":
|
68
|
+
return _context2.stop();
|
69
|
+
}
|
70
|
+
}
|
71
|
+
}, _callee2);
|
72
|
+
}))();
|
73
|
+
},
|
74
|
+
|
75
|
+
/**
|
76
|
+
* 功能鉴权
|
77
|
+
*/
|
78
|
+
checkFuncAuthentication: function checkFuncAuthentication(param) {
|
79
|
+
return (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee3() {
|
80
|
+
return _regenerator["default"].wrap(function _callee3$(_context3) {
|
81
|
+
while (1) {
|
82
|
+
switch (_context3.prev = _context3.next) {
|
83
|
+
case 0:
|
84
|
+
_context3.next = 2;
|
85
|
+
return _componentTopologyUtils.request.post('/authorization/v1/api/authority/check/checkFuncAuthentication', param);
|
86
|
+
|
87
|
+
case 2:
|
88
|
+
return _context3.abrupt("return", _context3.sent);
|
89
|
+
|
90
|
+
case 3:
|
91
|
+
case "end":
|
92
|
+
return _context3.stop();
|
93
|
+
}
|
94
|
+
}
|
95
|
+
}, _callee3);
|
96
|
+
}))();
|
97
|
+
},
|
98
|
+
|
99
|
+
/**
|
100
|
+
*获得角色列表
|
101
|
+
*@param {Array} orders 排序
|
102
|
+
*@param {Array} simpleFilter 过滤字段
|
103
|
+
* */
|
104
|
+
queryRolesList: function queryRolesList(param) {
|
105
|
+
return (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee4() {
|
106
|
+
return _regenerator["default"].wrap(function _callee4$(_context4) {
|
107
|
+
while (1) {
|
108
|
+
switch (_context4.prev = _context4.next) {
|
109
|
+
case 0:
|
110
|
+
_context4.next = 2;
|
111
|
+
return _componentTopologyUtils.request.post('/authorization/v1/api/roles/list', param);
|
112
|
+
|
113
|
+
case 2:
|
114
|
+
return _context4.abrupt("return", _context4.sent);
|
115
|
+
|
116
|
+
case 3:
|
117
|
+
case "end":
|
118
|
+
return _context4.stop();
|
119
|
+
}
|
120
|
+
}
|
121
|
+
}, _callee4);
|
122
|
+
}))();
|
123
|
+
},
|
124
|
+
orgRolePostPage: function orgRolePostPage(param) {
|
125
|
+
return (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee5() {
|
126
|
+
return _regenerator["default"].wrap(function _callee5$(_context5) {
|
127
|
+
while (1) {
|
128
|
+
switch (_context5.prev = _context5.next) {
|
129
|
+
case 0:
|
130
|
+
_context5.next = 2;
|
131
|
+
return _componentTopologyUtils.request.post('/identity/v1/api/user/orgRolePost/page', param);
|
132
|
+
|
133
|
+
case 2:
|
134
|
+
return _context5.abrupt("return", _context5.sent);
|
135
|
+
|
136
|
+
case 3:
|
137
|
+
case "end":
|
138
|
+
return _context5.stop();
|
139
|
+
}
|
140
|
+
}
|
141
|
+
}, _callee5);
|
142
|
+
}))();
|
143
|
+
}
|
144
|
+
};
|
145
|
+
exports["default"] = _default;
|