1
0
Fork 0
mirror of https://github.com/portainer/portainer.git synced 2025-08-02 20:35:25 +02:00

refactor(azure/aci): migrate create view to react [EE-2188] (#6371)

This commit is contained in:
Chaim Lev-Ari 2022-02-01 19:38:45 +02:00 committed by GitHub
parent 1bb02eea59
commit 6f6f78fbe5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
53 changed files with 1476 additions and 571 deletions

View file

@ -48,48 +48,3 @@ export function ContainerGroupViewModel(data) {
this.ResourceControl = new ResourceControlViewModel(data.Portainer.ResourceControl);
}
}
export function CreateContainerGroupRequest(model) {
this.location = model.Location;
var containerPorts = [];
var addressPorts = [];
for (var i = 0; i < model.Ports.length; i++) {
var binding = model.Ports[i];
if (!binding.container || !binding.host) {
continue;
}
containerPorts.push({
port: binding.container,
});
addressPorts.push({
port: binding.host,
protocol: binding.protocol,
});
}
this.properties = {
osType: model.OSType,
containers: [
{
name: model.Name,
properties: {
image: model.Image,
ports: containerPorts,
resources: {
requests: {
cpu: model.CPU,
memoryInGB: model.Memory,
},
},
},
},
],
ipAddress: {
type: model.AllocatePublicIP ? 'Public' : 'Private',
ports: addressPorts,
},
};
}