Skip to content

Commit

Permalink
fix datacenter can not show host (#603)
Browse files Browse the repository at this point in the history
Signed-off-by: Meina Zhou <[email protected]>
  • Loading branch information
zhoumeina authored and renmaosheng committed Sep 13, 2018
1 parent 369c35e commit 528208b
Showing 1 changed file with 12 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -232,8 +232,18 @@ export class CreateVchWizardService {
*/
getDcClustersAndStandAloneHosts(dcObj: ComputeResource): Observable<ComputeResource[]> {
const props = 'host,cluster';
return this.getResourceProperties<{host: ResourceBasicInfo[]; cluster: ResourceBasicInfo[]}>(dcObj.objRef, props)
.map(data => ({childResources: data['cluster'].concat(data['host'])}))
return this.getResourceProperties<{ host: ResourceBasicInfo[]; cluster: ResourceBasicInfo[] }>(dcObj.objRef, props)
.map(data => {
if (data['cluster']) {
return {
childResources: data['cluster'].concat(data['host'])
}
} else {
return {
childResources: data['host']
}
}
})
.switchMap(basicData => {
return this.getResourcesCompleteInfo(basicData.childResources)
.switchMap((completeData: ComputeResource[]) => {
Expand Down

0 comments on commit 528208b

Please sign in to comment.