1
0
Fork 0
mirror of https://github.com/portainer/portainer.git synced 2025-08-02 12:25:22 +02:00

Move startContainer to its own submodule.

This commit is contained in:
Kevan Ahlquist 2014-11-12 12:31:02 -06:00
parent 3a28cb9889
commit 57fef1c958
5 changed files with 49 additions and 47 deletions

View file

@ -67,52 +67,6 @@ function SettingsController($scope, System, Docker, Settings, Messages) {
System.get({}, function(d) { $scope.info = d; });
}
function StartContainerController($scope, $routeParams, $location, Container, Messages) {
$scope.template = 'partials/startcontainer.html';
$scope.config = {
name: '',
memory: 0,
memorySwap: 0,
cpuShares: 1024,
env: '',
commands: '',
volumesFrom: ''
};
$scope.commandPlaceholder = '["/bin/echo", "Hello world"]';
$scope.create = function() {
var cmds = null;
if ($scope.config.commands !== '') {
cmds = angular.fromJson($scope.config.commands);
}
var id = $routeParams.id;
var ctor = Container;
var loc = $location;
var s = $scope;
Container.create({
Image: id,
name: $scope.config.name,
Memory: $scope.config.memory,
MemorySwap: $scope.config.memorySwap,
CpuShares: $scope.config.cpuShares,
Cmd: cmds,
VolumesFrom: $scope.config.volumesFrom
}, function(d) {
if (d.Id) {
ctor.start({id: d.Id}, function(cd) {
$('#create-modal').modal('hide');
loc.path('/containers/' + d.Id + '/');
}, function(e) {
failedRequestHandler(e, Messages);
});
}
}, function(e) {
failedRequestHandler(e, Messages);
});
};
}
function BuilderController($scope, Dockerfile, Messages) {
$scope.template = 'partials/builder.html';
}