@next-libs/cmdb-instances 7.30.1 → 7.30.3
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/dist/cjs/instance-detail/InstanceDetail.js +12 -7
- package/dist/cjs/instance-detail/InstanceDetail.js.map +1 -1
- package/dist/cjs/instance-list/InstanceList.js +37 -14
- package/dist/cjs/instance-list/InstanceList.js.map +1 -1
- package/dist/cjs/instance-list-drawer/InstanceListDrawer.js +19 -4
- package/dist/cjs/instance-list-drawer/InstanceListDrawer.js.map +1 -1
- package/dist/cjs/instance-list-table/InstanceListTable.js +3 -3
- package/dist/cjs/instance-list-table/InstanceListTable.js.map +1 -1
- package/dist/esm/instance-detail/InstanceDetail.js +12 -7
- package/dist/esm/instance-detail/InstanceDetail.js.map +1 -1
- package/dist/esm/instance-list/InstanceList.js +37 -15
- package/dist/esm/instance-list/InstanceList.js.map +1 -1
- package/dist/esm/instance-list-drawer/InstanceListDrawer.js +19 -4
- package/dist/esm/instance-list-drawer/InstanceListDrawer.js.map +1 -1
- package/dist/esm/instance-list-table/InstanceListTable.js +3 -3
- package/dist/esm/instance-list-table/InstanceListTable.js.map +1 -1
- package/dist/types/instance-list/InstanceList.d.ts +6 -0
- package/dist/types/instance-list-table/InstanceListTable.d.ts +2 -2
- package/package.json +2 -2
|
@@ -91,7 +91,22 @@ function getQuery(modelData, idObjectMap, q, fields, onlySearchByIp, extraFixedF
|
|
|
91
91
|
});
|
|
92
92
|
});
|
|
93
93
|
});
|
|
94
|
-
}, fields
|
|
94
|
+
}, fields,
|
|
95
|
+
//istanbul ignore next
|
|
96
|
+
relation => {
|
|
97
|
+
var _relation$display_key;
|
|
98
|
+
const relationObject = idObjectMap[relation.relation_object];
|
|
99
|
+
const showKeys = (_relation$display_key = relation.display_keys) !== null && _relation$display_key !== void 0 && _relation$display_key.length ? relation.display_keys : (0, _cmdbUtils.getInstanceNameKeys)(relationObject);
|
|
100
|
+
queryValues.forEach(queryValue => {
|
|
101
|
+
showKeys.forEach(nameKey => {
|
|
102
|
+
query.$or.push({
|
|
103
|
+
[`${relation.relation_id}.${nameKey}`]: {
|
|
104
|
+
$like: `%${queryValue}%`
|
|
105
|
+
}
|
|
106
|
+
});
|
|
107
|
+
});
|
|
108
|
+
});
|
|
109
|
+
});
|
|
95
110
|
return query;
|
|
96
111
|
}
|
|
97
112
|
const isSpecialFn = (query, attrId) => {
|
|
@@ -145,8 +160,8 @@ function translateConditions(aq, idObjectMap, modelData, t) {
|
|
|
145
160
|
const relations = [];
|
|
146
161
|
const transHierRelations = [];
|
|
147
162
|
(_modelData$view = modelData.view) === null || _modelData$view === void 0 ? void 0 : (_modelData$view$trans = _modelData$view.trans_hier_relation_list) === null || _modelData$view$trans === void 0 ? void 0 : _modelData$view$trans.forEach(relation => {
|
|
148
|
-
var _relation$
|
|
149
|
-
const nameKeys = (_relation$
|
|
163
|
+
var _relation$display_key2;
|
|
164
|
+
const nameKeys = (_relation$display_key2 = relation.display_keys) !== null && _relation$display_key2 !== void 0 && _relation$display_key2.length ? relation.display_keys : (0, _cmdbUtils.getInstanceNameKeys)(idObjectMap[relation.relation_object]);
|
|
150
165
|
nameKeys.forEach(nameKey => {
|
|
151
166
|
transHierRelations.push({
|
|
152
167
|
id: `${relation.relation_id}.${nameKey}`,
|
|
@@ -353,6 +368,9 @@ function LegacyInstanceList(props) {
|
|
|
353
368
|
const ignorePermissionProvider = (0, _brickKit.useProvider)("easyops.api.cmdb.instance@PostSearchV3WithAdmin:1.0.0", {
|
|
354
369
|
cache: false
|
|
355
370
|
});
|
|
371
|
+
const searchRelationInstanceProvider = (0, _brickKit.useProvider)("easyops.api.cmdb.instance@SearchRelationInstance:1.1.0", {
|
|
372
|
+
cache: false
|
|
373
|
+
});
|
|
356
374
|
// istanbul ignore next
|
|
357
375
|
|
|
358
376
|
const fieldsProvider = (0, _brickKit.useProvider)("easyops.api.cmdb.instance@GetListDisplayView:1.0.1", {
|
|
@@ -582,7 +600,7 @@ function LegacyInstanceList(props) {
|
|
|
582
600
|
};
|
|
583
601
|
}, [props.objectId, props.externalSourceId]);
|
|
584
602
|
const getInstanceListData = async (sort, asc, page) => {
|
|
585
|
-
var _modelData$attrList2, _modelData$attrList2$, _modelData$attrList2$2, _props$onSearchExecut;
|
|
603
|
+
var _modelData$attrList2, _modelData$attrList2$, _modelData$attrList2$2, _props$onSearchExecut, _props$transHierRelat;
|
|
586
604
|
const data = {};
|
|
587
605
|
const v3Data = {
|
|
588
606
|
fields: processFixedFields ? (0, _lodash.uniq)(["instanceId"].concat(processFixedFields)) : ["instanceId"]
|
|
@@ -702,7 +720,10 @@ function LegacyInstanceList(props) {
|
|
|
702
720
|
return promise ? promise : props.useExternalCmdbApi ? externalPostSearchV3.query([{
|
|
703
721
|
...v3Data,
|
|
704
722
|
...externalRequestParams
|
|
705
|
-
}]) : props.useAutoDiscoveryProvider ? listProvider.query([props.objectId, v3Data]) : props.ignorePermission ? ignorePermissionProvider.query([props.objectId, v3Data]) : (0
|
|
723
|
+
}]) : props.useAutoDiscoveryProvider ? listProvider.query([props.objectId, v3Data]) : props.ignorePermission ? ignorePermissionProvider.query([props.objectId, v3Data]) : props.searchTransHierRelationInstance && (_props$transHierRelat = props.transHierRelation) !== null && _props$transHierRelat !== void 0 && _props$transHierRelat.relation_id && props.searchTransHierRelationSource ? searchRelationInstanceProvider.query([props.searchTransHierRelationSource.objectId, props.transHierRelation.relation_id, props.searchTransHierRelationSource.instanceId, {
|
|
724
|
+
query_relation: v3Data.query,
|
|
725
|
+
...v3Data
|
|
726
|
+
}]) : (0, _cmdbSdk.InstanceApi_postSearchV3)(props.objectId, v3Data); //涉及到v3data的请求
|
|
706
727
|
};
|
|
707
728
|
const refreshInstanceList = async (sort, asc, page) => {
|
|
708
729
|
setState({
|
|
@@ -1562,15 +1583,17 @@ function LegacyInstanceListWrapper(props) {
|
|
|
1562
1583
|
if (transHierRelationSideObjectIds !== null && transHierRelationSideObjectIds !== void 0 && transHierRelationSideObjectIds.length && !transHierRelationSideObjectIds.every(i => objectList.some(o => o.objectId === i))) {
|
|
1563
1584
|
var _list;
|
|
1564
1585
|
let list;
|
|
1565
|
-
|
|
1566
|
-
|
|
1567
|
-
|
|
1568
|
-
|
|
1569
|
-
|
|
1570
|
-
|
|
1571
|
-
|
|
1572
|
-
|
|
1573
|
-
|
|
1586
|
+
try {
|
|
1587
|
+
if (!props.useExternalCmdbApi) {
|
|
1588
|
+
list = (await (0, _cmdbSdk.CmdbObjectApi_list)({
|
|
1589
|
+
page: 1,
|
|
1590
|
+
page_size: transHierRelationSideObjectIds.length,
|
|
1591
|
+
objectIds: transHierRelationSideObjectIds.join(",")
|
|
1592
|
+
})).list;
|
|
1593
|
+
}
|
|
1594
|
+
} catch (e) {
|
|
1595
|
+
// istanbul ignore next
|
|
1596
|
+
(0, _brickKit.handleHttpError)(e);
|
|
1574
1597
|
}
|
|
1575
1598
|
if ((_list = list) !== null && _list !== void 0 && _list.length) {
|
|
1576
1599
|
objectList.push(...list);
|