@riil-frontend/component-topology 11.0.34 → 12.0.0-dev.1
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 +4 -2
- package/build/index.js +57 -34
- package/es/components/BatchAttrMetric/setting.js +1 -1
- package/es/components/MultiResourceDrawer/index.js +16 -18
- package/es/components/ResourceList/ResourceSelect.js +48 -50
- package/es/components/ResourceSelectDrawer/ResourceSelectDrawer.js +24 -26
- package/es/components/SingleResourceDrawer/SelectDrawer.js +18 -20
- package/es/core/components/DisplaySettingDrawer/DisplaySettingDrawer.js +23 -25
- package/es/core/components/DisplaySettingDrawer/hooks/useDisplaySetting.js +78 -84
- package/es/core/components/titlebar/widgets/TitleWidget.js +5 -3
- package/es/core/editor/components/BackgroundView/UploadDialog/index.js +17 -18
- package/es/core/editor/components/BackgroundView/index.js +119 -129
- package/es/core/editor/components/CustomIconPlugin/RenameDialog.js +20 -22
- package/es/core/editor/components/CustomIconPlugin/UploadIconDialog.js +33 -34
- package/es/core/editor/components/CustomIconPlugin/utils/svgToShape.js +15 -17
- package/es/core/editor/components/GroupAddResourceDrawerPlugin/GroupAddResourceDrawer.js +7 -9
- package/es/core/editor/components/Sidebar/views/CanvasPanel/hooks/useCanvasThemeConfig.js +37 -41
- package/es/core/editor/components/Toolbar/widgets/BoxBackgroundButton/BoxBackgroundSetting.js +50 -54
- package/es/core/editor/components/Toolbar/widgets/FontColorButton.js +50 -54
- package/es/core/editor/components/settings/propertyViews/layer/DataTab/DefaultLayerAddResourceDrawer.js +11 -13
- package/es/core/editor/components/settings/propertyViews/node/data/BindResourceDrawer.js +21 -23
- package/es/core/editor/components/settings/propertyViews/node/data/Data.js +15 -17
- package/es/core/editor/components/settings/propertyViews/view/BackgroundSize.js +10 -12
- package/es/core/editor/components/titlebar/TopoEditorTitleBar.js +21 -27
- package/es/core/editor/hooks/useKeyboardShortcut.js +36 -32
- package/es/core/editor/hooks/useNewElementTheme.js +2 -2
- package/es/core/editor/store/background.js +8 -10
- package/es/core/editor/store/topoEdit.js +4 -6
- package/es/core/editor/utils/copyElementUtil.js +171 -0
- package/es/core/editor/utils/edgeTypeStyleUtil.js +2 -4
- package/es/core/hooks/usePolling.js +117 -121
- package/es/core/hooks/useResourceConfig.js +58 -66
- package/es/core/hooks/useTopoEdit.js +473 -503
- package/es/core/models/Alarm.js +281 -298
- package/es/core/models/AttributeMetricDisplay.js +101 -107
- package/es/core/models/PluginManager.js +4 -3
- package/es/core/models/SelectionModel.js +4 -5
- package/es/core/models/TopoApp.js +205 -240
- package/es/core/models/TopoGraphView.js +18 -21
- package/es/core/models/cache/CiCache.js +28 -27
- package/es/core/models/cache/CiTypeCache.js +37 -41
- package/es/core/models/cache/DictCache.js +33 -35
- package/es/core/models/graph/Background.js +15 -17
- package/es/core/models/plugins/resourceWebControllUrl.js +76 -82
- package/es/core/models/tagstips/ElementTagTipConfig.js +34 -38
- package/es/core/models/topoData.js +68 -70
- package/es/core/models/utils/linkUtils.js +41 -43
- package/es/core/models/utils/nodeNameVisibleUtil.js +4 -4
- package/es/core/services/alarm.js +14 -16
- package/es/core/services/background.js +59 -67
- package/es/core/services/cmdb/metric.js +9 -11
- package/es/core/services/cmdb.js +20 -20
- package/es/core/services/index.js +39 -45
- package/es/core/services/overview.js +131 -151
- package/es/core/services/topo/basic.js +37 -41
- package/es/core/services/topo/tagtip.js +10 -12
- package/es/core/store/models/ciModel.js +58 -62
- package/es/core/store/models/customIcon.js +120 -134
- package/es/core/store/models/displayConfig.js +15 -19
- package/es/core/store/models/selection.js +4 -6
- package/es/core/store/models/topoAlarm.js +162 -145
- package/es/core/store/models/topoBaseInfoOverview.js +4 -6
- package/es/core/store/models/topoBizMod.js +9 -11
- package/es/core/store/models/topoConfig.js +215 -231
- package/es/core/store/models/topoGraphView.js +4 -6
- package/es/core/store/models/topoMod.js +373 -395
- package/es/core/utils/imageUtil.js +18 -20
- package/es/core/utils/metricUtil.js +5 -0
- package/es/core/utils/saveSerialize.js +9 -11
- package/es/core/viewer/components/plugins/ResourceDetail/components/ClusterMemberTable.js +56 -58
- package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/EventsCard.js +15 -17
- package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/ResourceOverview.js +343 -357
- package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/components/Configurator/index.js +86 -92
- package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/components/LinkTopo/LinkTopoCard.js +39 -41
- package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/components/LinkTopo/services/index.js +189 -205
- package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/hooks/useAlarmAndRiskData.js +107 -109
- package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/hooks/useMetricModels.js +57 -59
- package/es/core/viewer/components/plugins/ResourceDetail/components/WebConsole/WebConsoleForm/hooks/useWebConsole.js +33 -37
- package/es/core/viewer/components/plugins/ResourceDetail/getCiDisplayMetricModels.js +25 -29
- package/es/core/viewer/components/plugins/ResourceDetail/hooks/useUserId.js +32 -36
- package/es/core/viewer/components/plugins/ResourceWebControllUrlSettingDialog.js +17 -19
- package/es/networkTopo/components/Link/hook.js +73 -77
- package/es/networkTopo/components/Link/index.js +86 -94
- package/es/networkTopo/components/Link/setting.js +42 -44
- package/es/networkTopo/getTopoData.js +63 -69
- package/es/networkTopo/hooks/viewer/useRelateTopo.js +30 -32
- package/es/networkTopo/models/LinkDynamicStyleExecutor.js +2 -2
- package/es/networkTopo/models/TopoCenter.js +18 -22
- package/es/networkTopo/services/alert.js +18 -22
- package/es/networkTopo/services/authorization.js +45 -55
- package/es/networkTopo/services/cmdb.js +422 -470
- package/es/networkTopo/services/funcAuth.js +22 -24
- package/es/networkTopo/services/link.js +107 -117
- package/es/networkTopo/services/mdc.js +18 -24
- package/es/networkTopo/services/metric.js +23 -27
- package/es/networkTopo/services/model.js +445 -509
- package/es/networkTopo/services/risk.js +9 -11
- package/es/networkTopo/services/topo/auth.js +27 -33
- package/es/networkTopo/services/topo/basic.js +251 -289
- package/es/networkTopo/services/topo/blacklist.js +20 -24
- package/es/networkTopo/services/topo/ciInfo.js +27 -31
- package/es/networkTopo/services/topo/icon.js +49 -59
- package/es/networkTopo/services/topo/networkLink.js +32 -36
- package/es/networkTopo/services/topo/relation.js +9 -11
- package/es/networkTopo/services/topo/resourceWebUrl.js +36 -42
- package/es/networkTopo/store/functionAuth.js +31 -37
- package/es/networkTopo/store/topoCenter.js +142 -152
- package/es/networkTopo/store/topoLinkMod.js +4 -6
- package/es/networkTopo/store/topoTreeMod.js +170 -182
- package/es/networkTopo/utils/exportData.js +52 -54
- package/lib/components/BatchAttrMetric/setting.js +1 -1
- package/lib/components/MultiResourceDrawer/index.js +16 -18
- package/lib/components/ResourceList/ResourceSelect.js +48 -50
- package/lib/components/ResourceSelectDrawer/ResourceSelectDrawer.js +27 -29
- package/lib/components/SingleResourceDrawer/SelectDrawer.js +18 -20
- package/lib/core/components/DisplaySettingDrawer/DisplaySettingDrawer.js +30 -32
- package/lib/core/components/DisplaySettingDrawer/hooks/useDisplaySetting.js +78 -84
- package/lib/core/components/titlebar/widgets/TitleWidget.js +5 -3
- package/lib/core/editor/components/BackgroundView/UploadDialog/index.js +18 -18
- package/lib/core/editor/components/BackgroundView/index.js +118 -128
- package/lib/core/editor/components/CustomIconPlugin/RenameDialog.js +22 -24
- package/lib/core/editor/components/CustomIconPlugin/UploadIconDialog.js +34 -34
- package/lib/core/editor/components/CustomIconPlugin/utils/svgToShape.js +19 -21
- package/lib/core/editor/components/GroupAddResourceDrawerPlugin/GroupAddResourceDrawer.js +8 -10
- package/lib/core/editor/components/Sidebar/views/CanvasPanel/hooks/useCanvasThemeConfig.js +37 -41
- package/lib/core/editor/components/Toolbar/widgets/BoxBackgroundButton/BoxBackgroundSetting.js +50 -54
- package/lib/core/editor/components/Toolbar/widgets/FontColorButton.js +50 -54
- package/lib/core/editor/components/settings/propertyViews/layer/DataTab/DefaultLayerAddResourceDrawer.js +12 -14
- package/lib/core/editor/components/settings/propertyViews/node/data/BindResourceDrawer.js +26 -28
- package/lib/core/editor/components/settings/propertyViews/node/data/Data.js +15 -17
- package/lib/core/editor/components/settings/propertyViews/view/BackgroundSize.js +12 -14
- package/lib/core/editor/components/titlebar/TopoEditorTitleBar.js +25 -31
- package/lib/core/editor/hooks/useKeyboardShortcut.js +37 -34
- package/lib/core/editor/hooks/useNewElementTheme.js +2 -2
- package/lib/core/editor/store/background.js +8 -10
- package/lib/core/editor/store/topoEdit.js +4 -6
- package/lib/core/editor/utils/copyElementUtil.js +182 -0
- package/lib/core/editor/utils/edgeTypeStyleUtil.js +2 -4
- package/lib/core/hooks/usePolling.js +116 -120
- package/lib/core/hooks/useResourceConfig.js +58 -66
- package/lib/core/hooks/useTopoEdit.js +465 -495
- package/lib/core/models/Alarm.js +275 -292
- package/lib/core/models/AttributeMetricDisplay.js +104 -110
- package/lib/core/models/PluginManager.js +4 -3
- package/lib/core/models/SelectionModel.js +4 -5
- package/lib/core/models/TopoApp.js +205 -240
- package/lib/core/models/TopoGraphView.js +18 -21
- package/lib/core/models/cache/CiCache.js +33 -32
- package/lib/core/models/cache/CiTypeCache.js +38 -42
- package/lib/core/models/cache/DictCache.js +33 -35
- package/lib/core/models/graph/Background.js +16 -18
- package/lib/core/models/plugins/resourceWebControllUrl.js +74 -80
- package/lib/core/models/tagstips/ElementTagTipConfig.js +34 -38
- package/lib/core/models/topoData.js +69 -71
- package/lib/core/models/utils/linkUtils.js +41 -43
- package/lib/core/models/utils/nodeNameVisibleUtil.js +4 -4
- package/lib/core/services/alarm.js +18 -20
- package/lib/core/services/background.js +70 -78
- package/lib/core/services/cmdb/metric.js +10 -12
- package/lib/core/services/cmdb.js +22 -22
- package/lib/core/services/index.js +45 -51
- package/lib/core/services/overview.js +131 -151
- package/lib/core/services/topo/basic.js +37 -41
- package/lib/core/services/topo/tagtip.js +12 -14
- package/lib/core/store/models/ciModel.js +66 -70
- package/lib/core/store/models/customIcon.js +120 -134
- package/lib/core/store/models/displayConfig.js +15 -19
- package/lib/core/store/models/selection.js +4 -6
- package/lib/core/store/models/topoAlarm.js +163 -145
- package/lib/core/store/models/topoBaseInfoOverview.js +4 -6
- package/lib/core/store/models/topoBizMod.js +9 -11
- package/lib/core/store/models/topoConfig.js +222 -238
- package/lib/core/store/models/topoGraphView.js +4 -6
- package/lib/core/store/models/topoMod.js +375 -397
- package/lib/core/utils/imageUtil.js +22 -24
- package/lib/core/utils/metricUtil.js +5 -0
- package/lib/core/utils/saveSerialize.js +9 -11
- package/lib/core/viewer/components/plugins/ResourceDetail/components/ClusterMemberTable.js +56 -58
- package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/EventsCard.js +15 -17
- package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/ResourceOverview.js +344 -358
- package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/components/Configurator/index.js +86 -92
- package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/components/LinkTopo/LinkTopoCard.js +39 -41
- package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/components/LinkTopo/services/index.js +190 -206
- package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/hooks/useAlarmAndRiskData.js +107 -109
- package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/hooks/useMetricModels.js +57 -59
- package/lib/core/viewer/components/plugins/ResourceDetail/components/WebConsole/WebConsoleForm/hooks/useWebConsole.js +29 -33
- package/lib/core/viewer/components/plugins/ResourceDetail/getCiDisplayMetricModels.js +25 -29
- package/lib/core/viewer/components/plugins/ResourceDetail/hooks/useUserId.js +32 -36
- package/lib/core/viewer/components/plugins/ResourceWebControllUrlSettingDialog.js +18 -20
- package/lib/networkTopo/components/Link/hook.js +73 -77
- package/lib/networkTopo/components/Link/index.js +87 -95
- package/lib/networkTopo/components/Link/setting.js +42 -44
- package/lib/networkTopo/getTopoData.js +63 -69
- package/lib/networkTopo/hooks/viewer/useRelateTopo.js +31 -33
- package/lib/networkTopo/models/LinkDynamicStyleExecutor.js +2 -2
- package/lib/networkTopo/models/TopoCenter.js +18 -22
- package/lib/networkTopo/services/alert.js +18 -22
- package/lib/networkTopo/services/authorization.js +55 -65
- package/lib/networkTopo/services/cmdb.js +422 -470
- package/lib/networkTopo/services/funcAuth.js +24 -26
- package/lib/networkTopo/services/link.js +108 -118
- package/lib/networkTopo/services/mdc.js +21 -27
- package/lib/networkTopo/services/metric.js +27 -31
- package/lib/networkTopo/services/model.js +445 -509
- package/lib/networkTopo/services/risk.js +11 -13
- package/lib/networkTopo/services/topo/auth.js +27 -33
- package/lib/networkTopo/services/topo/basic.js +252 -290
- package/lib/networkTopo/services/topo/blacklist.js +20 -24
- package/lib/networkTopo/services/topo/ciInfo.js +34 -38
- package/lib/networkTopo/services/topo/icon.js +59 -69
- package/lib/networkTopo/services/topo/networkLink.js +32 -36
- package/lib/networkTopo/services/topo/relation.js +11 -13
- package/lib/networkTopo/services/topo/resourceWebUrl.js +44 -50
- package/lib/networkTopo/store/functionAuth.js +31 -37
- package/lib/networkTopo/store/topoCenter.js +142 -152
- package/lib/networkTopo/store/topoLinkMod.js +4 -6
- package/lib/networkTopo/store/topoTreeMod.js +166 -178
- package/lib/networkTopo/utils/exportData.js +59 -61
- package/lib/utils/htElementDataUtil.js +4 -2
- package/package.json +5 -3
@@ -37,21 +37,19 @@ var _excluded = ["checkAuth"],
|
|
37
37
|
var queryById = /*#__PURE__*/function () {
|
38
38
|
var _ref = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee(id) {
|
39
39
|
return _regenerator["default"].wrap(function _callee$(_context) {
|
40
|
-
while (1) {
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
return _context.stop();
|
54
|
-
}
|
40
|
+
while (1) switch (_context.prev = _context.next) {
|
41
|
+
case 0:
|
42
|
+
_context.next = 2;
|
43
|
+
return _componentTopologyUtils.request.post('/mdc/v1/api/cmdb/queryCiById', {
|
44
|
+
id: id
|
45
|
+
});
|
46
|
+
|
47
|
+
case 2:
|
48
|
+
return _context.abrupt("return", _context.sent);
|
49
|
+
|
50
|
+
case 3:
|
51
|
+
case "end":
|
52
|
+
return _context.stop();
|
55
53
|
}
|
56
54
|
}, _callee);
|
57
55
|
}));
|
@@ -76,21 +74,19 @@ exports.queryById = queryById;
|
|
76
74
|
var deleteById = /*#__PURE__*/function () {
|
77
75
|
var _ref2 = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee2(id) {
|
78
76
|
return _regenerator["default"].wrap(function _callee2$(_context2) {
|
79
|
-
while (1) {
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
return _context2.stop();
|
93
|
-
}
|
77
|
+
while (1) switch (_context2.prev = _context2.next) {
|
78
|
+
case 0:
|
79
|
+
_context2.next = 2;
|
80
|
+
return _componentTopologyUtils.request.post('/cmdb/v1/api/ci/deleteById', {
|
81
|
+
id: id
|
82
|
+
});
|
83
|
+
|
84
|
+
case 2:
|
85
|
+
return _context2.abrupt("return", _context2.sent);
|
86
|
+
|
87
|
+
case 3:
|
88
|
+
case "end":
|
89
|
+
return _context2.stop();
|
94
90
|
}
|
95
91
|
}, _callee2);
|
96
92
|
}));
|
@@ -116,29 +112,27 @@ var batchDeleteById = /*#__PURE__*/function () {
|
|
116
112
|
var _ref3 = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee3(keys) {
|
117
113
|
var ids;
|
118
114
|
return _regenerator["default"].wrap(function _callee3$(_context3) {
|
119
|
-
while (1) {
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
115
|
+
while (1) switch (_context3.prev = _context3.next) {
|
116
|
+
case 0:
|
117
|
+
if (keys === void 0) {
|
118
|
+
keys = [];
|
119
|
+
}
|
120
|
+
|
121
|
+
// TODO 替换为map
|
122
|
+
ids = keys.map(function (key) {
|
123
|
+
return {
|
124
|
+
id: key
|
125
|
+
};
|
126
|
+
});
|
127
|
+
_context3.next = 4;
|
128
|
+
return _componentTopologyUtils.request.post('/cmdb/v1/api/ci/batchDeleteById', ids);
|
125
129
|
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
_context3.next = 4;
|
133
|
-
return _componentTopologyUtils.request.post('/cmdb/v1/api/ci/batchDeleteById', ids);
|
134
|
-
|
135
|
-
case 4:
|
136
|
-
return _context3.abrupt("return", _context3.sent);
|
137
|
-
|
138
|
-
case 5:
|
139
|
-
case "end":
|
140
|
-
return _context3.stop();
|
141
|
-
}
|
130
|
+
case 4:
|
131
|
+
return _context3.abrupt("return", _context3.sent);
|
132
|
+
|
133
|
+
case 5:
|
134
|
+
case "end":
|
135
|
+
return _context3.stop();
|
142
136
|
}
|
143
137
|
}, _callee3);
|
144
138
|
}));
|
@@ -172,83 +166,81 @@ var fetchCommonQuery = /*#__PURE__*/function () {
|
|
172
166
|
var newCondition, _ref5, _ref5$checkAuth, checkAuth, otherOption, url, sorts, params, response, _ref6, totalPage, pageIndex, data, result;
|
173
167
|
|
174
168
|
return _regenerator["default"].wrap(function _callee4$(_context4) {
|
175
|
-
while (1) {
|
176
|
-
|
177
|
-
|
178
|
-
|
179
|
-
|
180
|
-
|
181
|
-
|
182
|
-
|
183
|
-
|
184
|
-
|
185
|
-
|
186
|
-
|
187
|
-
|
188
|
-
|
189
|
-
|
190
|
-
|
191
|
-
|
192
|
-
|
193
|
-
|
194
|
-
|
195
|
-
}
|
196
|
-
|
197
|
-
return param;
|
198
|
-
}, []).join(' && ');
|
199
|
-
}
|
200
|
-
|
201
|
-
_ref5 = authOption || {}, _ref5$checkAuth = _ref5.checkAuth, checkAuth = _ref5$checkAuth === void 0 ? true : _ref5$checkAuth, otherOption = (0, _objectWithoutPropertiesLoose2["default"])(_ref5, _excluded); // const url = checkAuth
|
202
|
-
// ? '/appserver/api/v1/cmdb/ci/commonQuery'
|
203
|
-
// : '/api/v1/cmdb/ci/commonQuery';
|
204
|
-
// const url ='/api/v1/cmdb/ci/commonQuery';
|
205
|
-
// let params = {
|
206
|
-
// condition: condition.conditions
|
207
|
-
// ? `${newCondition} && ${condition.conditions}`
|
208
|
-
// : newCondition,
|
209
|
-
// sort: sort || `${sortIndex} ${sortMethod}`,
|
210
|
-
// currentPage,
|
211
|
-
// pageSize,
|
212
|
-
// };
|
213
|
-
// APPBIR MVP
|
214
|
-
// ------------------------------------------------
|
215
|
-
// TODO important 带确认权限接口是否可通 ---
|
216
|
-
|
217
|
-
url = checkAuth ? '/mdc/v1/api/cmdb/authority/commonQueryCiData' : '/mdc/v1/api/cmdb/commonQueryCiData';
|
218
|
-
sorts = sort ? sort.split(" ") : [sortIndex, sortMethod];
|
219
|
-
params = {
|
220
|
-
condition: condition.conditions ? newCondition + " && " + condition.conditions : newCondition,
|
221
|
-
// APPBIR MVP 临时去掉排序 等接口OK
|
222
|
-
// orders: [{
|
223
|
-
// name: sorts[0],
|
224
|
-
// type: sorts[1]
|
225
|
-
// }],
|
226
|
-
pageIndex: currentPage,
|
227
|
-
pageSize: pageSize
|
228
|
-
};
|
229
|
-
|
230
|
-
if (checkAuth && otherOption) {
|
231
|
-
params = (0, _extends2["default"])({}, params, otherOption);
|
232
|
-
} // 处理 返回结果
|
233
|
-
|
234
|
-
|
235
|
-
_context4.next = 9;
|
236
|
-
return _componentTopologyUtils.request.post(url, params);
|
237
|
-
|
238
|
-
case 9:
|
239
|
-
response = _context4.sent;
|
240
|
-
// TODO ---
|
241
|
-
_ref6 = response || {}, totalPage = _ref6.totalPage, pageIndex = _ref6.pageIndex, data = _ref6.data, result = (0, _objectWithoutPropertiesLoose2["default"])(_ref6, _excluded2);
|
242
|
-
return _context4.abrupt("return", (0, _extends2["default"])({}, result, {
|
243
|
-
total: totalPage,
|
244
|
-
page: pageIndex,
|
245
|
-
content: data
|
246
|
-
}));
|
169
|
+
while (1) switch (_context4.prev = _context4.next) {
|
170
|
+
case 0:
|
171
|
+
newCondition = condition;
|
172
|
+
|
173
|
+
if (typeof newCondition !== 'string') {
|
174
|
+
newCondition = Object.keys(newCondition).reduce(function (param, current) {
|
175
|
+
if (current === 'ciType') {
|
176
|
+
param.push("type(" + (Array.isArray(newCondition[current]) ? newCondition[current].map(function (item) {
|
177
|
+
return "'" + item + "'";
|
178
|
+
}).toString() : "'" + newCondition[current] + "'") + ")");
|
179
|
+
} else if (current === 'principal') {
|
180
|
+
param.push(newCondition[current]);
|
181
|
+
} else if (current === 'searchValue' && newCondition.searchValue && newCondition.searchIndexArray) {
|
182
|
+
param.push("contain('" + newCondition.searchValue + "'," + newCondition.searchIndexArray.toString() + ")");
|
183
|
+
} else if (current === 'alert') {
|
184
|
+
var alert = Object.keys(newCondition[current]).map(function (item) {
|
185
|
+
return item + " = " + newCondition[current][item];
|
186
|
+
}).join(' && ');
|
187
|
+
param.push("alert(" + alert + ")");
|
188
|
+
}
|
247
189
|
|
248
|
-
|
249
|
-
|
250
|
-
|
251
|
-
|
190
|
+
return param;
|
191
|
+
}, []).join(' && ');
|
192
|
+
}
|
193
|
+
|
194
|
+
_ref5 = authOption || {}, _ref5$checkAuth = _ref5.checkAuth, checkAuth = _ref5$checkAuth === void 0 ? true : _ref5$checkAuth, otherOption = (0, _objectWithoutPropertiesLoose2["default"])(_ref5, _excluded); // const url = checkAuth
|
195
|
+
// ? '/appserver/api/v1/cmdb/ci/commonQuery'
|
196
|
+
// : '/api/v1/cmdb/ci/commonQuery';
|
197
|
+
// const url ='/api/v1/cmdb/ci/commonQuery';
|
198
|
+
// let params = {
|
199
|
+
// condition: condition.conditions
|
200
|
+
// ? `${newCondition} && ${condition.conditions}`
|
201
|
+
// : newCondition,
|
202
|
+
// sort: sort || `${sortIndex} ${sortMethod}`,
|
203
|
+
// currentPage,
|
204
|
+
// pageSize,
|
205
|
+
// };
|
206
|
+
// APPBIR MVP
|
207
|
+
// ------------------------------------------------
|
208
|
+
// TODO important 带确认权限接口是否可通 ---
|
209
|
+
|
210
|
+
url = checkAuth ? '/mdc/v1/api/cmdb/authority/commonQueryCiData' : '/mdc/v1/api/cmdb/commonQueryCiData';
|
211
|
+
sorts = sort ? sort.split(" ") : [sortIndex, sortMethod];
|
212
|
+
params = {
|
213
|
+
condition: condition.conditions ? newCondition + " && " + condition.conditions : newCondition,
|
214
|
+
// APPBIR MVP 临时去掉排序 等接口OK
|
215
|
+
// orders: [{
|
216
|
+
// name: sorts[0],
|
217
|
+
// type: sorts[1]
|
218
|
+
// }],
|
219
|
+
pageIndex: currentPage,
|
220
|
+
pageSize: pageSize
|
221
|
+
};
|
222
|
+
|
223
|
+
if (checkAuth && otherOption) {
|
224
|
+
params = (0, _extends2["default"])({}, params, otherOption);
|
225
|
+
} // 处理 返回结果
|
226
|
+
|
227
|
+
|
228
|
+
_context4.next = 9;
|
229
|
+
return _componentTopologyUtils.request.post(url, params);
|
230
|
+
|
231
|
+
case 9:
|
232
|
+
response = _context4.sent;
|
233
|
+
// TODO ---
|
234
|
+
_ref6 = response || {}, totalPage = _ref6.totalPage, pageIndex = _ref6.pageIndex, data = _ref6.data, result = (0, _objectWithoutPropertiesLoose2["default"])(_ref6, _excluded2);
|
235
|
+
return _context4.abrupt("return", (0, _extends2["default"])({}, result, {
|
236
|
+
total: totalPage,
|
237
|
+
page: pageIndex,
|
238
|
+
content: data
|
239
|
+
}));
|
240
|
+
|
241
|
+
case 12:
|
242
|
+
case "end":
|
243
|
+
return _context4.stop();
|
252
244
|
}
|
253
245
|
}, _callee4);
|
254
246
|
}));
|
@@ -274,19 +266,17 @@ function commonQuery(_x11) {
|
|
274
266
|
function _commonQuery() {
|
275
267
|
_commonQuery = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee18(param) {
|
276
268
|
return _regenerator["default"].wrap(function _callee18$(_context18) {
|
277
|
-
while (1) {
|
278
|
-
|
279
|
-
|
280
|
-
|
281
|
-
|
282
|
-
|
283
|
-
|
284
|
-
|
285
|
-
|
286
|
-
|
287
|
-
|
288
|
-
return _context18.stop();
|
289
|
-
}
|
269
|
+
while (1) switch (_context18.prev = _context18.next) {
|
270
|
+
case 0:
|
271
|
+
_context18.next = 2;
|
272
|
+
return _componentTopologyUtils.request.post('/cmdb/v1/api/ci/commonQuery', param);
|
273
|
+
|
274
|
+
case 2:
|
275
|
+
return _context18.abrupt("return", _context18.sent);
|
276
|
+
|
277
|
+
case 3:
|
278
|
+
case "end":
|
279
|
+
return _context18.stop();
|
290
280
|
}
|
291
281
|
}, _callee18);
|
292
282
|
}));
|
@@ -298,54 +288,52 @@ var batchUpdateAttributes = /*#__PURE__*/function () {
|
|
298
288
|
var aa, _aa;
|
299
289
|
|
300
290
|
return _regenerator["default"].wrap(function _callee5$(_context5) {
|
301
|
-
while (1) {
|
302
|
-
|
303
|
-
|
304
|
-
|
305
|
-
|
306
|
-
|
307
|
-
|
308
|
-
|
309
|
-
|
310
|
-
|
311
|
-
|
312
|
-
|
313
|
-
|
314
|
-
|
315
|
-
|
316
|
-
|
317
|
-
|
318
|
-
|
319
|
-
|
320
|
-
|
321
|
-
|
322
|
-
|
323
|
-
|
324
|
-
|
325
|
-
|
326
|
-
|
327
|
-
|
328
|
-
|
329
|
-
|
330
|
-
|
331
|
-
|
332
|
-
|
333
|
-
|
334
|
-
|
335
|
-
|
336
|
-
|
337
|
-
|
338
|
-
|
339
|
-
|
340
|
-
|
341
|
-
|
342
|
-
|
343
|
-
|
344
|
-
|
345
|
-
|
346
|
-
|
347
|
-
return _context5.stop();
|
348
|
-
}
|
291
|
+
while (1) switch (_context5.prev = _context5.next) {
|
292
|
+
case 0:
|
293
|
+
if (!fieldName) {
|
294
|
+
_context5.next = 8;
|
295
|
+
break;
|
296
|
+
}
|
297
|
+
|
298
|
+
// 传了要更新的属性名,更新某一个属性
|
299
|
+
aa = {};
|
300
|
+
aa[fieldName] = values[fieldName];
|
301
|
+
_context5.next = 5;
|
302
|
+
return _componentTopologyUtils.request.post('/cmdb/v1/api/ci/batchUpdateAttributes', [{
|
303
|
+
id: values.id,
|
304
|
+
attributes: aa
|
305
|
+
}]);
|
306
|
+
|
307
|
+
case 5:
|
308
|
+
return _context5.abrupt("return", _context5.sent);
|
309
|
+
|
310
|
+
case 8:
|
311
|
+
if (!Array.isArray(values)) {
|
312
|
+
_context5.next = 12;
|
313
|
+
break;
|
314
|
+
}
|
315
|
+
|
316
|
+
_context5.next = 11;
|
317
|
+
return _componentTopologyUtils.request.post('/cmdb/v1/api/ci/batchUpdateAttributes', values);
|
318
|
+
|
319
|
+
case 11:
|
320
|
+
return _context5.abrupt("return", _context5.sent);
|
321
|
+
|
322
|
+
case 12:
|
323
|
+
_aa = values.id;
|
324
|
+
delete values.id;
|
325
|
+
_context5.next = 16;
|
326
|
+
return _componentTopologyUtils.request.post('/cmdb/v1/api/ci/batchUpdateAttributes', [{
|
327
|
+
id: _aa,
|
328
|
+
attributes: values
|
329
|
+
}]);
|
330
|
+
|
331
|
+
case 16:
|
332
|
+
return _context5.abrupt("return", _context5.sent);
|
333
|
+
|
334
|
+
case 17:
|
335
|
+
case "end":
|
336
|
+
return _context5.stop();
|
349
337
|
}
|
350
338
|
}, _callee5);
|
351
339
|
}));
|
@@ -361,19 +349,17 @@ exports.batchUpdateAttributes = batchUpdateAttributes;
|
|
361
349
|
var createInstance = /*#__PURE__*/function () {
|
362
350
|
var _ref8 = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee6(values) {
|
363
351
|
return _regenerator["default"].wrap(function _callee6$(_context6) {
|
364
|
-
while (1) {
|
365
|
-
|
366
|
-
|
367
|
-
|
368
|
-
|
369
|
-
|
370
|
-
|
371
|
-
|
372
|
-
|
373
|
-
|
374
|
-
|
375
|
-
return _context6.stop();
|
376
|
-
}
|
352
|
+
while (1) switch (_context6.prev = _context6.next) {
|
353
|
+
case 0:
|
354
|
+
_context6.next = 2;
|
355
|
+
return _componentTopologyUtils.request.post('/cmdb/v1/api/ci/create', values);
|
356
|
+
|
357
|
+
case 2:
|
358
|
+
return _context6.abrupt("return", _context6.sent);
|
359
|
+
|
360
|
+
case 3:
|
361
|
+
case "end":
|
362
|
+
return _context6.stop();
|
377
363
|
}
|
378
364
|
}, _callee6);
|
379
365
|
}));
|
@@ -404,19 +390,17 @@ function changeManageStatus(_x15) {
|
|
404
390
|
function _changeManageStatus() {
|
405
391
|
_changeManageStatus = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee19(param) {
|
406
392
|
return _regenerator["default"].wrap(function _callee19$(_context19) {
|
407
|
-
while (1) {
|
408
|
-
|
409
|
-
|
410
|
-
|
411
|
-
|
412
|
-
|
413
|
-
|
414
|
-
|
415
|
-
|
416
|
-
|
417
|
-
|
418
|
-
return _context19.stop();
|
419
|
-
}
|
393
|
+
while (1) switch (_context19.prev = _context19.next) {
|
394
|
+
case 0:
|
395
|
+
_context19.next = 2;
|
396
|
+
return _componentTopologyUtils.request.post('/cmdb/v1/api/ci/changeManageStatus', param);
|
397
|
+
|
398
|
+
case 2:
|
399
|
+
return _context19.abrupt("return", _context19.sent);
|
400
|
+
|
401
|
+
case 3:
|
402
|
+
case "end":
|
403
|
+
return _context19.stop();
|
420
404
|
}
|
421
405
|
}, _callee19);
|
422
406
|
}));
|
@@ -440,19 +424,17 @@ function batchChangeManageStatus(_x16) {
|
|
440
424
|
function _batchChangeManageStatus() {
|
441
425
|
_batchChangeManageStatus = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee20(param) {
|
442
426
|
return _regenerator["default"].wrap(function _callee20$(_context20) {
|
443
|
-
while (1) {
|
444
|
-
|
445
|
-
|
446
|
-
|
447
|
-
|
448
|
-
|
449
|
-
|
450
|
-
|
451
|
-
|
452
|
-
|
453
|
-
|
454
|
-
return _context20.stop();
|
455
|
-
}
|
427
|
+
while (1) switch (_context20.prev = _context20.next) {
|
428
|
+
case 0:
|
429
|
+
_context20.next = 2;
|
430
|
+
return _componentTopologyUtils.request.post('/cmdb/v1/api/ci/batchChangeManageStatus', param);
|
431
|
+
|
432
|
+
case 2:
|
433
|
+
return _context20.abrupt("return", _context20.sent);
|
434
|
+
|
435
|
+
case 3:
|
436
|
+
case "end":
|
437
|
+
return _context20.stop();
|
456
438
|
}
|
457
439
|
}, _callee20);
|
458
440
|
}));
|
@@ -472,19 +454,17 @@ function commonCount(_x17) {
|
|
472
454
|
function _commonCount() {
|
473
455
|
_commonCount = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee21(param) {
|
474
456
|
return _regenerator["default"].wrap(function _callee21$(_context21) {
|
475
|
-
while (1) {
|
476
|
-
|
477
|
-
|
478
|
-
|
479
|
-
|
480
|
-
|
481
|
-
|
482
|
-
|
483
|
-
|
484
|
-
|
485
|
-
|
486
|
-
return _context21.stop();
|
487
|
-
}
|
457
|
+
while (1) switch (_context21.prev = _context21.next) {
|
458
|
+
case 0:
|
459
|
+
_context21.next = 2;
|
460
|
+
return _componentTopologyUtils.request.post('/cmdb/v1/api/ci/commonCount', param);
|
461
|
+
|
462
|
+
case 2:
|
463
|
+
return _context21.abrupt("return", _context21.sent);
|
464
|
+
|
465
|
+
case 3:
|
466
|
+
case "end":
|
467
|
+
return _context21.stop();
|
488
468
|
}
|
489
469
|
}, _callee21);
|
490
470
|
}));
|
@@ -507,19 +487,17 @@ function queryCiWithComponents(_x18) {
|
|
507
487
|
function _queryCiWithComponents() {
|
508
488
|
_queryCiWithComponents = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee22(mainCiIds) {
|
509
489
|
return _regenerator["default"].wrap(function _callee22$(_context22) {
|
510
|
-
while (1) {
|
511
|
-
|
512
|
-
|
513
|
-
|
514
|
-
|
515
|
-
|
516
|
-
|
517
|
-
|
518
|
-
|
519
|
-
|
520
|
-
|
521
|
-
return _context22.stop();
|
522
|
-
}
|
490
|
+
while (1) switch (_context22.prev = _context22.next) {
|
491
|
+
case 0:
|
492
|
+
_context22.next = 2;
|
493
|
+
return _componentTopologyUtils.request.post('/cmdb/v1/api/ci/queryCiWithComponents', mainCiIds);
|
494
|
+
|
495
|
+
case 2:
|
496
|
+
return _context22.abrupt("return", _context22.sent);
|
497
|
+
|
498
|
+
case 3:
|
499
|
+
case "end":
|
500
|
+
return _context22.stop();
|
523
501
|
}
|
524
502
|
}, _callee22);
|
525
503
|
}));
|
@@ -538,27 +516,25 @@ function queryPageIgnoreRelations(_x19, _x20, _x21, _x22, _x23) {
|
|
538
516
|
function _queryPageIgnoreRelations() {
|
539
517
|
_queryPageIgnoreRelations = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee23(relationType, currentPage, pageSize, condition, sort) {
|
540
518
|
return _regenerator["default"].wrap(function _callee23$(_context23) {
|
541
|
-
while (1) {
|
542
|
-
|
543
|
-
|
544
|
-
|
545
|
-
|
546
|
-
|
547
|
-
|
548
|
-
|
549
|
-
|
550
|
-
|
551
|
-
|
552
|
-
|
553
|
-
|
554
|
-
|
555
|
-
|
556
|
-
|
557
|
-
|
558
|
-
|
559
|
-
|
560
|
-
return _context23.stop();
|
561
|
-
}
|
519
|
+
while (1) switch (_context23.prev = _context23.next) {
|
520
|
+
case 0:
|
521
|
+
_context23.next = 2;
|
522
|
+
return _componentTopologyUtils.request.post('/cmdb/v1/api/relation/ignore/list', (0, _extends2["default"])({
|
523
|
+
relationType: relationType,
|
524
|
+
currentPage: currentPage,
|
525
|
+
pageSize: pageSize
|
526
|
+
}, condition ? {
|
527
|
+
condition: condition
|
528
|
+
} : {}, sort ? {
|
529
|
+
sort: sort
|
530
|
+
} : {}));
|
531
|
+
|
532
|
+
case 2:
|
533
|
+
return _context23.abrupt("return", _context23.sent);
|
534
|
+
|
535
|
+
case 3:
|
536
|
+
case "end":
|
537
|
+
return _context23.stop();
|
562
538
|
}
|
563
539
|
}, _callee23);
|
564
540
|
}));
|
@@ -573,23 +549,21 @@ function deleteIgnoreRelations(_x24) {
|
|
573
549
|
function _deleteIgnoreRelations() {
|
574
550
|
_deleteIgnoreRelations = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee24(ids) {
|
575
551
|
return _regenerator["default"].wrap(function _callee24$(_context24) {
|
576
|
-
while (1) {
|
577
|
-
|
578
|
-
|
579
|
-
|
580
|
-
return
|
581
|
-
|
582
|
-
|
583
|
-
|
584
|
-
|
585
|
-
|
586
|
-
|
587
|
-
|
588
|
-
|
589
|
-
|
590
|
-
|
591
|
-
return _context24.stop();
|
592
|
-
}
|
552
|
+
while (1) switch (_context24.prev = _context24.next) {
|
553
|
+
case 0:
|
554
|
+
_context24.next = 2;
|
555
|
+
return _componentTopologyUtils.request.post('/cmdb/v1/api/relation/ignore/batchDeleteById', ids.map(function (id) {
|
556
|
+
return {
|
557
|
+
id: id
|
558
|
+
};
|
559
|
+
}));
|
560
|
+
|
561
|
+
case 2:
|
562
|
+
return _context24.abrupt("return", _context24.sent);
|
563
|
+
|
564
|
+
case 3:
|
565
|
+
case "end":
|
566
|
+
return _context24.stop();
|
593
567
|
}
|
594
568
|
}, _callee24);
|
595
569
|
}));
|
@@ -600,38 +574,36 @@ var uploadFile = /*#__PURE__*/function () {
|
|
600
574
|
var _ref9 = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee7(files, userId, modelType) {
|
601
575
|
var formData, names, originFiles, config, result;
|
602
576
|
return _regenerator["default"].wrap(function _callee7$(_context7) {
|
603
|
-
while (1) {
|
604
|
-
|
605
|
-
|
606
|
-
|
607
|
-
|
608
|
-
|
609
|
-
|
610
|
-
|
611
|
-
|
612
|
-
|
613
|
-
|
614
|
-
|
615
|
-
|
616
|
-
|
617
|
-
|
618
|
-
|
619
|
-
|
620
|
-
|
621
|
-
|
622
|
-
|
623
|
-
|
624
|
-
|
625
|
-
return _componentTopologyUtils.request.post('/cmdb/v1/api/import', formData, config);
|
577
|
+
while (1) switch (_context7.prev = _context7.next) {
|
578
|
+
case 0:
|
579
|
+
formData = new FormData(); // 用户id
|
580
|
+
|
581
|
+
formData.append('userId', userId);
|
582
|
+
modelType && formData.append('modelType', modelType);
|
583
|
+
names = [];
|
584
|
+
originFiles = [];
|
585
|
+
files.forEach(function (_ref10) {
|
586
|
+
var name = _ref10.name,
|
587
|
+
originFileObj = _ref10.originFileObj;
|
588
|
+
names.push(name);
|
589
|
+
originFiles.push(originFileObj);
|
590
|
+
formData.append('files', originFileObj, name);
|
591
|
+
});
|
592
|
+
config = {
|
593
|
+
headers: {
|
594
|
+
'Content-Type': "multipart/form-data;boundary=" + new Date().getTime()
|
595
|
+
}
|
596
|
+
};
|
597
|
+
_context7.next = 9;
|
598
|
+
return _componentTopologyUtils.request.post('/cmdb/v1/api/import', formData, config);
|
626
599
|
|
627
|
-
|
628
|
-
|
629
|
-
|
600
|
+
case 9:
|
601
|
+
result = _context7.sent;
|
602
|
+
return _context7.abrupt("return", result);
|
630
603
|
|
631
|
-
|
632
|
-
|
633
|
-
|
634
|
-
}
|
604
|
+
case 11:
|
605
|
+
case "end":
|
606
|
+
return _context7.stop();
|
635
607
|
}
|
636
608
|
}, _callee7);
|
637
609
|
}));
|
@@ -648,23 +620,21 @@ var closeRecord = /*#__PURE__*/function () {
|
|
648
620
|
var _ref11 = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee8(userId, modelType) {
|
649
621
|
var result;
|
650
622
|
return _regenerator["default"].wrap(function _callee8$(_context8) {
|
651
|
-
while (1) {
|
652
|
-
|
653
|
-
|
654
|
-
|
655
|
-
|
656
|
-
|
657
|
-
|
658
|
-
|
659
|
-
|
660
|
-
|
661
|
-
|
662
|
-
|
663
|
-
|
664
|
-
|
665
|
-
|
666
|
-
return _context8.stop();
|
667
|
-
}
|
623
|
+
while (1) switch (_context8.prev = _context8.next) {
|
624
|
+
case 0:
|
625
|
+
_context8.next = 2;
|
626
|
+
return _componentTopologyUtils.request.post('/cmdb/v1/api/delete/import/record', {
|
627
|
+
userId: userId,
|
628
|
+
modelType: modelType
|
629
|
+
});
|
630
|
+
|
631
|
+
case 2:
|
632
|
+
result = _context8.sent;
|
633
|
+
return _context8.abrupt("return", result);
|
634
|
+
|
635
|
+
case 4:
|
636
|
+
case "end":
|
637
|
+
return _context8.stop();
|
668
638
|
}
|
669
639
|
}, _callee8);
|
670
640
|
}));
|
@@ -680,22 +650,20 @@ exports.closeRecord = closeRecord;
|
|
680
650
|
var getRecord = /*#__PURE__*/function () {
|
681
651
|
var _ref12 = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee9(userId, modelType) {
|
682
652
|
return _regenerator["default"].wrap(function _callee9$(_context9) {
|
683
|
-
while (1) {
|
684
|
-
|
685
|
-
|
686
|
-
|
687
|
-
|
688
|
-
|
689
|
-
|
690
|
-
|
691
|
-
|
692
|
-
|
693
|
-
|
694
|
-
|
695
|
-
|
696
|
-
|
697
|
-
return _context9.stop();
|
698
|
-
}
|
653
|
+
while (1) switch (_context9.prev = _context9.next) {
|
654
|
+
case 0:
|
655
|
+
_context9.next = 2;
|
656
|
+
return _componentTopologyUtils.request.post('/cmdb/v1/api/get/import/record', {
|
657
|
+
userId: userId,
|
658
|
+
modelType: modelType
|
659
|
+
});
|
660
|
+
|
661
|
+
case 2:
|
662
|
+
return _context9.abrupt("return", _context9.sent);
|
663
|
+
|
664
|
+
case 3:
|
665
|
+
case "end":
|
666
|
+
return _context9.stop();
|
699
667
|
}
|
700
668
|
}, _callee9);
|
701
669
|
}));
|
@@ -716,19 +684,17 @@ exports.getRecord = getRecord;
|
|
716
684
|
var batchCreateRelation = /*#__PURE__*/function () {
|
717
685
|
var _ref13 = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee10(params) {
|
718
686
|
return _regenerator["default"].wrap(function _callee10$(_context10) {
|
719
|
-
while (1) {
|
720
|
-
|
721
|
-
|
722
|
-
|
723
|
-
|
724
|
-
|
725
|
-
|
726
|
-
|
727
|
-
|
728
|
-
|
729
|
-
|
730
|
-
return _context10.stop();
|
731
|
-
}
|
687
|
+
while (1) switch (_context10.prev = _context10.next) {
|
688
|
+
case 0:
|
689
|
+
_context10.next = 2;
|
690
|
+
return _componentTopologyUtils.request.post('/cmdb/v1/api/relation/batchCreate', params);
|
691
|
+
|
692
|
+
case 2:
|
693
|
+
return _context10.abrupt("return", _context10.sent);
|
694
|
+
|
695
|
+
case 3:
|
696
|
+
case "end":
|
697
|
+
return _context10.stop();
|
732
698
|
}
|
733
699
|
}, _callee10);
|
734
700
|
}));
|
@@ -743,21 +709,19 @@ exports.batchCreateRelation = batchCreateRelation;
|
|
743
709
|
var queryRelationByEndpoint = /*#__PURE__*/function () {
|
744
710
|
var _ref14 = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee11(id) {
|
745
711
|
return _regenerator["default"].wrap(function _callee11$(_context11) {
|
746
|
-
while (1) {
|
747
|
-
|
748
|
-
|
749
|
-
|
750
|
-
|
751
|
-
|
752
|
-
|
753
|
-
|
754
|
-
|
755
|
-
|
756
|
-
|
757
|
-
|
758
|
-
|
759
|
-
return _context11.stop();
|
760
|
-
}
|
712
|
+
while (1) switch (_context11.prev = _context11.next) {
|
713
|
+
case 0:
|
714
|
+
_context11.next = 2;
|
715
|
+
return _componentTopologyUtils.request.post('/cmdb/v1/api/relation/queryByEndpoint', {
|
716
|
+
id: id
|
717
|
+
});
|
718
|
+
|
719
|
+
case 2:
|
720
|
+
return _context11.abrupt("return", _context11.sent);
|
721
|
+
|
722
|
+
case 3:
|
723
|
+
case "end":
|
724
|
+
return _context11.stop();
|
761
725
|
}
|
762
726
|
}, _callee11);
|
763
727
|
}));
|
@@ -778,19 +742,17 @@ exports.queryRelationByEndpoint = queryRelationByEndpoint;
|
|
778
742
|
var batchUpdateRelation = /*#__PURE__*/function () {
|
779
743
|
var _ref15 = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee12(params) {
|
780
744
|
return _regenerator["default"].wrap(function _callee12$(_context12) {
|
781
|
-
while (1) {
|
782
|
-
|
783
|
-
|
784
|
-
|
785
|
-
|
786
|
-
|
787
|
-
|
788
|
-
|
789
|
-
|
790
|
-
|
791
|
-
|
792
|
-
return _context12.stop();
|
793
|
-
}
|
745
|
+
while (1) switch (_context12.prev = _context12.next) {
|
746
|
+
case 0:
|
747
|
+
_context12.next = 2;
|
748
|
+
return _componentTopologyUtils.request.post('/cmdb/v1/api/relation/batchUpdateAttributes', params);
|
749
|
+
|
750
|
+
case 2:
|
751
|
+
return _context12.abrupt("return", _context12.sent);
|
752
|
+
|
753
|
+
case 3:
|
754
|
+
case "end":
|
755
|
+
return _context12.stop();
|
794
756
|
}
|
795
757
|
}, _callee12);
|
796
758
|
}));
|
@@ -811,21 +773,19 @@ exports.batchUpdateRelation = batchUpdateRelation;
|
|
811
773
|
var deleteRelation = /*#__PURE__*/function () {
|
812
774
|
var _ref16 = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee13(id) {
|
813
775
|
return _regenerator["default"].wrap(function _callee13$(_context13) {
|
814
|
-
while (1) {
|
815
|
-
|
816
|
-
|
817
|
-
|
818
|
-
|
819
|
-
|
820
|
-
|
821
|
-
|
822
|
-
|
823
|
-
|
824
|
-
|
825
|
-
|
826
|
-
|
827
|
-
return _context13.stop();
|
828
|
-
}
|
776
|
+
while (1) switch (_context13.prev = _context13.next) {
|
777
|
+
case 0:
|
778
|
+
_context13.next = 2;
|
779
|
+
return _componentTopologyUtils.request.post('/cmdb/v1/api/relation/delete', {
|
780
|
+
id: id
|
781
|
+
});
|
782
|
+
|
783
|
+
case 2:
|
784
|
+
return _context13.abrupt("return", _context13.sent);
|
785
|
+
|
786
|
+
case 3:
|
787
|
+
case "end":
|
788
|
+
return _context13.stop();
|
829
789
|
}
|
830
790
|
}, _callee13);
|
831
791
|
}));
|
@@ -846,19 +806,17 @@ exports.deleteRelation = deleteRelation;
|
|
846
806
|
var batchDeleteRelation = /*#__PURE__*/function () {
|
847
807
|
var _ref17 = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee14(params) {
|
848
808
|
return _regenerator["default"].wrap(function _callee14$(_context14) {
|
849
|
-
while (1) {
|
850
|
-
|
851
|
-
|
852
|
-
|
853
|
-
|
854
|
-
|
855
|
-
|
856
|
-
|
857
|
-
|
858
|
-
|
859
|
-
|
860
|
-
return _context14.stop();
|
861
|
-
}
|
809
|
+
while (1) switch (_context14.prev = _context14.next) {
|
810
|
+
case 0:
|
811
|
+
_context14.next = 2;
|
812
|
+
return _componentTopologyUtils.request.post('/cmdb/v1/api/relation/batchDelete', params);
|
813
|
+
|
814
|
+
case 2:
|
815
|
+
return _context14.abrupt("return", _context14.sent);
|
816
|
+
|
817
|
+
case 3:
|
818
|
+
case "end":
|
819
|
+
return _context14.stop();
|
862
820
|
}
|
863
821
|
}, _callee14);
|
864
822
|
}));
|
@@ -879,22 +837,20 @@ exports.batchDeleteRelation = batchDeleteRelation;
|
|
879
837
|
var forceDeleteRelation = /*#__PURE__*/function () {
|
880
838
|
var _ref18 = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee15(id) {
|
881
839
|
return _regenerator["default"].wrap(function _callee15$(_context15) {
|
882
|
-
while (1) {
|
883
|
-
|
884
|
-
|
885
|
-
|
886
|
-
|
887
|
-
|
888
|
-
|
889
|
-
|
890
|
-
|
891
|
-
|
892
|
-
|
893
|
-
|
894
|
-
|
895
|
-
|
896
|
-
return _context15.stop();
|
897
|
-
}
|
840
|
+
while (1) switch (_context15.prev = _context15.next) {
|
841
|
+
case 0:
|
842
|
+
_context15.next = 2;
|
843
|
+
return batchDeleteRelation([{
|
844
|
+
id: id,
|
845
|
+
force: true
|
846
|
+
}]);
|
847
|
+
|
848
|
+
case 2:
|
849
|
+
return _context15.abrupt("return", _context15.sent);
|
850
|
+
|
851
|
+
case 3:
|
852
|
+
case "end":
|
853
|
+
return _context15.stop();
|
898
854
|
}
|
899
855
|
}, _callee15);
|
900
856
|
}));
|
@@ -915,19 +871,17 @@ exports.forceDeleteRelation = forceDeleteRelation;
|
|
915
871
|
var batchQueryRelationById = /*#__PURE__*/function () {
|
916
872
|
var _ref19 = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee16(params) {
|
917
873
|
return _regenerator["default"].wrap(function _callee16$(_context16) {
|
918
|
-
while (1) {
|
919
|
-
|
920
|
-
|
921
|
-
|
922
|
-
|
923
|
-
|
924
|
-
|
925
|
-
|
926
|
-
|
927
|
-
|
928
|
-
|
929
|
-
return _context16.stop();
|
930
|
-
}
|
874
|
+
while (1) switch (_context16.prev = _context16.next) {
|
875
|
+
case 0:
|
876
|
+
_context16.next = 2;
|
877
|
+
return _componentTopologyUtils.request.post('/cmdb/v1/api/relation/batchQueryById', params);
|
878
|
+
|
879
|
+
case 2:
|
880
|
+
return _context16.abrupt("return", _context16.sent);
|
881
|
+
|
882
|
+
case 3:
|
883
|
+
case "end":
|
884
|
+
return _context16.stop();
|
931
885
|
}
|
932
886
|
}, _callee16);
|
933
887
|
}));
|
@@ -948,23 +902,21 @@ exports.batchQueryRelationById = batchQueryRelationById;
|
|
948
902
|
var queryRelationByIds = /*#__PURE__*/function () {
|
949
903
|
var _ref20 = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee17(ids) {
|
950
904
|
return _regenerator["default"].wrap(function _callee17$(_context17) {
|
951
|
-
while (1) {
|
952
|
-
|
953
|
-
|
954
|
-
|
955
|
-
return
|
956
|
-
|
957
|
-
|
958
|
-
|
959
|
-
|
960
|
-
|
961
|
-
|
962
|
-
|
963
|
-
|
964
|
-
|
965
|
-
|
966
|
-
return _context17.stop();
|
967
|
-
}
|
905
|
+
while (1) switch (_context17.prev = _context17.next) {
|
906
|
+
case 0:
|
907
|
+
_context17.next = 2;
|
908
|
+
return batchQueryRelationById(ids.map(function (id) {
|
909
|
+
return {
|
910
|
+
id: id
|
911
|
+
};
|
912
|
+
}));
|
913
|
+
|
914
|
+
case 2:
|
915
|
+
return _context17.abrupt("return", _context17.sent);
|
916
|
+
|
917
|
+
case 3:
|
918
|
+
case "end":
|
919
|
+
return _context17.stop();
|
968
920
|
}
|
969
921
|
}, _callee17);
|
970
922
|
}));
|