@next-libs/cmdb-instances 7.21.8 → 7.22.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/dist/cjs/data-providers/fetchCmdbInstanceDetail.js +15 -4
- package/dist/cjs/data-providers/fetchCmdbInstanceDetail.js.map +1 -1
- package/dist/cjs/data-providers/fetchCmdbInstanceSearch.js +7 -2
- package/dist/cjs/data-providers/fetchCmdbInstanceSearch.js.map +1 -1
- package/dist/cjs/data-providers/fetchCmdbObjectRef.js +6 -2
- package/dist/cjs/data-providers/fetchCmdbObjectRef.js.map +1 -1
- package/dist/cjs/instance-detail/InstanceDetail.js +27 -20
- package/dist/cjs/instance-detail/InstanceDetail.js.map +1 -1
- package/dist/cjs/instance-detail/components/instance-relation-table-show/instance-relation-table-show.js +7 -4
- package/dist/cjs/instance-detail/components/instance-relation-table-show/instance-relation-table-show.js.map +1 -1
- package/dist/esm/data-providers/fetchCmdbInstanceDetail.js +15 -4
- package/dist/esm/data-providers/fetchCmdbInstanceDetail.js.map +1 -1
- package/dist/esm/data-providers/fetchCmdbInstanceSearch.js +7 -2
- package/dist/esm/data-providers/fetchCmdbInstanceSearch.js.map +1 -1
- package/dist/esm/data-providers/fetchCmdbObjectRef.js +6 -2
- package/dist/esm/data-providers/fetchCmdbObjectRef.js.map +1 -1
- package/dist/esm/instance-detail/InstanceDetail.js +27 -20
- package/dist/esm/instance-detail/InstanceDetail.js.map +1 -1
- package/dist/esm/instance-detail/components/instance-relation-table-show/instance-relation-table-show.js +7 -4
- package/dist/esm/instance-detail/components/instance-relation-table-show/instance-relation-table-show.js.map +1 -1
- package/dist/types/data-providers/fetchCmdbInstanceDetail.d.ts +2 -2
- package/dist/types/data-providers/fetchCmdbInstanceSearch.d.ts +1 -1
- package/dist/types/data-providers/fetchCmdbObjectRef.d.ts +1 -1
- package/dist/types/instance-detail/InstanceDetail.d.ts +4 -2
- package/dist/types/instance-detail/components/instance-relation-table-show/instance-relation-table-show.d.ts +1 -0
- package/package.json +2 -2
|
@@ -6,11 +6,22 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.fetchCmdbInstanceDetail = fetchCmdbInstanceDetail;
|
|
7
7
|
exports.fetchCmdbInstanceDetailByFields = fetchCmdbInstanceDetailByFields;
|
|
8
8
|
var _cmdbSdk = require("@next-sdk/cmdb-sdk");
|
|
9
|
-
|
|
10
|
-
|
|
9
|
+
var _brickHttp = require("@next-core/brick-http");
|
|
10
|
+
function fetchCmdbInstanceDetail(objectId, instanceId, sourceId) {
|
|
11
|
+
return sourceId ? _brickHttp.http.post("api/gateway/easyops.api.%20cmdb.topo_center.ProxyGetInstanceDetail@1.0.0/api/v1/proxy-get-instance-detail", {
|
|
12
|
+
objectId,
|
|
13
|
+
sourceId,
|
|
14
|
+
instanceId
|
|
15
|
+
}).then(res => res.data) : (0, _cmdbSdk.InstanceApi_getDetail)(objectId, instanceId, {});
|
|
11
16
|
}
|
|
12
|
-
function fetchCmdbInstanceDetailByFields(objectId, instanceId, fields, relation_limit) {
|
|
13
|
-
return (0
|
|
17
|
+
function fetchCmdbInstanceDetailByFields(objectId, instanceId, fields, relation_limit, sourceId) {
|
|
18
|
+
return sourceId ? _brickHttp.http.post("api/gateway/easyops.api.%20cmdb.topo_center.ProxyGetInstanceDetail@1.0.0/api/v1/proxy-get-instance-detail", {
|
|
19
|
+
objectId,
|
|
20
|
+
sourceId,
|
|
21
|
+
instanceId,
|
|
22
|
+
fields,
|
|
23
|
+
relation_limit
|
|
24
|
+
}).then(res => res.data) : (0, _cmdbSdk.InstanceApi_getDetail)(objectId, instanceId, {
|
|
14
25
|
fields,
|
|
15
26
|
relation_limit
|
|
16
27
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fetchCmdbInstanceDetail.js","names":["_cmdbSdk","require","fetchCmdbInstanceDetail","objectId","instanceId","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\";\n\nexport function fetchCmdbInstanceDetail(\n objectId: string,\n instanceId: string\n): Promise<Partial<InstanceApi_GetDetailResponseBody>> {\n return InstanceApi_getDetail(objectId, instanceId, {});\n}\n\nexport function fetchCmdbInstanceDetailByFields(\n objectId: string,\n instanceId: string,\n fields: string,\n relation_limit?: number\n): Promise<Partial<InstanceApi_GetDetailResponseBody>> {\n return InstanceApi_getDetail(objectId, instanceId, {\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":[]}
|
|
@@ -5,7 +5,12 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.fetchCmdbInstanceSearch = fetchCmdbInstanceSearch;
|
|
7
7
|
var _cmdbSdk = require("@next-sdk/cmdb-sdk");
|
|
8
|
-
|
|
9
|
-
|
|
8
|
+
var _brickHttp = require("@next-core/brick-http");
|
|
9
|
+
function fetchCmdbInstanceSearch(objectId, params, sourceId) {
|
|
10
|
+
return sourceId ? _brickHttp.http.post("api/gateway/easyops.api.cmdb.topo_center.ProxyPostSearchV3@1.0.1/api/v1/proxy-post-search-v3", {
|
|
11
|
+
...params,
|
|
12
|
+
objectId,
|
|
13
|
+
sourceId
|
|
14
|
+
}) : (0, _cmdbSdk.InstanceApi_postSearchV3)(objectId, params);
|
|
10
15
|
}
|
|
11
16
|
//# sourceMappingURL=fetchCmdbInstanceSearch.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fetchCmdbInstanceSearch.js","names":["_cmdbSdk","require","fetchCmdbInstanceSearch","objectId","params","InstanceApi_postSearchV3"],"sources":["../../../src/data-providers/fetchCmdbInstanceSearch.ts"],"sourcesContent":["import {\n InstanceApi_PostSearchV3RequestBody,\n InstanceApi_PostSearchV3ResponseBody,\n InstanceApi_postSearchV3,\n} from \"@next-sdk/cmdb-sdk\";\n\nexport function fetchCmdbInstanceSearch(\n objectId: string,\n params: InstanceApi_PostSearchV3RequestBody\n): Promise<Partial<InstanceApi_PostSearchV3ResponseBody>> {\n return InstanceApi_postSearchV3(objectId, params);\n}\n"],"mappings":";;;;;;AAAA,IAAAA,QAAA,GAAAC,OAAA;
|
|
1
|
+
{"version":3,"file":"fetchCmdbInstanceSearch.js","names":["_cmdbSdk","require","_brickHttp","fetchCmdbInstanceSearch","objectId","params","sourceId","http","post","InstanceApi_postSearchV3"],"sources":["../../../src/data-providers/fetchCmdbInstanceSearch.ts"],"sourcesContent":["import {\n InstanceApi_PostSearchV3RequestBody,\n InstanceApi_PostSearchV3ResponseBody,\n InstanceApi_postSearchV3,\n} from \"@next-sdk/cmdb-sdk\";\n\nimport { http } from \"@next-core/brick-http\";\n\nexport function fetchCmdbInstanceSearch(\n objectId: string,\n params: InstanceApi_PostSearchV3RequestBody,\n sourceId?: string\n): Promise<Partial<InstanceApi_PostSearchV3ResponseBody>> {\n return sourceId\n ? http.post(\n \"api/gateway/easyops.api.cmdb.topo_center.ProxyPostSearchV3@1.0.1/api/v1/proxy-post-search-v3\",\n {\n ...params,\n objectId,\n sourceId,\n }\n )\n : InstanceApi_postSearchV3(objectId, params);\n}\n"],"mappings":";;;;;;AAAA,IAAAA,QAAA,GAAAC,OAAA;AAMA,IAAAC,UAAA,GAAAD,OAAA;AAEO,SAASE,uBAAuBA,CACrCC,QAAgB,EAChBC,MAA2C,EAC3CC,QAAiB,EACuC;EACxD,OAAOA,QAAQ,GACXC,eAAI,CAACC,IAAI,CACP,8FAA8F,EAC9F;IACE,GAAGH,MAAM;IACTD,QAAQ;IACRE;EACF,CACF,CAAC,GACD,IAAAG,iCAAwB,EAACL,QAAQ,EAAEC,MAAM,CAAC;AAChD","ignoreList":[]}
|
|
@@ -5,8 +5,12 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.fetchCmdbObjectRef = fetchCmdbObjectRef;
|
|
7
7
|
var _cmdbSdk = require("@next-sdk/cmdb-sdk");
|
|
8
|
-
|
|
9
|
-
|
|
8
|
+
var _brickHttp = require("@next-core/brick-http");
|
|
9
|
+
function fetchCmdbObjectRef(objectId, sourceId) {
|
|
10
|
+
return sourceId ? _brickHttp.http.post("api/gateway/easyops.api.cmdb.topo_center.ProxyGetObjectRef@1.0.0/api/v1/proxy-get-object-ref", {
|
|
11
|
+
ref_object: objectId,
|
|
12
|
+
sourceId
|
|
13
|
+
}) : (0, _cmdbSdk.CmdbObjectApi_getObjectRef)({
|
|
10
14
|
ref_object: objectId
|
|
11
15
|
});
|
|
12
16
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fetchCmdbObjectRef.js","names":["_cmdbSdk","require","fetchCmdbObjectRef","objectId","
|
|
1
|
+
{"version":3,"file":"fetchCmdbObjectRef.js","names":["_cmdbSdk","require","_brickHttp","fetchCmdbObjectRef","objectId","sourceId","http","post","ref_object","CmdbObjectApi_getObjectRef"],"sources":["../../../src/data-providers/fetchCmdbObjectRef.ts"],"sourcesContent":["import {\n CmdbObjectApi_GetObjectRefResponseBody,\n CmdbObjectApi_getObjectRef,\n} from \"@next-sdk/cmdb-sdk\";\nimport { http } from \"@next-core/brick-http\";\n\nexport function fetchCmdbObjectRef(\n objectId: string,\n sourceId?: string\n): Promise<CmdbObjectApi_GetObjectRefResponseBody> {\n return sourceId\n ? http.post(\n \"api/gateway/easyops.api.cmdb.topo_center.ProxyGetObjectRef@1.0.0/api/v1/proxy-get-object-ref\",\n {\n ref_object: objectId,\n sourceId,\n }\n )\n : CmdbObjectApi_getObjectRef({ ref_object: objectId });\n}\n"],"mappings":";;;;;;AAAA,IAAAA,QAAA,GAAAC,OAAA;AAIA,IAAAC,UAAA,GAAAD,OAAA;AAEO,SAASE,kBAAkBA,CAChCC,QAAgB,EAChBC,QAAiB,EACgC;EACjD,OAAOA,QAAQ,GACXC,eAAI,CAACC,IAAI,CACP,8FAA8F,EAC9F;IACEC,UAAU,EAAEJ,QAAQ;IACpBC;EACF,CACF,CAAC,GACD,IAAAI,mCAA0B,EAAC;IAAED,UAAU,EAAEJ;EAAS,CAAC,CAAC;AAC1D","ignoreList":[]}
|
|
@@ -112,7 +112,8 @@ class LegacyInstanceDetail extends _react.default.Component {
|
|
|
112
112
|
},
|
|
113
113
|
searchValue: "",
|
|
114
114
|
scrollContainer: null,
|
|
115
|
-
httpErrorSting: ""
|
|
115
|
+
httpErrorSting: "",
|
|
116
|
+
externalSourceId: ""
|
|
116
117
|
};
|
|
117
118
|
}
|
|
118
119
|
render() {
|
|
@@ -125,7 +126,8 @@ class LegacyInstanceDetail extends _react.default.Component {
|
|
|
125
126
|
} = this.state;
|
|
126
127
|
const {
|
|
127
128
|
showCard = true,
|
|
128
|
-
useHttpErrorString = false
|
|
129
|
+
useHttpErrorString = false,
|
|
130
|
+
externalSourceId
|
|
129
131
|
} = this.props;
|
|
130
132
|
return (
|
|
131
133
|
/*#__PURE__*/
|
|
@@ -176,7 +178,7 @@ class LegacyInstanceDetail extends _react.default.Component {
|
|
|
176
178
|
width: 300
|
|
177
179
|
},
|
|
178
180
|
onSearch: value => {
|
|
179
|
-
this.searchInstanceRelationData(1, this.state.relationTablePagination.pageSize, this.state.currentAttr, value);
|
|
181
|
+
this.searchInstanceRelationData(1, this.state.relationTablePagination.pageSize, this.state.currentAttr, value, externalSourceId);
|
|
180
182
|
},
|
|
181
183
|
enterButton: true
|
|
182
184
|
}), /*#__PURE__*/_react.default.createElement(_instanceRelationTableShow.InstanceRelationTableShow, {
|
|
@@ -189,17 +191,18 @@ class LegacyInstanceDetail extends _react.default.Component {
|
|
|
189
191
|
this.setState({
|
|
190
192
|
filterObjectId: _object_id
|
|
191
193
|
}, () => {
|
|
192
|
-
this.searchInstanceRelationData(1, this.state.relationTablePagination.pageSize, this.state.currentAttr, undefined);
|
|
194
|
+
this.searchInstanceRelationData(1, this.state.relationTablePagination.pageSize, this.state.currentAttr, undefined, externalSourceId);
|
|
193
195
|
});
|
|
194
196
|
}
|
|
195
197
|
},
|
|
196
198
|
relationTablePagination: this.state.relationTablePagination,
|
|
197
199
|
relationFieldUrlTemplate: this.props.relationFieldUrlTemplate,
|
|
198
200
|
isPagination: true,
|
|
201
|
+
externalSourceId: externalSourceId,
|
|
199
202
|
total: (instanceRelationModalData === null || instanceRelationModalData === void 0 ? void 0 : instanceRelationModalData.total) || 0,
|
|
200
203
|
paginationChange: (page, pageSize, relationData) => {
|
|
201
204
|
if (page !== this.state.relationTablePagination.current || pageSize !== this.state.relationTablePagination.pageSize) {
|
|
202
|
-
this.searchInstanceRelationData(page, pageSize, relationData);
|
|
205
|
+
this.searchInstanceRelationData(page, pageSize, relationData, undefined, externalSourceId);
|
|
203
206
|
}
|
|
204
207
|
}
|
|
205
208
|
}))), (_this$props$brickConf = this.props.brickConfigList) === null || _this$props$brickConf === void 0 ? void 0 : _this$props$brickConf.map(config => /*#__PURE__*/_react.default.createElement(_antd.Card, {
|
|
@@ -443,7 +446,8 @@ class LegacyInstanceDetail extends _react.default.Component {
|
|
|
443
446
|
const {
|
|
444
447
|
modelDataMap,
|
|
445
448
|
modelData,
|
|
446
|
-
instanceData
|
|
449
|
+
instanceData,
|
|
450
|
+
externalSourceId
|
|
447
451
|
} = this.state;
|
|
448
452
|
let config;
|
|
449
453
|
let isComponentMode = false;
|
|
@@ -507,11 +511,12 @@ class LegacyInstanceDetail extends _react.default.Component {
|
|
|
507
511
|
relationData: attr,
|
|
508
512
|
value: (_instanceData$attr$__ = instanceData[attr.__id]) === null || _instanceData$attr$__ === void 0 ? void 0 : _instanceData$attr$__.slice(0, 10),
|
|
509
513
|
relationFieldUrlTemplate: this.props.relationFieldUrlTemplate,
|
|
510
|
-
filterInstanceSourceDisabled: true
|
|
514
|
+
filterInstanceSourceDisabled: true,
|
|
515
|
+
externalSourceId: externalSourceId
|
|
511
516
|
}), ((_instanceData$attr$__2 = instanceData[attr.__id]) === null || _instanceData$attr$__2 === void 0 ? void 0 : _instanceData$attr$__2.length) >= 10 && /*#__PURE__*/_react.default.createElement(_antd.Button, {
|
|
512
517
|
"data-testid": "view-more-" + attr.__id,
|
|
513
518
|
type: "link",
|
|
514
|
-
onClick: () => this.handleRelationModal(attr)
|
|
519
|
+
onClick: () => this.handleRelationModal(attr, externalSourceId)
|
|
515
520
|
}, _i18next.default.t(`${_constants.NS_LIBS_CMDB_INSTANCES}:${_constants.K.VIEW_MORE}`))), !isStructs(attr) && !isStruct(attr) && !isAttachment(attr) && !isRelation(attr) && !isXmlField(attr) && !isPasswordField(attr) && isComponentMode && !isUrl(attr) && !isFloat(attr) && !isJson(attr) && (attrCustomConfig.useBrick ? /*#__PURE__*/_react.default.createElement(_brickKit.BrickAsComponent, {
|
|
516
521
|
useBrick: attrCustomConfig.useBrick,
|
|
517
522
|
data: {
|
|
@@ -547,12 +552,12 @@ class LegacyInstanceDetail extends _react.default.Component {
|
|
|
547
552
|
})));
|
|
548
553
|
}
|
|
549
554
|
// istanbul ignore next
|
|
550
|
-
async handleRelationModal(attr) {
|
|
551
|
-
await this.searchInstanceRelationData(1, 10, attr);
|
|
555
|
+
async handleRelationModal(attr, externalSourceId) {
|
|
556
|
+
await this.searchInstanceRelationData(1, 10, attr, undefined, externalSourceId);
|
|
552
557
|
}
|
|
553
558
|
|
|
554
559
|
// istanbul ignore next
|
|
555
|
-
async searchInstanceRelationData(page, pageSize, attr, value) {
|
|
560
|
+
async searchInstanceRelationData(page, pageSize, attr, value, externalSourceId) {
|
|
556
561
|
var _modelData$view, _modelDataMap$objectI;
|
|
557
562
|
const {
|
|
558
563
|
right_id,
|
|
@@ -592,7 +597,7 @@ class LegacyInstanceDetail extends _react.default.Component {
|
|
|
592
597
|
if (value !== undefined ? value : this.state.searchValue) {
|
|
593
598
|
let oppositeModelDataMap = this.state.oppositeModelDataMap;
|
|
594
599
|
if (this.state.oppositeObjectId !== objectId) {
|
|
595
|
-
const oppositeModelList = await (0, _dataProviders.fetchCmdbObjectRef)(objectId);
|
|
600
|
+
const oppositeModelList = await (0, _dataProviders.fetchCmdbObjectRef)(objectId, externalSourceId);
|
|
596
601
|
oppositeModelDataMap = (0, _lodash.keyBy)(oppositeModelList.data, "objectId");
|
|
597
602
|
this.setState({
|
|
598
603
|
oppositeObjectId: objectId,
|
|
@@ -625,7 +630,7 @@ class LegacyInstanceDetail extends _react.default.Component {
|
|
|
625
630
|
...params
|
|
626
631
|
})).data;
|
|
627
632
|
} else {
|
|
628
|
-
instanceRelationModalData = await (0, _dataProviders.fetchCmdbInstanceSearch)(objectId, params);
|
|
633
|
+
instanceRelationModalData = await (0, _dataProviders.fetchCmdbInstanceSearch)(objectId, params, externalSourceId);
|
|
629
634
|
}
|
|
630
635
|
this.setState({
|
|
631
636
|
instanceRelationModalData,
|
|
@@ -814,6 +819,7 @@ class LegacyInstanceDetail extends _react.default.Component {
|
|
|
814
819
|
async fetchData(props) {
|
|
815
820
|
let modelListData, modelDataMap, instanceData;
|
|
816
821
|
const relationLimit = 10;
|
|
822
|
+
const externalSourceId = props.externalSourceId;
|
|
817
823
|
try {
|
|
818
824
|
if (props.modelDataList) {
|
|
819
825
|
modelDataMap = (0, _lodash.keyBy)(props.modelDataList, "objectId");
|
|
@@ -821,25 +827,25 @@ class LegacyInstanceDetail extends _react.default.Component {
|
|
|
821
827
|
const {
|
|
822
828
|
fields
|
|
823
829
|
} = this.getInstanceDetailData(props, modelDataMap);
|
|
824
|
-
instanceData = await (0, _dataProviders.fetchCmdbInstanceDetailByFields)(props.objectId, props.instanceId, fields, relationLimit);
|
|
830
|
+
instanceData = await (0, _dataProviders.fetchCmdbInstanceDetailByFields)(props.objectId, props.instanceId, fields, relationLimit, externalSourceId);
|
|
825
831
|
} else {
|
|
826
|
-
instanceData = await (0, _dataProviders.fetchCmdbInstanceDetail)(props.objectId, props.instanceId);
|
|
832
|
+
instanceData = await (0, _dataProviders.fetchCmdbInstanceDetail)(props.objectId, props.instanceId, externalSourceId);
|
|
827
833
|
}
|
|
828
834
|
} else {
|
|
829
835
|
if (props.showFields) {
|
|
830
|
-
modelListData = await (0, _dataProviders.fetchCmdbObjectRef)(props.objectId);
|
|
836
|
+
modelListData = await (0, _dataProviders.fetchCmdbObjectRef)(props.objectId, externalSourceId);
|
|
831
837
|
modelDataMap = (0, _lodash.keyBy)(modelListData.data, "objectId");
|
|
832
838
|
const {
|
|
833
839
|
fields
|
|
834
840
|
} = this.getInstanceDetailData(props, modelDataMap);
|
|
835
|
-
instanceData = await (0, _dataProviders.fetchCmdbInstanceDetailByFields)(props.objectId, props.instanceId, fields, relationLimit);
|
|
841
|
+
instanceData = await (0, _dataProviders.fetchCmdbInstanceDetailByFields)(props.objectId, props.instanceId, fields, relationLimit, externalSourceId);
|
|
836
842
|
} else {
|
|
837
843
|
if (props.ignorePermission) {
|
|
838
844
|
[modelListData, {
|
|
839
845
|
data: instanceData
|
|
840
|
-
}] = await Promise.all([(0, _dataProviders.fetchCmdbObjectRef)(props.objectId), _brickHttp.http.get(`api/gateway/easyops.api.cmdb.instance.GetDetailWithAdmin/object/${props.objectId}/instance/${props.instanceId}`, {})]);
|
|
846
|
+
}] = await Promise.all([(0, _dataProviders.fetchCmdbObjectRef)(props.objectId, externalSourceId), _brickHttp.http.get(`api/gateway/easyops.api.cmdb.instance.GetDetailWithAdmin/object/${props.objectId}/instance/${props.instanceId}`, {})]);
|
|
841
847
|
} else {
|
|
842
|
-
[modelListData, instanceData] = await Promise.all([(0, _dataProviders.fetchCmdbObjectRef)(props.objectId), (0, _dataProviders.fetchCmdbInstanceDetail)(props.objectId, props.instanceId)]);
|
|
848
|
+
[modelListData, instanceData] = await Promise.all([(0, _dataProviders.fetchCmdbObjectRef)(props.objectId, externalSourceId), (0, _dataProviders.fetchCmdbInstanceDetail)(props.objectId, props.instanceId, externalSourceId)]);
|
|
843
849
|
}
|
|
844
850
|
modelDataMap = (0, _lodash.keyBy)(modelListData.data, "objectId");
|
|
845
851
|
}
|
|
@@ -860,7 +866,8 @@ class LegacyInstanceDetail extends _react.default.Component {
|
|
|
860
866
|
instanceData,
|
|
861
867
|
loaded: true,
|
|
862
868
|
basicInfoGroupListShow: [],
|
|
863
|
-
basicInfoGroupList: []
|
|
869
|
+
basicInfoGroupList: [],
|
|
870
|
+
externalSourceId
|
|
864
871
|
});
|
|
865
872
|
this.setBasicInfoGroupList(this.state);
|
|
866
873
|
// this.setFormattedInstanceData(this.state);
|