|
|
|
@ -31,7 +31,8 @@ function ($scope, $state, $stateParams, $filter, Config, Info, Container, Contai
|
|
|
|
|
Binds: [],
|
|
|
|
|
NetworkMode: 'bridge',
|
|
|
|
|
Privileged: false,
|
|
|
|
|
ExtraHosts: []
|
|
|
|
|
ExtraHosts: [],
|
|
|
|
|
Devices:[]
|
|
|
|
|
},
|
|
|
|
|
Labels: {}
|
|
|
|
|
};
|
|
|
|
@ -76,6 +77,13 @@ function ($scope, $state, $stateParams, $filter, Config, Info, Container, Contai
|
|
|
|
|
$scope.formValues.ExtraHosts.splice(index, 1);
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
$scope.addDevice = function() {
|
|
|
|
|
$scope.config.HostConfig.Devices.push({ pathOnHost: '', pathInContainer: '' });
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
$scope.removeDevice = function(index) {
|
|
|
|
|
$scope.config.HostConfig.Devices.splice(index, 1);
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
Config.$promise.then(function (c) {
|
|
|
|
|
var containersToHideLabels = c.hiddenLabels;
|
|
|
|
@ -276,6 +284,19 @@ function ($scope, $state, $stateParams, $filter, Config, Info, Container, Contai
|
|
|
|
|
config.Labels = labels;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function prepareDevices(config) {
|
|
|
|
|
var path = [];
|
|
|
|
|
config.HostConfig.Devices.forEach(function (p) {
|
|
|
|
|
if (p.pathOnHost) {
|
|
|
|
|
if(p.pathInContainer === '') {
|
|
|
|
|
p.pathInContainer = p.pathOnHost;
|
|
|
|
|
}
|
|
|
|
|
path.push({PathOnHost:p.pathOnHost,PathInContainer:p.pathInContainer,CgroupPermissions:'rwm'});
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
config.HostConfig.Devices = path;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function prepareConfiguration() {
|
|
|
|
|
var config = angular.copy($scope.config);
|
|
|
|
|
config.Cmd = ContainerHelper.commandStringToArray(config.Cmd);
|
|
|
|
@ -286,6 +307,7 @@ function ($scope, $state, $stateParams, $filter, Config, Info, Container, Contai
|
|
|
|
|
prepareEnvironmentVariables(config);
|
|
|
|
|
prepareVolumes(config);
|
|
|
|
|
prepareLabels(config);
|
|
|
|
|
prepareDevices(config);
|
|
|
|
|
return config;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|