mirror of https://github.com/portainer/portainer
fix(frontend): Validate previous if the containerPort is not undefined [EE-1555] (#5827)
parent
3fb8a232b8
commit
b285219a58
|
@ -28,7 +28,16 @@ export function ContainerGroupViewModel(data) {
|
|||
this.Name = data.name;
|
||||
this.Location = data.location;
|
||||
this.IPAddress = data.properties.ipAddress ? data.properties.ipAddress.ip : '';
|
||||
this.Ports = addressPorts.length ? addressPorts.map((binding, index) => ({ container: containerPorts[index].port, host: binding.port, protocol: binding.protocol })) : [];
|
||||
this.Ports = addressPorts.length
|
||||
? addressPorts.map((binding, index) => {
|
||||
const port = (containerPorts[index] && containerPorts[index].port) || undefined;
|
||||
return {
|
||||
container: port,
|
||||
host: binding.port,
|
||||
protocol: binding.protocol,
|
||||
};
|
||||
})
|
||||
: [];
|
||||
this.Image = container.properties.image || '';
|
||||
this.OSType = data.properties.osType;
|
||||
this.AllocatePublicIP = data.properties.ipAddress && data.properties.ipAddress.type === 'Public';
|
||||
|
|
Loading…
Reference in New Issue