|
|
@ -7,7 +7,8 @@ function ($scope, $state, $stateParams, $filter, Config, Info, Container, Contai
|
|
|
|
Console: 'none',
|
|
|
|
Console: 'none',
|
|
|
|
Volumes: [],
|
|
|
|
Volumes: [],
|
|
|
|
Registry: '',
|
|
|
|
Registry: '',
|
|
|
|
NetworkContainer: ''
|
|
|
|
NetworkContainer: '',
|
|
|
|
|
|
|
|
Labels: []
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
$scope.imageConfig = {};
|
|
|
|
$scope.imageConfig = {};
|
|
|
@ -24,7 +25,8 @@ function ($scope, $state, $stateParams, $filter, Config, Info, Container, Contai
|
|
|
|
Binds: [],
|
|
|
|
Binds: [],
|
|
|
|
NetworkMode: 'bridge',
|
|
|
|
NetworkMode: 'bridge',
|
|
|
|
Privileged: false
|
|
|
|
Privileged: false
|
|
|
|
}
|
|
|
|
},
|
|
|
|
|
|
|
|
Labels: {}
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
$scope.addVolume = function() {
|
|
|
|
$scope.addVolume = function() {
|
|
|
@ -51,6 +53,14 @@ function ($scope, $state, $stateParams, $filter, Config, Info, Container, Contai
|
|
|
|
$scope.config.HostConfig.PortBindings.splice(index, 1);
|
|
|
|
$scope.config.HostConfig.PortBindings.splice(index, 1);
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$scope.addLabel = function() {
|
|
|
|
|
|
|
|
$scope.formValues.Labels.push({ name: '', value: ''});
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$scope.removeLabel = function(index) {
|
|
|
|
|
|
|
|
$scope.formValues.Labels.splice(index, 1);
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
Config.$promise.then(function (c) {
|
|
|
|
Config.$promise.then(function (c) {
|
|
|
|
$scope.swarm = c.swarm;
|
|
|
|
$scope.swarm = c.swarm;
|
|
|
|
var containersToHideLabels = c.hiddenLabels;
|
|
|
|
var containersToHideLabels = c.hiddenLabels;
|
|
|
@ -222,6 +232,16 @@ function ($scope, $state, $stateParams, $filter, Config, Info, Container, Contai
|
|
|
|
config.HostConfig.NetworkMode = networkMode;
|
|
|
|
config.HostConfig.NetworkMode = networkMode;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function prepareLabels(config) {
|
|
|
|
|
|
|
|
var labels = {};
|
|
|
|
|
|
|
|
$scope.formValues.Labels.forEach(function (label) {
|
|
|
|
|
|
|
|
if (label.name && label.value) {
|
|
|
|
|
|
|
|
labels[label.name] = label.value;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
config.Labels = labels;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
function prepareConfiguration() {
|
|
|
|
function prepareConfiguration() {
|
|
|
|
var config = angular.copy($scope.config);
|
|
|
|
var config = angular.copy($scope.config);
|
|
|
|
prepareNetworkConfig(config);
|
|
|
|
prepareNetworkConfig(config);
|
|
|
@ -230,6 +250,7 @@ function ($scope, $state, $stateParams, $filter, Config, Info, Container, Contai
|
|
|
|
prepareConsole(config);
|
|
|
|
prepareConsole(config);
|
|
|
|
prepareEnvironmentVariables(config);
|
|
|
|
prepareEnvironmentVariables(config);
|
|
|
|
prepareVolumes(config);
|
|
|
|
prepareVolumes(config);
|
|
|
|
|
|
|
|
prepareLabels(config);
|
|
|
|
return config;
|
|
|
|
return config;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|