@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
@@ -14,21 +14,19 @@ import { request } from '@riil-frontend/component-topology-utils';
|
|
14
14
|
export var queryById = /*#__PURE__*/function () {
|
15
15
|
var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(id) {
|
16
16
|
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
17
|
-
while (1) {
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
return _context.stop();
|
31
|
-
}
|
17
|
+
while (1) switch (_context.prev = _context.next) {
|
18
|
+
case 0:
|
19
|
+
_context.next = 2;
|
20
|
+
return request.post('/mdc/v1/api/cmdb/queryCiById', {
|
21
|
+
id: id
|
22
|
+
});
|
23
|
+
|
24
|
+
case 2:
|
25
|
+
return _context.abrupt("return", _context.sent);
|
26
|
+
|
27
|
+
case 3:
|
28
|
+
case "end":
|
29
|
+
return _context.stop();
|
32
30
|
}
|
33
31
|
}, _callee);
|
34
32
|
}));
|
@@ -50,21 +48,19 @@ export var queryById = /*#__PURE__*/function () {
|
|
50
48
|
export var deleteById = /*#__PURE__*/function () {
|
51
49
|
var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2(id) {
|
52
50
|
return _regeneratorRuntime.wrap(function _callee2$(_context2) {
|
53
|
-
while (1) {
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
return _context2.stop();
|
67
|
-
}
|
51
|
+
while (1) switch (_context2.prev = _context2.next) {
|
52
|
+
case 0:
|
53
|
+
_context2.next = 2;
|
54
|
+
return request.post('/cmdb/v1/api/ci/deleteById', {
|
55
|
+
id: id
|
56
|
+
});
|
57
|
+
|
58
|
+
case 2:
|
59
|
+
return _context2.abrupt("return", _context2.sent);
|
60
|
+
|
61
|
+
case 3:
|
62
|
+
case "end":
|
63
|
+
return _context2.stop();
|
68
64
|
}
|
69
65
|
}, _callee2);
|
70
66
|
}));
|
@@ -87,29 +83,27 @@ export var batchDeleteById = /*#__PURE__*/function () {
|
|
87
83
|
var _ref3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee3(keys) {
|
88
84
|
var ids;
|
89
85
|
return _regeneratorRuntime.wrap(function _callee3$(_context3) {
|
90
|
-
while (1) {
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
86
|
+
while (1) switch (_context3.prev = _context3.next) {
|
87
|
+
case 0:
|
88
|
+
if (keys === void 0) {
|
89
|
+
keys = [];
|
90
|
+
}
|
91
|
+
|
92
|
+
// TODO 替换为map
|
93
|
+
ids = keys.map(function (key) {
|
94
|
+
return {
|
95
|
+
id: key
|
96
|
+
};
|
97
|
+
});
|
98
|
+
_context3.next = 4;
|
99
|
+
return request.post('/cmdb/v1/api/ci/batchDeleteById', ids);
|
96
100
|
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
_context3.next = 4;
|
104
|
-
return request.post('/cmdb/v1/api/ci/batchDeleteById', ids);
|
105
|
-
|
106
|
-
case 4:
|
107
|
-
return _context3.abrupt("return", _context3.sent);
|
108
|
-
|
109
|
-
case 5:
|
110
|
-
case "end":
|
111
|
-
return _context3.stop();
|
112
|
-
}
|
101
|
+
case 4:
|
102
|
+
return _context3.abrupt("return", _context3.sent);
|
103
|
+
|
104
|
+
case 5:
|
105
|
+
case "end":
|
106
|
+
return _context3.stop();
|
113
107
|
}
|
114
108
|
}, _callee3);
|
115
109
|
}));
|
@@ -140,83 +134,81 @@ export var fetchCommonQuery = /*#__PURE__*/function () {
|
|
140
134
|
var newCondition, _ref5, _ref5$checkAuth, checkAuth, otherOption, url, sorts, params, response, _ref6, totalPage, pageIndex, data, result;
|
141
135
|
|
142
136
|
return _regeneratorRuntime.wrap(function _callee4$(_context4) {
|
143
|
-
while (1) {
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
|
157
|
-
|
158
|
-
|
159
|
-
|
160
|
-
|
161
|
-
|
162
|
-
|
163
|
-
}
|
164
|
-
|
165
|
-
return param;
|
166
|
-
}, []).join(' && ');
|
167
|
-
}
|
168
|
-
|
169
|
-
_ref5 = authOption || {}, _ref5$checkAuth = _ref5.checkAuth, checkAuth = _ref5$checkAuth === void 0 ? true : _ref5$checkAuth, otherOption = _objectWithoutPropertiesLoose(_ref5, _excluded); // const url = checkAuth
|
170
|
-
// ? '/appserver/api/v1/cmdb/ci/commonQuery'
|
171
|
-
// : '/api/v1/cmdb/ci/commonQuery';
|
172
|
-
// const url ='/api/v1/cmdb/ci/commonQuery';
|
173
|
-
// let params = {
|
174
|
-
// condition: condition.conditions
|
175
|
-
// ? `${newCondition} && ${condition.conditions}`
|
176
|
-
// : newCondition,
|
177
|
-
// sort: sort || `${sortIndex} ${sortMethod}`,
|
178
|
-
// currentPage,
|
179
|
-
// pageSize,
|
180
|
-
// };
|
181
|
-
// APPBIR MVP
|
182
|
-
// ------------------------------------------------
|
183
|
-
// TODO important 带确认权限接口是否可通 ---
|
184
|
-
|
185
|
-
url = checkAuth ? '/mdc/v1/api/cmdb/authority/commonQueryCiData' : '/mdc/v1/api/cmdb/commonQueryCiData';
|
186
|
-
sorts = sort ? sort.split(" ") : [sortIndex, sortMethod];
|
187
|
-
params = {
|
188
|
-
condition: condition.conditions ? newCondition + " && " + condition.conditions : newCondition,
|
189
|
-
// APPBIR MVP 临时去掉排序 等接口OK
|
190
|
-
// orders: [{
|
191
|
-
// name: sorts[0],
|
192
|
-
// type: sorts[1]
|
193
|
-
// }],
|
194
|
-
pageIndex: currentPage,
|
195
|
-
pageSize: pageSize
|
196
|
-
};
|
197
|
-
|
198
|
-
if (checkAuth && otherOption) {
|
199
|
-
params = _extends({}, params, otherOption);
|
200
|
-
} // 处理 返回结果
|
201
|
-
|
202
|
-
|
203
|
-
_context4.next = 9;
|
204
|
-
return request.post(url, params);
|
205
|
-
|
206
|
-
case 9:
|
207
|
-
response = _context4.sent;
|
208
|
-
// TODO ---
|
209
|
-
_ref6 = response || {}, totalPage = _ref6.totalPage, pageIndex = _ref6.pageIndex, data = _ref6.data, result = _objectWithoutPropertiesLoose(_ref6, _excluded2);
|
210
|
-
return _context4.abrupt("return", _extends({}, result, {
|
211
|
-
total: totalPage,
|
212
|
-
page: pageIndex,
|
213
|
-
content: data
|
214
|
-
}));
|
137
|
+
while (1) switch (_context4.prev = _context4.next) {
|
138
|
+
case 0:
|
139
|
+
newCondition = condition;
|
140
|
+
|
141
|
+
if (typeof newCondition !== 'string') {
|
142
|
+
newCondition = Object.keys(newCondition).reduce(function (param, current) {
|
143
|
+
if (current === 'ciType') {
|
144
|
+
param.push("type(" + (Array.isArray(newCondition[current]) ? newCondition[current].map(function (item) {
|
145
|
+
return "'" + item + "'";
|
146
|
+
}).toString() : "'" + newCondition[current] + "'") + ")");
|
147
|
+
} else if (current === 'principal') {
|
148
|
+
param.push(newCondition[current]);
|
149
|
+
} else if (current === 'searchValue' && newCondition.searchValue && newCondition.searchIndexArray) {
|
150
|
+
param.push("contain('" + newCondition.searchValue + "'," + newCondition.searchIndexArray.toString() + ")");
|
151
|
+
} else if (current === 'alert') {
|
152
|
+
var alert = Object.keys(newCondition[current]).map(function (item) {
|
153
|
+
return item + " = " + newCondition[current][item];
|
154
|
+
}).join(' && ');
|
155
|
+
param.push("alert(" + alert + ")");
|
156
|
+
}
|
215
157
|
|
216
|
-
|
217
|
-
|
218
|
-
|
219
|
-
|
158
|
+
return param;
|
159
|
+
}, []).join(' && ');
|
160
|
+
}
|
161
|
+
|
162
|
+
_ref5 = authOption || {}, _ref5$checkAuth = _ref5.checkAuth, checkAuth = _ref5$checkAuth === void 0 ? true : _ref5$checkAuth, otherOption = _objectWithoutPropertiesLoose(_ref5, _excluded); // const url = checkAuth
|
163
|
+
// ? '/appserver/api/v1/cmdb/ci/commonQuery'
|
164
|
+
// : '/api/v1/cmdb/ci/commonQuery';
|
165
|
+
// const url ='/api/v1/cmdb/ci/commonQuery';
|
166
|
+
// let params = {
|
167
|
+
// condition: condition.conditions
|
168
|
+
// ? `${newCondition} && ${condition.conditions}`
|
169
|
+
// : newCondition,
|
170
|
+
// sort: sort || `${sortIndex} ${sortMethod}`,
|
171
|
+
// currentPage,
|
172
|
+
// pageSize,
|
173
|
+
// };
|
174
|
+
// APPBIR MVP
|
175
|
+
// ------------------------------------------------
|
176
|
+
// TODO important 带确认权限接口是否可通 ---
|
177
|
+
|
178
|
+
url = checkAuth ? '/mdc/v1/api/cmdb/authority/commonQueryCiData' : '/mdc/v1/api/cmdb/commonQueryCiData';
|
179
|
+
sorts = sort ? sort.split(" ") : [sortIndex, sortMethod];
|
180
|
+
params = {
|
181
|
+
condition: condition.conditions ? newCondition + " && " + condition.conditions : newCondition,
|
182
|
+
// APPBIR MVP 临时去掉排序 等接口OK
|
183
|
+
// orders: [{
|
184
|
+
// name: sorts[0],
|
185
|
+
// type: sorts[1]
|
186
|
+
// }],
|
187
|
+
pageIndex: currentPage,
|
188
|
+
pageSize: pageSize
|
189
|
+
};
|
190
|
+
|
191
|
+
if (checkAuth && otherOption) {
|
192
|
+
params = _extends({}, params, otherOption);
|
193
|
+
} // 处理 返回结果
|
194
|
+
|
195
|
+
|
196
|
+
_context4.next = 9;
|
197
|
+
return request.post(url, params);
|
198
|
+
|
199
|
+
case 9:
|
200
|
+
response = _context4.sent;
|
201
|
+
// TODO ---
|
202
|
+
_ref6 = response || {}, totalPage = _ref6.totalPage, pageIndex = _ref6.pageIndex, data = _ref6.data, result = _objectWithoutPropertiesLoose(_ref6, _excluded2);
|
203
|
+
return _context4.abrupt("return", _extends({}, result, {
|
204
|
+
total: totalPage,
|
205
|
+
page: pageIndex,
|
206
|
+
content: data
|
207
|
+
}));
|
208
|
+
|
209
|
+
case 12:
|
210
|
+
case "end":
|
211
|
+
return _context4.stop();
|
220
212
|
}
|
221
213
|
}, _callee4);
|
222
214
|
}));
|
@@ -238,19 +230,17 @@ export function commonQuery(_x11) {
|
|
238
230
|
function _commonQuery() {
|
239
231
|
_commonQuery = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee18(param) {
|
240
232
|
return _regeneratorRuntime.wrap(function _callee18$(_context18) {
|
241
|
-
while (1) {
|
242
|
-
|
243
|
-
|
244
|
-
|
245
|
-
|
246
|
-
|
247
|
-
|
248
|
-
|
249
|
-
|
250
|
-
|
251
|
-
|
252
|
-
return _context18.stop();
|
253
|
-
}
|
233
|
+
while (1) switch (_context18.prev = _context18.next) {
|
234
|
+
case 0:
|
235
|
+
_context18.next = 2;
|
236
|
+
return request.post('/cmdb/v1/api/ci/commonQuery', param);
|
237
|
+
|
238
|
+
case 2:
|
239
|
+
return _context18.abrupt("return", _context18.sent);
|
240
|
+
|
241
|
+
case 3:
|
242
|
+
case "end":
|
243
|
+
return _context18.stop();
|
254
244
|
}
|
255
245
|
}, _callee18);
|
256
246
|
}));
|
@@ -262,54 +252,52 @@ export var batchUpdateAttributes = /*#__PURE__*/function () {
|
|
262
252
|
var aa, _aa;
|
263
253
|
|
264
254
|
return _regeneratorRuntime.wrap(function _callee5$(_context5) {
|
265
|
-
while (1) {
|
266
|
-
|
267
|
-
|
268
|
-
|
269
|
-
|
270
|
-
|
271
|
-
|
272
|
-
|
273
|
-
|
274
|
-
|
275
|
-
|
276
|
-
|
277
|
-
|
278
|
-
|
279
|
-
|
280
|
-
|
281
|
-
|
282
|
-
|
283
|
-
|
284
|
-
|
285
|
-
|
286
|
-
|
287
|
-
|
288
|
-
|
289
|
-
|
290
|
-
|
291
|
-
|
292
|
-
|
293
|
-
|
294
|
-
|
295
|
-
|
296
|
-
|
297
|
-
|
298
|
-
|
299
|
-
|
300
|
-
|
301
|
-
|
302
|
-
|
303
|
-
|
304
|
-
|
305
|
-
|
306
|
-
|
307
|
-
|
308
|
-
|
309
|
-
|
310
|
-
|
311
|
-
return _context5.stop();
|
312
|
-
}
|
255
|
+
while (1) switch (_context5.prev = _context5.next) {
|
256
|
+
case 0:
|
257
|
+
if (!fieldName) {
|
258
|
+
_context5.next = 8;
|
259
|
+
break;
|
260
|
+
}
|
261
|
+
|
262
|
+
// 传了要更新的属性名,更新某一个属性
|
263
|
+
aa = {};
|
264
|
+
aa[fieldName] = values[fieldName];
|
265
|
+
_context5.next = 5;
|
266
|
+
return request.post('/cmdb/v1/api/ci/batchUpdateAttributes', [{
|
267
|
+
id: values.id,
|
268
|
+
attributes: aa
|
269
|
+
}]);
|
270
|
+
|
271
|
+
case 5:
|
272
|
+
return _context5.abrupt("return", _context5.sent);
|
273
|
+
|
274
|
+
case 8:
|
275
|
+
if (!Array.isArray(values)) {
|
276
|
+
_context5.next = 12;
|
277
|
+
break;
|
278
|
+
}
|
279
|
+
|
280
|
+
_context5.next = 11;
|
281
|
+
return request.post('/cmdb/v1/api/ci/batchUpdateAttributes', values);
|
282
|
+
|
283
|
+
case 11:
|
284
|
+
return _context5.abrupt("return", _context5.sent);
|
285
|
+
|
286
|
+
case 12:
|
287
|
+
_aa = values.id;
|
288
|
+
delete values.id;
|
289
|
+
_context5.next = 16;
|
290
|
+
return request.post('/cmdb/v1/api/ci/batchUpdateAttributes', [{
|
291
|
+
id: _aa,
|
292
|
+
attributes: values
|
293
|
+
}]);
|
294
|
+
|
295
|
+
case 16:
|
296
|
+
return _context5.abrupt("return", _context5.sent);
|
297
|
+
|
298
|
+
case 17:
|
299
|
+
case "end":
|
300
|
+
return _context5.stop();
|
313
301
|
}
|
314
302
|
}, _callee5);
|
315
303
|
}));
|
@@ -322,19 +310,17 @@ export var batchUpdateAttributes = /*#__PURE__*/function () {
|
|
322
310
|
export var createInstance = /*#__PURE__*/function () {
|
323
311
|
var _ref8 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee6(values) {
|
324
312
|
return _regeneratorRuntime.wrap(function _callee6$(_context6) {
|
325
|
-
while (1) {
|
326
|
-
|
327
|
-
|
328
|
-
|
329
|
-
|
330
|
-
|
331
|
-
|
332
|
-
|
333
|
-
|
334
|
-
|
335
|
-
|
336
|
-
return _context6.stop();
|
337
|
-
}
|
313
|
+
while (1) switch (_context6.prev = _context6.next) {
|
314
|
+
case 0:
|
315
|
+
_context6.next = 2;
|
316
|
+
return request.post('/cmdb/v1/api/ci/create', values);
|
317
|
+
|
318
|
+
case 2:
|
319
|
+
return _context6.abrupt("return", _context6.sent);
|
320
|
+
|
321
|
+
case 3:
|
322
|
+
case "end":
|
323
|
+
return _context6.stop();
|
338
324
|
}
|
339
325
|
}, _callee6);
|
340
326
|
}));
|
@@ -361,19 +347,17 @@ export function changeManageStatus(_x15) {
|
|
361
347
|
function _changeManageStatus() {
|
362
348
|
_changeManageStatus = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee19(param) {
|
363
349
|
return _regeneratorRuntime.wrap(function _callee19$(_context19) {
|
364
|
-
while (1) {
|
365
|
-
|
366
|
-
|
367
|
-
|
368
|
-
|
369
|
-
|
370
|
-
|
371
|
-
|
372
|
-
|
373
|
-
|
374
|
-
|
375
|
-
return _context19.stop();
|
376
|
-
}
|
350
|
+
while (1) switch (_context19.prev = _context19.next) {
|
351
|
+
case 0:
|
352
|
+
_context19.next = 2;
|
353
|
+
return request.post('/cmdb/v1/api/ci/changeManageStatus', param);
|
354
|
+
|
355
|
+
case 2:
|
356
|
+
return _context19.abrupt("return", _context19.sent);
|
357
|
+
|
358
|
+
case 3:
|
359
|
+
case "end":
|
360
|
+
return _context19.stop();
|
377
361
|
}
|
378
362
|
}, _callee19);
|
379
363
|
}));
|
@@ -396,19 +380,17 @@ export function batchChangeManageStatus(_x16) {
|
|
396
380
|
function _batchChangeManageStatus() {
|
397
381
|
_batchChangeManageStatus = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee20(param) {
|
398
382
|
return _regeneratorRuntime.wrap(function _callee20$(_context20) {
|
399
|
-
while (1) {
|
400
|
-
|
401
|
-
|
402
|
-
|
403
|
-
|
404
|
-
|
405
|
-
|
406
|
-
|
407
|
-
|
408
|
-
|
409
|
-
|
410
|
-
return _context20.stop();
|
411
|
-
}
|
383
|
+
while (1) switch (_context20.prev = _context20.next) {
|
384
|
+
case 0:
|
385
|
+
_context20.next = 2;
|
386
|
+
return request.post('/cmdb/v1/api/ci/batchChangeManageStatus', param);
|
387
|
+
|
388
|
+
case 2:
|
389
|
+
return _context20.abrupt("return", _context20.sent);
|
390
|
+
|
391
|
+
case 3:
|
392
|
+
case "end":
|
393
|
+
return _context20.stop();
|
412
394
|
}
|
413
395
|
}, _callee20);
|
414
396
|
}));
|
@@ -427,19 +409,17 @@ export function commonCount(_x17) {
|
|
427
409
|
function _commonCount() {
|
428
410
|
_commonCount = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee21(param) {
|
429
411
|
return _regeneratorRuntime.wrap(function _callee21$(_context21) {
|
430
|
-
while (1) {
|
431
|
-
|
432
|
-
|
433
|
-
|
434
|
-
|
435
|
-
|
436
|
-
|
437
|
-
|
438
|
-
|
439
|
-
|
440
|
-
|
441
|
-
return _context21.stop();
|
442
|
-
}
|
412
|
+
while (1) switch (_context21.prev = _context21.next) {
|
413
|
+
case 0:
|
414
|
+
_context21.next = 2;
|
415
|
+
return request.post('/cmdb/v1/api/ci/commonCount', param);
|
416
|
+
|
417
|
+
case 2:
|
418
|
+
return _context21.abrupt("return", _context21.sent);
|
419
|
+
|
420
|
+
case 3:
|
421
|
+
case "end":
|
422
|
+
return _context21.stop();
|
443
423
|
}
|
444
424
|
}, _callee21);
|
445
425
|
}));
|
@@ -461,19 +441,17 @@ export function queryCiWithComponents(_x18) {
|
|
461
441
|
function _queryCiWithComponents() {
|
462
442
|
_queryCiWithComponents = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee22(mainCiIds) {
|
463
443
|
return _regeneratorRuntime.wrap(function _callee22$(_context22) {
|
464
|
-
while (1) {
|
465
|
-
|
466
|
-
|
467
|
-
|
468
|
-
|
469
|
-
|
470
|
-
|
471
|
-
|
472
|
-
|
473
|
-
|
474
|
-
|
475
|
-
return _context22.stop();
|
476
|
-
}
|
444
|
+
while (1) switch (_context22.prev = _context22.next) {
|
445
|
+
case 0:
|
446
|
+
_context22.next = 2;
|
447
|
+
return request.post('/cmdb/v1/api/ci/queryCiWithComponents', mainCiIds);
|
448
|
+
|
449
|
+
case 2:
|
450
|
+
return _context22.abrupt("return", _context22.sent);
|
451
|
+
|
452
|
+
case 3:
|
453
|
+
case "end":
|
454
|
+
return _context22.stop();
|
477
455
|
}
|
478
456
|
}, _callee22);
|
479
457
|
}));
|
@@ -491,27 +469,25 @@ export function queryPageIgnoreRelations(_x19, _x20, _x21, _x22, _x23) {
|
|
491
469
|
function _queryPageIgnoreRelations() {
|
492
470
|
_queryPageIgnoreRelations = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee23(relationType, currentPage, pageSize, condition, sort) {
|
493
471
|
return _regeneratorRuntime.wrap(function _callee23$(_context23) {
|
494
|
-
while (1) {
|
495
|
-
|
496
|
-
|
497
|
-
|
498
|
-
|
499
|
-
|
500
|
-
|
501
|
-
|
502
|
-
|
503
|
-
|
504
|
-
|
505
|
-
|
506
|
-
|
507
|
-
|
508
|
-
|
509
|
-
|
510
|
-
|
511
|
-
|
512
|
-
|
513
|
-
return _context23.stop();
|
514
|
-
}
|
472
|
+
while (1) switch (_context23.prev = _context23.next) {
|
473
|
+
case 0:
|
474
|
+
_context23.next = 2;
|
475
|
+
return request.post('/cmdb/v1/api/relation/ignore/list', _extends({
|
476
|
+
relationType: relationType,
|
477
|
+
currentPage: currentPage,
|
478
|
+
pageSize: pageSize
|
479
|
+
}, condition ? {
|
480
|
+
condition: condition
|
481
|
+
} : {}, sort ? {
|
482
|
+
sort: sort
|
483
|
+
} : {}));
|
484
|
+
|
485
|
+
case 2:
|
486
|
+
return _context23.abrupt("return", _context23.sent);
|
487
|
+
|
488
|
+
case 3:
|
489
|
+
case "end":
|
490
|
+
return _context23.stop();
|
515
491
|
}
|
516
492
|
}, _callee23);
|
517
493
|
}));
|
@@ -525,23 +501,21 @@ export function deleteIgnoreRelations(_x24) {
|
|
525
501
|
function _deleteIgnoreRelations() {
|
526
502
|
_deleteIgnoreRelations = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee24(ids) {
|
527
503
|
return _regeneratorRuntime.wrap(function _callee24$(_context24) {
|
528
|
-
while (1) {
|
529
|
-
|
530
|
-
|
531
|
-
|
532
|
-
return
|
533
|
-
|
534
|
-
|
535
|
-
|
536
|
-
|
537
|
-
|
538
|
-
|
539
|
-
|
540
|
-
|
541
|
-
|
542
|
-
|
543
|
-
return _context24.stop();
|
544
|
-
}
|
504
|
+
while (1) switch (_context24.prev = _context24.next) {
|
505
|
+
case 0:
|
506
|
+
_context24.next = 2;
|
507
|
+
return request.post('/cmdb/v1/api/relation/ignore/batchDeleteById', ids.map(function (id) {
|
508
|
+
return {
|
509
|
+
id: id
|
510
|
+
};
|
511
|
+
}));
|
512
|
+
|
513
|
+
case 2:
|
514
|
+
return _context24.abrupt("return", _context24.sent);
|
515
|
+
|
516
|
+
case 3:
|
517
|
+
case "end":
|
518
|
+
return _context24.stop();
|
545
519
|
}
|
546
520
|
}, _callee24);
|
547
521
|
}));
|
@@ -552,38 +526,36 @@ export var uploadFile = /*#__PURE__*/function () {
|
|
552
526
|
var _ref9 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee7(files, userId, modelType) {
|
553
527
|
var formData, names, originFiles, config, result;
|
554
528
|
return _regeneratorRuntime.wrap(function _callee7$(_context7) {
|
555
|
-
while (1) {
|
556
|
-
|
557
|
-
|
558
|
-
|
559
|
-
|
560
|
-
|
561
|
-
|
562
|
-
|
563
|
-
|
564
|
-
|
565
|
-
|
566
|
-
|
567
|
-
|
568
|
-
|
569
|
-
|
570
|
-
|
571
|
-
|
572
|
-
|
573
|
-
|
574
|
-
|
575
|
-
|
576
|
-
|
577
|
-
return request.post('/cmdb/v1/api/import', formData, config);
|
529
|
+
while (1) switch (_context7.prev = _context7.next) {
|
530
|
+
case 0:
|
531
|
+
formData = new FormData(); // 用户id
|
532
|
+
|
533
|
+
formData.append('userId', userId);
|
534
|
+
modelType && formData.append('modelType', modelType);
|
535
|
+
names = [];
|
536
|
+
originFiles = [];
|
537
|
+
files.forEach(function (_ref10) {
|
538
|
+
var name = _ref10.name,
|
539
|
+
originFileObj = _ref10.originFileObj;
|
540
|
+
names.push(name);
|
541
|
+
originFiles.push(originFileObj);
|
542
|
+
formData.append('files', originFileObj, name);
|
543
|
+
});
|
544
|
+
config = {
|
545
|
+
headers: {
|
546
|
+
'Content-Type': "multipart/form-data;boundary=" + new Date().getTime()
|
547
|
+
}
|
548
|
+
};
|
549
|
+
_context7.next = 9;
|
550
|
+
return request.post('/cmdb/v1/api/import', formData, config);
|
578
551
|
|
579
|
-
|
580
|
-
|
581
|
-
|
552
|
+
case 9:
|
553
|
+
result = _context7.sent;
|
554
|
+
return _context7.abrupt("return", result);
|
582
555
|
|
583
|
-
|
584
|
-
|
585
|
-
|
586
|
-
}
|
556
|
+
case 11:
|
557
|
+
case "end":
|
558
|
+
return _context7.stop();
|
587
559
|
}
|
588
560
|
}, _callee7);
|
589
561
|
}));
|
@@ -597,23 +569,21 @@ export var closeRecord = /*#__PURE__*/function () {
|
|
597
569
|
var _ref11 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee8(userId, modelType) {
|
598
570
|
var result;
|
599
571
|
return _regeneratorRuntime.wrap(function _callee8$(_context8) {
|
600
|
-
while (1) {
|
601
|
-
|
602
|
-
|
603
|
-
|
604
|
-
|
605
|
-
|
606
|
-
|
607
|
-
|
608
|
-
|
609
|
-
|
610
|
-
|
611
|
-
|
612
|
-
|
613
|
-
|
614
|
-
|
615
|
-
return _context8.stop();
|
616
|
-
}
|
572
|
+
while (1) switch (_context8.prev = _context8.next) {
|
573
|
+
case 0:
|
574
|
+
_context8.next = 2;
|
575
|
+
return request.post('/cmdb/v1/api/delete/import/record', {
|
576
|
+
userId: userId,
|
577
|
+
modelType: modelType
|
578
|
+
});
|
579
|
+
|
580
|
+
case 2:
|
581
|
+
result = _context8.sent;
|
582
|
+
return _context8.abrupt("return", result);
|
583
|
+
|
584
|
+
case 4:
|
585
|
+
case "end":
|
586
|
+
return _context8.stop();
|
617
587
|
}
|
618
588
|
}, _callee8);
|
619
589
|
}));
|
@@ -626,22 +596,20 @@ export var closeRecord = /*#__PURE__*/function () {
|
|
626
596
|
export var getRecord = /*#__PURE__*/function () {
|
627
597
|
var _ref12 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee9(userId, modelType) {
|
628
598
|
return _regeneratorRuntime.wrap(function _callee9$(_context9) {
|
629
|
-
while (1) {
|
630
|
-
|
631
|
-
|
632
|
-
|
633
|
-
|
634
|
-
|
635
|
-
|
636
|
-
|
637
|
-
|
638
|
-
|
639
|
-
|
640
|
-
|
641
|
-
|
642
|
-
|
643
|
-
return _context9.stop();
|
644
|
-
}
|
599
|
+
while (1) switch (_context9.prev = _context9.next) {
|
600
|
+
case 0:
|
601
|
+
_context9.next = 2;
|
602
|
+
return request.post('/cmdb/v1/api/get/import/record', {
|
603
|
+
userId: userId,
|
604
|
+
modelType: modelType
|
605
|
+
});
|
606
|
+
|
607
|
+
case 2:
|
608
|
+
return _context9.abrupt("return", _context9.sent);
|
609
|
+
|
610
|
+
case 3:
|
611
|
+
case "end":
|
612
|
+
return _context9.stop();
|
645
613
|
}
|
646
614
|
}, _callee9);
|
647
615
|
}));
|
@@ -659,19 +627,17 @@ export var getRecord = /*#__PURE__*/function () {
|
|
659
627
|
export var batchCreateRelation = /*#__PURE__*/function () {
|
660
628
|
var _ref13 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee10(params) {
|
661
629
|
return _regeneratorRuntime.wrap(function _callee10$(_context10) {
|
662
|
-
while (1) {
|
663
|
-
|
664
|
-
|
665
|
-
|
666
|
-
|
667
|
-
|
668
|
-
|
669
|
-
|
670
|
-
|
671
|
-
|
672
|
-
|
673
|
-
return _context10.stop();
|
674
|
-
}
|
630
|
+
while (1) switch (_context10.prev = _context10.next) {
|
631
|
+
case 0:
|
632
|
+
_context10.next = 2;
|
633
|
+
return request.post('/cmdb/v1/api/relation/batchCreate', params);
|
634
|
+
|
635
|
+
case 2:
|
636
|
+
return _context10.abrupt("return", _context10.sent);
|
637
|
+
|
638
|
+
case 3:
|
639
|
+
case "end":
|
640
|
+
return _context10.stop();
|
675
641
|
}
|
676
642
|
}, _callee10);
|
677
643
|
}));
|
@@ -683,21 +649,19 @@ export var batchCreateRelation = /*#__PURE__*/function () {
|
|
683
649
|
export var queryRelationByEndpoint = /*#__PURE__*/function () {
|
684
650
|
var _ref14 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee11(id) {
|
685
651
|
return _regeneratorRuntime.wrap(function _callee11$(_context11) {
|
686
|
-
while (1) {
|
687
|
-
|
688
|
-
|
689
|
-
|
690
|
-
|
691
|
-
|
692
|
-
|
693
|
-
|
694
|
-
|
695
|
-
|
696
|
-
|
697
|
-
|
698
|
-
|
699
|
-
return _context11.stop();
|
700
|
-
}
|
652
|
+
while (1) switch (_context11.prev = _context11.next) {
|
653
|
+
case 0:
|
654
|
+
_context11.next = 2;
|
655
|
+
return request.post('/cmdb/v1/api/relation/queryByEndpoint', {
|
656
|
+
id: id
|
657
|
+
});
|
658
|
+
|
659
|
+
case 2:
|
660
|
+
return _context11.abrupt("return", _context11.sent);
|
661
|
+
|
662
|
+
case 3:
|
663
|
+
case "end":
|
664
|
+
return _context11.stop();
|
701
665
|
}
|
702
666
|
}, _callee11);
|
703
667
|
}));
|
@@ -715,19 +679,17 @@ export var queryRelationByEndpoint = /*#__PURE__*/function () {
|
|
715
679
|
export var batchUpdateRelation = /*#__PURE__*/function () {
|
716
680
|
var _ref15 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee12(params) {
|
717
681
|
return _regeneratorRuntime.wrap(function _callee12$(_context12) {
|
718
|
-
while (1) {
|
719
|
-
|
720
|
-
|
721
|
-
|
722
|
-
|
723
|
-
|
724
|
-
|
725
|
-
|
726
|
-
|
727
|
-
|
728
|
-
|
729
|
-
return _context12.stop();
|
730
|
-
}
|
682
|
+
while (1) switch (_context12.prev = _context12.next) {
|
683
|
+
case 0:
|
684
|
+
_context12.next = 2;
|
685
|
+
return request.post('/cmdb/v1/api/relation/batchUpdateAttributes', params);
|
686
|
+
|
687
|
+
case 2:
|
688
|
+
return _context12.abrupt("return", _context12.sent);
|
689
|
+
|
690
|
+
case 3:
|
691
|
+
case "end":
|
692
|
+
return _context12.stop();
|
731
693
|
}
|
732
694
|
}, _callee12);
|
733
695
|
}));
|
@@ -745,21 +707,19 @@ export var batchUpdateRelation = /*#__PURE__*/function () {
|
|
745
707
|
export var deleteRelation = /*#__PURE__*/function () {
|
746
708
|
var _ref16 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee13(id) {
|
747
709
|
return _regeneratorRuntime.wrap(function _callee13$(_context13) {
|
748
|
-
while (1) {
|
749
|
-
|
750
|
-
|
751
|
-
|
752
|
-
|
753
|
-
|
754
|
-
|
755
|
-
|
756
|
-
|
757
|
-
|
758
|
-
|
759
|
-
|
760
|
-
|
761
|
-
return _context13.stop();
|
762
|
-
}
|
710
|
+
while (1) switch (_context13.prev = _context13.next) {
|
711
|
+
case 0:
|
712
|
+
_context13.next = 2;
|
713
|
+
return request.post('/cmdb/v1/api/relation/delete', {
|
714
|
+
id: id
|
715
|
+
});
|
716
|
+
|
717
|
+
case 2:
|
718
|
+
return _context13.abrupt("return", _context13.sent);
|
719
|
+
|
720
|
+
case 3:
|
721
|
+
case "end":
|
722
|
+
return _context13.stop();
|
763
723
|
}
|
764
724
|
}, _callee13);
|
765
725
|
}));
|
@@ -777,19 +737,17 @@ export var deleteRelation = /*#__PURE__*/function () {
|
|
777
737
|
export var batchDeleteRelation = /*#__PURE__*/function () {
|
778
738
|
var _ref17 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee14(params) {
|
779
739
|
return _regeneratorRuntime.wrap(function _callee14$(_context14) {
|
780
|
-
while (1) {
|
781
|
-
|
782
|
-
|
783
|
-
|
784
|
-
|
785
|
-
|
786
|
-
|
787
|
-
|
788
|
-
|
789
|
-
|
790
|
-
|
791
|
-
return _context14.stop();
|
792
|
-
}
|
740
|
+
while (1) switch (_context14.prev = _context14.next) {
|
741
|
+
case 0:
|
742
|
+
_context14.next = 2;
|
743
|
+
return request.post('/cmdb/v1/api/relation/batchDelete', params);
|
744
|
+
|
745
|
+
case 2:
|
746
|
+
return _context14.abrupt("return", _context14.sent);
|
747
|
+
|
748
|
+
case 3:
|
749
|
+
case "end":
|
750
|
+
return _context14.stop();
|
793
751
|
}
|
794
752
|
}, _callee14);
|
795
753
|
}));
|
@@ -807,22 +765,20 @@ export var batchDeleteRelation = /*#__PURE__*/function () {
|
|
807
765
|
export var forceDeleteRelation = /*#__PURE__*/function () {
|
808
766
|
var _ref18 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee15(id) {
|
809
767
|
return _regeneratorRuntime.wrap(function _callee15$(_context15) {
|
810
|
-
while (1) {
|
811
|
-
|
812
|
-
|
813
|
-
|
814
|
-
|
815
|
-
|
816
|
-
|
817
|
-
|
818
|
-
|
819
|
-
|
820
|
-
|
821
|
-
|
822
|
-
|
823
|
-
|
824
|
-
return _context15.stop();
|
825
|
-
}
|
768
|
+
while (1) switch (_context15.prev = _context15.next) {
|
769
|
+
case 0:
|
770
|
+
_context15.next = 2;
|
771
|
+
return batchDeleteRelation([{
|
772
|
+
id: id,
|
773
|
+
force: true
|
774
|
+
}]);
|
775
|
+
|
776
|
+
case 2:
|
777
|
+
return _context15.abrupt("return", _context15.sent);
|
778
|
+
|
779
|
+
case 3:
|
780
|
+
case "end":
|
781
|
+
return _context15.stop();
|
826
782
|
}
|
827
783
|
}, _callee15);
|
828
784
|
}));
|
@@ -840,19 +796,17 @@ export var forceDeleteRelation = /*#__PURE__*/function () {
|
|
840
796
|
export var batchQueryRelationById = /*#__PURE__*/function () {
|
841
797
|
var _ref19 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee16(params) {
|
842
798
|
return _regeneratorRuntime.wrap(function _callee16$(_context16) {
|
843
|
-
while (1) {
|
844
|
-
|
845
|
-
|
846
|
-
|
847
|
-
|
848
|
-
|
849
|
-
|
850
|
-
|
851
|
-
|
852
|
-
|
853
|
-
|
854
|
-
return _context16.stop();
|
855
|
-
}
|
799
|
+
while (1) switch (_context16.prev = _context16.next) {
|
800
|
+
case 0:
|
801
|
+
_context16.next = 2;
|
802
|
+
return request.post('/cmdb/v1/api/relation/batchQueryById', params);
|
803
|
+
|
804
|
+
case 2:
|
805
|
+
return _context16.abrupt("return", _context16.sent);
|
806
|
+
|
807
|
+
case 3:
|
808
|
+
case "end":
|
809
|
+
return _context16.stop();
|
856
810
|
}
|
857
811
|
}, _callee16);
|
858
812
|
}));
|
@@ -870,23 +824,21 @@ export var batchQueryRelationById = /*#__PURE__*/function () {
|
|
870
824
|
export var queryRelationByIds = /*#__PURE__*/function () {
|
871
825
|
var _ref20 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee17(ids) {
|
872
826
|
return _regeneratorRuntime.wrap(function _callee17$(_context17) {
|
873
|
-
while (1) {
|
874
|
-
|
875
|
-
|
876
|
-
|
877
|
-
return
|
878
|
-
|
879
|
-
|
880
|
-
|
881
|
-
|
882
|
-
|
883
|
-
|
884
|
-
|
885
|
-
|
886
|
-
|
887
|
-
|
888
|
-
return _context17.stop();
|
889
|
-
}
|
827
|
+
while (1) switch (_context17.prev = _context17.next) {
|
828
|
+
case 0:
|
829
|
+
_context17.next = 2;
|
830
|
+
return batchQueryRelationById(ids.map(function (id) {
|
831
|
+
return {
|
832
|
+
id: id
|
833
|
+
};
|
834
|
+
}));
|
835
|
+
|
836
|
+
case 2:
|
837
|
+
return _context17.abrupt("return", _context17.sent);
|
838
|
+
|
839
|
+
case 3:
|
840
|
+
case "end":
|
841
|
+
return _context17.stop();
|
890
842
|
}
|
891
843
|
}, _callee17);
|
892
844
|
}));
|