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 commit59da17dde4
. * Revert "refactor(azure): remove Azure ACI endpoint support (#3803)" This reverts commit493de20540
.
This commit is contained in:
parent
25ca036070
commit
b58c2facfe
65 changed files with 1793 additions and 50 deletions
66
app/azure/models/container_group.js
Normal file
66
app/azure/models/container_group.js
Normal 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,
|
||||
},
|
||||
};
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue