@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
|
@@ -1,18 +1,20 @@
|
|
|
1
1
|
import { InstanceApi_getDetail } from "@next-sdk/cmdb-sdk";
|
|
2
2
|
import { http } from "@next-core/brick-http";
|
|
3
3
|
export function fetchCmdbInstanceDetail(objectId, instanceId, sourceId) {
|
|
4
|
-
return sourceId ? http.post("api/gateway/easyops.api.
|
|
4
|
+
return sourceId ? http.post("api/gateway/easyops.api.%20cmdb.topo_center.ProxyGetInstanceDetail@1.0.0/api/v1/proxy-get-instance-detail", {
|
|
5
5
|
objectId,
|
|
6
|
-
sourceId
|
|
7
|
-
|
|
6
|
+
sourceId,
|
|
7
|
+
instanceId
|
|
8
|
+
}).then(res => res.data) : InstanceApi_getDetail(objectId, instanceId, {});
|
|
8
9
|
}
|
|
9
10
|
export function fetchCmdbInstanceDetailByFields(objectId, instanceId, fields, relation_limit, sourceId) {
|
|
10
|
-
return sourceId ? http.post("api/gateway/easyops.api.
|
|
11
|
+
return sourceId ? http.post("api/gateway/easyops.api.%20cmdb.topo_center.ProxyGetInstanceDetail@1.0.0/api/v1/proxy-get-instance-detail", {
|
|
11
12
|
objectId,
|
|
12
13
|
sourceId,
|
|
14
|
+
instanceId,
|
|
13
15
|
fields,
|
|
14
16
|
relation_limit
|
|
15
|
-
}) : InstanceApi_getDetail(objectId, instanceId, {
|
|
17
|
+
}).then(res => res.data) : InstanceApi_getDetail(objectId, instanceId, {
|
|
16
18
|
fields,
|
|
17
19
|
relation_limit
|
|
18
20
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fetchCmdbInstanceDetail.js","names":["InstanceApi_getDetail","http","fetchCmdbInstanceDetail","objectId","instanceId","sourceId","post","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":["InstanceApi_getDetail","http","fetchCmdbInstanceDetail","objectId","instanceId","sourceId","post","then","res","data","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,SAEEA,qBAAqB,QAEhB,oBAAoB;AAC3B,SAASC,IAAI,QAAQ,uBAAuB;AAE5C,OAAO,SAASC,uBAAuBA,CACrCC,QAAgB,EAChBC,UAAkB,EAClBC,QAAiB,EACoC;EACrD,OAAOA,QAAQ,GACXJ,IAAI,CACDK,IAAI,CACH,2GAA2G,EAC3G;IACEH,QAAQ;IACRE,QAAQ;IACRD;EACF,CACF,CAAC,CACAG,IAAI,CAAEC,GAAsC,IAAKA,GAAG,CAACC,IAAI,CAAC,GAC7DT,qBAAqB,CAACG,QAAQ,EAAEC,UAAU,EAAE,CAAC,CAAC,CAAC;AACrD;AAEA,OAAO,SAASM,+BAA+BA,CAC7CP,QAAgB,EAChBC,UAAkB,EAClBO,MAAc,EACdC,cAAuB,EACvBP,QAAiB,EACoC;EACrD,OAAOA,QAAQ,GACXJ,IAAI,CACDK,IAAI,CACH,2GAA2G,EAC3G;IACEH,QAAQ;IACRE,QAAQ;IACRD,UAAU;IACVO,MAAM;IACNC;EACF,CACF,CAAC,CACAL,IAAI,CAAEC,GAAsC,IAAKA,GAAG,CAACC,IAAI,CAAC,GAC7DT,qBAAqB,CAACG,QAAQ,EAAEC,UAAU,EAAE;IAC1CO,MAAM;IACNC;EACF,CAAuC,CAAC;AAC9C","ignoreList":[]}
|
|
@@ -38,7 +38,7 @@ export function joinRelationFieldAndShowkey(fields, modelData, objectList) {
|
|
|
38
38
|
}
|
|
39
39
|
});
|
|
40
40
|
}
|
|
41
|
-
export function getQuery(modelData, idObjectMap, q, fields, onlySearchByIp) {
|
|
41
|
+
export function getQuery(modelData, idObjectMap, q, fields, onlySearchByIp, extraFixedFields) {
|
|
42
42
|
var query = {
|
|
43
43
|
$or: []
|
|
44
44
|
};
|
|
@@ -46,7 +46,7 @@ export function getQuery(modelData, idObjectMap, q, fields, onlySearchByIp) {
|
|
|
46
46
|
if (onlySearchByIp) {
|
|
47
47
|
var _getRuntime$getCurren;
|
|
48
48
|
var searchIpFields = ((_getRuntime$getCurren = getRuntime().getCurrentApp().config) === null || _getRuntime$getCurren === void 0 ? void 0 : _getRuntime$getCurren.searchIpFields) || [];
|
|
49
|
-
var queryOrs = [...new Set(["ip", ...searchIpFields])];
|
|
49
|
+
var queryOrs = [...new Set(["ip", ...uniq([...searchIpFields, ...(extraFixedFields || [])])])];
|
|
50
50
|
var searchValue = {
|
|
51
51
|
$like: "%".concat(q.trim(), "%")
|
|
52
52
|
};
|
|
@@ -573,7 +573,7 @@ export function LegacyInstanceList(props) {
|
|
|
573
573
|
}];
|
|
574
574
|
}
|
|
575
575
|
if (state.q) {
|
|
576
|
-
query = getQuery(modelData, idObjectMap, state.q, state.fieldIds, props.onlySearchByIp);
|
|
576
|
+
query = getQuery(modelData, idObjectMap, state.q, state.fieldIds, props.onlySearchByIp, props.extraFixedFields);
|
|
577
577
|
}
|
|
578
578
|
if (state.q && props.useInstanceArchiveProvider) {
|
|
579
579
|
archiveData.key_word = state.q;
|