fix(aci): fixed aci with persistence or networking issue. (#4996)

pull/5162/head
fhanportainer 4 years ago committed by GitHub
parent defd929366
commit 267968e099
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -20,18 +20,18 @@ export function ContainerGroupDefaultModel() {
}
export function ContainerGroupViewModel(data) {
const addressPorts = data.properties.ipAddress.ports;
const addressPorts = data.properties.ipAddress ? data.properties.ipAddress.ports : [];
const container = data.properties.containers.length ? data.properties.containers[0] : {};
const containerPorts = container ? container.properties.ports : [];
this.Id = data.id;
this.Name = data.name;
this.Location = data.location;
this.IPAddress = data.properties.ipAddress.ip;
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.Image = container.properties.image || '';
this.OSType = data.properties.osType;
this.AllocatePublicIP = data.properties.ipAddress.type === 'Public';
this.AllocatePublicIP = data.properties.ipAddress && data.properties.ipAddress.type === 'Public';
this.CPU = container.properties.resources.requests.cpu;
this.Memory = container.properties.resources.requests.memoryInGB;

@ -63,7 +63,7 @@
</div>
<!-- !os-input -->
<!-- port-mapping -->
<div class="form-group">
<div class="form-group" ng-if="$ctrl.container.Ports.length > 0">
<div class="col-sm-12">
<label class="control-label text-left">Port mapping</label>
</div>

Loading…
Cancel
Save