2017-02-10 01:11:36 +00:00
|
|
|
function TemplateViewModel(data) {
|
|
|
|
this.Title = data.title;
|
|
|
|
this.Description = data.description;
|
|
|
|
this.Logo = data.logo;
|
|
|
|
this.Image = data.image;
|
|
|
|
this.Registry = data.registry ? data.registry : '';
|
2017-02-10 05:11:00 +00:00
|
|
|
this.Command = data.command ? data.command : '';
|
2017-02-10 20:32:34 +00:00
|
|
|
this.Network = data.network ? data.network : '';
|
2017-02-10 01:11:36 +00:00
|
|
|
this.Env = data.env ? data.env : [];
|
|
|
|
this.Volumes = data.volumes ? data.volumes : [];
|
|
|
|
this.Ports = [];
|
|
|
|
if (data.ports) {
|
|
|
|
this.Ports = data.ports.map(function (p) {
|
|
|
|
var portAndProtocol = _.split(p, '/');
|
|
|
|
return {
|
|
|
|
containerPort: portAndProtocol[0],
|
|
|
|
protocol: portAndProtocol[1]
|
|
|
|
};
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|