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

revert(azure): revert removal (#3890)

* Revert "fix(sidebar): show docker sidebar when needed (#3852)"

This reverts commit 59da17dde4.

* Revert "refactor(azure): remove Azure ACI endpoint support (#3803)"

This reverts commit 493de20540.
This commit is contained in:
Chaim Lev-Ari 2020-06-09 05:43:32 +03:00 committed by GitHub
parent 25ca036070
commit b58c2facfe
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
65 changed files with 1793 additions and 50 deletions

View file

@ -0,0 +1,66 @@
export function ContainerGroupDefaultModel() {
this.Location = '';
this.OSType = 'Linux';
this.Name = '';
this.Image = '';
this.AllocatePublicIP = true;
this.Ports = [
{
container: 80,
host: 80,
protocol: 'TCP',
},
];
this.CPU = 1;
this.Memory = 1;
}
export function ContainerGroupViewModel(data) {
this.Id = data.id;
this.Name = data.name;
this.Location = data.location;
this.IPAddress = data.properties.ipAddress.ip;
this.Ports = data.properties.ipAddress.ports;
}
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];
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,
},
};
}