@next-libs/cmdb-instances 7.22.0 → 7.22.2
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/data-providers/fetchCmdbInstanceDetail.js +7 -5
- package/dist/cjs/data-providers/fetchCmdbInstanceDetail.js.map +1 -1
- package/dist/cjs/instance-list/InstanceList.js +3 -3
- package/dist/cjs/instance-list/InstanceList.js.map +1 -1
- package/dist/esm/data-providers/fetchCmdbInstanceDetail.js +7 -5
- package/dist/esm/data-providers/fetchCmdbInstanceDetail.js.map +1 -1
- package/dist/esm/instance-list/InstanceList.js +3 -3
- package/dist/esm/instance-list/InstanceList.js.map +1 -1
- package/dist/types/instance-list/InstanceList.d.ts +1 -1
- package/package.json +2 -2
|
@@ -8,18 +8,20 @@ exports.fetchCmdbInstanceDetailByFields = fetchCmdbInstanceDetailByFields;
|
|
|
8
8
|
var _cmdbSdk = require("@next-sdk/cmdb-sdk");
|
|
9
9
|
var _brickHttp = require("@next-core/brick-http");
|
|
10
10
|
function fetchCmdbInstanceDetail(objectId, instanceId, sourceId) {
|
|
11
|
-
return sourceId ? _brickHttp.http.post("api/gateway/easyops.api.
|
|
11
|
+
return sourceId ? _brickHttp.http.post("api/gateway/easyops.api.%20cmdb.topo_center.ProxyGetInstanceDetail@1.0.0/api/v1/proxy-get-instance-detail", {
|
|
12
12
|
objectId,
|
|
13
|
-
sourceId
|
|
14
|
-
|
|
13
|
+
sourceId,
|
|
14
|
+
instanceId
|
|
15
|
+
}).then(res => res.data) : (0, _cmdbSdk.InstanceApi_getDetail)(objectId, instanceId, {});
|
|
15
16
|
}
|
|
16
17
|
function fetchCmdbInstanceDetailByFields(objectId, instanceId, fields, relation_limit, sourceId) {
|
|
17
|
-
return sourceId ? _brickHttp.http.post("api/gateway/easyops.api.
|
|
18
|
+
return sourceId ? _brickHttp.http.post("api/gateway/easyops.api.%20cmdb.topo_center.ProxyGetInstanceDetail@1.0.0/api/v1/proxy-get-instance-detail", {
|
|
18
19
|
objectId,
|
|
19
20
|
sourceId,
|
|
21
|
+
instanceId,
|
|
20
22
|
fields,
|
|
21
23
|
relation_limit
|
|
22
|
-
}) : (0, _cmdbSdk.InstanceApi_getDetail)(objectId, instanceId, {
|
|
24
|
+
}).then(res => res.data) : (0, _cmdbSdk.InstanceApi_getDetail)(objectId, instanceId, {
|
|
23
25
|
fields,
|
|
24
26
|
relation_limit
|
|
25
27
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fetchCmdbInstanceDetail.js","names":["_cmdbSdk","require","_brickHttp","fetchCmdbInstanceDetail","objectId","instanceId","sourceId","http","post","InstanceApi_getDetail","fetchCmdbInstanceDetailByFields","fields","relation_limit"],"sources":["../../../src/data-providers/fetchCmdbInstanceDetail.ts"],"sourcesContent":["import {\n InstanceApi_GetDetailResponseBody,\n InstanceApi_getDetail,\n InstanceApi_GetDetailRequestParams,\n} from \"@next-sdk/cmdb-sdk\";\nimport { http } from \"@next-core/brick-http\";\n\nexport function fetchCmdbInstanceDetail(\n objectId: string,\n instanceId: string,\n sourceId?: string\n): Promise<Partial<InstanceApi_GetDetailResponseBody>> {\n return sourceId\n ? http.post(\n
|
|
1
|
+
{"version":3,"file":"fetchCmdbInstanceDetail.js","names":["_cmdbSdk","require","_brickHttp","fetchCmdbInstanceDetail","objectId","instanceId","sourceId","http","post","then","res","data","InstanceApi_getDetail","fetchCmdbInstanceDetailByFields","fields","relation_limit"],"sources":["../../../src/data-providers/fetchCmdbInstanceDetail.ts"],"sourcesContent":["import {\n InstanceApi_GetDetailResponseBody,\n InstanceApi_getDetail,\n InstanceApi_GetDetailRequestParams,\n} from \"@next-sdk/cmdb-sdk\";\nimport { http } from \"@next-core/brick-http\";\n\nexport function fetchCmdbInstanceDetail(\n objectId: string,\n instanceId: string,\n sourceId?: string\n): Promise<Partial<InstanceApi_GetDetailResponseBody>> {\n return sourceId\n ? http\n .post(\n \"api/gateway/easyops.api.%20cmdb.topo_center.ProxyGetInstanceDetail@1.0.0/api/v1/proxy-get-instance-detail\",\n {\n objectId,\n sourceId,\n instanceId,\n }\n )\n .then((res: InstanceApi_GetDetailResponseBody) => res.data)\n : InstanceApi_getDetail(objectId, instanceId, {});\n}\n\nexport function fetchCmdbInstanceDetailByFields(\n objectId: string,\n instanceId: string,\n fields: string,\n relation_limit?: number,\n sourceId?: string\n): Promise<Partial<InstanceApi_GetDetailResponseBody>> {\n return sourceId\n ? http\n .post(\n \"api/gateway/easyops.api.%20cmdb.topo_center.ProxyGetInstanceDetail@1.0.0/api/v1/proxy-get-instance-detail\",\n {\n objectId,\n sourceId,\n instanceId,\n fields,\n relation_limit,\n }\n )\n .then((res: InstanceApi_GetDetailResponseBody) => res.data)\n : InstanceApi_getDetail(objectId, instanceId, {\n fields,\n relation_limit,\n } as InstanceApi_GetDetailRequestParams);\n}\n"],"mappings":";;;;;;;AAAA,IAAAA,QAAA,GAAAC,OAAA;AAKA,IAAAC,UAAA,GAAAD,OAAA;AAEO,SAASE,uBAAuBA,CACrCC,QAAgB,EAChBC,UAAkB,EAClBC,QAAiB,EACoC;EACrD,OAAOA,QAAQ,GACXC,eAAI,CACDC,IAAI,CACH,2GAA2G,EAC3G;IACEJ,QAAQ;IACRE,QAAQ;IACRD;EACF,CACF,CAAC,CACAI,IAAI,CAAEC,GAAsC,IAAKA,GAAG,CAACC,IAAI,CAAC,GAC7D,IAAAC,8BAAqB,EAACR,QAAQ,EAAEC,UAAU,EAAE,CAAC,CAAC,CAAC;AACrD;AAEO,SAASQ,+BAA+BA,CAC7CT,QAAgB,EAChBC,UAAkB,EAClBS,MAAc,EACdC,cAAuB,EACvBT,QAAiB,EACoC;EACrD,OAAOA,QAAQ,GACXC,eAAI,CACDC,IAAI,CACH,2GAA2G,EAC3G;IACEJ,QAAQ;IACRE,QAAQ;IACRD,UAAU;IACVS,MAAM;IACNC;EACF,CACF,CAAC,CACAN,IAAI,CAAEC,GAAsC,IAAKA,GAAG,CAACC,IAAI,CAAC,GAC7D,IAAAC,8BAAqB,EAACR,QAAQ,EAAEC,UAAU,EAAE;IAC1CS,MAAM;IACNC;EACF,CAAuC,CAAC;AAC9C","ignoreList":[]}
|
|
@@ -52,7 +52,7 @@ function joinRelationFieldAndShowkey(fields, modelData, objectList) {
|
|
|
52
52
|
}
|
|
53
53
|
});
|
|
54
54
|
}
|
|
55
|
-
function getQuery(modelData, idObjectMap, q, fields, onlySearchByIp) {
|
|
55
|
+
function getQuery(modelData, idObjectMap, q, fields, onlySearchByIp, extraFixedFields) {
|
|
56
56
|
const query = {
|
|
57
57
|
$or: []
|
|
58
58
|
};
|
|
@@ -60,7 +60,7 @@ function getQuery(modelData, idObjectMap, q, fields, onlySearchByIp) {
|
|
|
60
60
|
if (onlySearchByIp) {
|
|
61
61
|
var _getRuntime$getCurren;
|
|
62
62
|
const searchIpFields = ((_getRuntime$getCurren = (0, _brickKit.getRuntime)().getCurrentApp().config) === null || _getRuntime$getCurren === void 0 ? void 0 : _getRuntime$getCurren.searchIpFields) || [];
|
|
63
|
-
const queryOrs = [...new Set(["ip", ...searchIpFields])];
|
|
63
|
+
const queryOrs = [...new Set(["ip", ...(0, _lodash.uniq)([...searchIpFields, ...(extraFixedFields || [])])])];
|
|
64
64
|
const searchValue = {
|
|
65
65
|
$like: `%${q.trim()}%`
|
|
66
66
|
};
|
|
@@ -580,7 +580,7 @@ function LegacyInstanceList(props) {
|
|
|
580
580
|
}];
|
|
581
581
|
}
|
|
582
582
|
if (state.q) {
|
|
583
|
-
query = getQuery(modelData, idObjectMap, state.q, state.fieldIds, props.onlySearchByIp);
|
|
583
|
+
query = getQuery(modelData, idObjectMap, state.q, state.fieldIds, props.onlySearchByIp, props.extraFixedFields);
|
|
584
584
|
}
|
|
585
585
|
if (state.q && props.useInstanceArchiveProvider) {
|
|
586
586
|
archiveData.key_word = state.q;
|