Null vars fix

pull/2/head
Roman Usachev 2016-02-24 05:34:53 +03:00
parent 50d33a07df
commit cc1b67575c
1 changed files with 10 additions and 6 deletions

View File

@ -18,16 +18,20 @@ angular.module('container', [])
$scope.container.newContainerName = d.Name;
// fill up env
if (d.Config.Env) {
$scope.newCfg.Env = d.Config.Env.map(function (entry) {
return {name: entry.split('=')[0], value: entry.split('=')[1]};
});
}
// fill up ports
$scope.newCfg.Ports = {};
angular.forEach(d.Config.ExposedPorts, function(i, port) {
$scope.newCfg.Ports[port] = d.HostConfig.PortBindings[port] || [];
if (d.HostConfig.PortBindings && port in d.HostConfig.PortBindings)
$scope.newCfg.Ports[port] = d.HostConfig.PortBindings[port];
else
$scope.newCfg.Ports[port] = [];
});
//angular.forEach($scope.newCfg.Ports, function(conf, port, arr) { arr[port] = conf || []; });
// fill up bindings
$scope.newCfg.Binds = [];