Commit 30076f31 authored by Alicja Reniewicz's avatar Alicja Reniewicz
Browse files

fix problem with UNKNOWN location for BYON

parent 49f0687f
......@@ -108,10 +108,14 @@ export class VmListComponent implements OnInit {
}
getCity(vm: NodeCloudiator): string {
const locationId = vm.originId.split('/')[0];
const location = this.locationList
.find(value => value.id === locationId);
return (location && location.geoLocation) ? location.geoLocation.city : 'UNKNOWN';
if (vm.nodeProperties.geoLocation != null && vm.nodeProperties.geoLocation.city != null) {
return vm.nodeProperties.geoLocation.city;
} else { // find location by locationId
const locationId = vm.originId.split('/')[0];
const location = this.locationList
.find(value => value.id === locationId);
return (location && location.geoLocation) ? location.geoLocation.city : 'UNKNOWN';
}
}
userHasPermissionToSshConnection(vm: NodeCloudiator): boolean {
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment