diff --git a/js/controllers.js b/js/controllers.js index 8b6db4ef3..7e91f0bed 100644 --- a/js/controllers.js +++ b/js/controllers.js @@ -255,17 +255,21 @@ function ImageController($scope, $routeParams, $location, Image) { function StartContainerController($scope, $routeParams, $location, Container) { $scope.template = 'partials/startcontainer.html'; - $scope.memory = 0; - $scope.memorySwap = 0; - $scope.env = ''; - $scope.dns = ''; - $scope.volumesFrom = ''; - $scope.commands = ''; + $scope.config = { + memory: 0, + memorySwap: 0, + env: '', + commands: '', + volumesFrom: '' + }; + $scope.commandPlaceholder = '["/bin/echo", "Hello world"]'; $scope.launchContainer = function() { + $scope.response = ''; + var cmds = null; - if ($scope.commands !== '') { - cmds = $scope.commands.split('\n'); + if ($scope.config.commands !== '') { + cmds = angular.fromJson($scope.config.commands); } var id = $routeParams.id; var ctor = Container; @@ -274,10 +278,10 @@ function StartContainerController($scope, $routeParams, $location, Container) { Container.create({ Image: id, - Memory: $scope.memory, - MemorySwap: $scope.memorySwap, + Memory: $scope.config.memory, + MemorySwap: $scope.config.memorySwap, Cmd: cmds, - VolumesFrom: $scope.volumesFrom + VolumesFrom: $scope.config.volumesFrom }, function(d) { console.log(d); if (d.Id) { diff --git a/partials/image.html b/partials/image.html index 1b1924d77..5692d5235 100644 --- a/partials/image.html +++ b/partials/image.html @@ -68,7 +68,7 @@
Tag image - + diff --git a/partials/startcontainer.html b/partials/startcontainer.html index 98a81f608..0cef79c27 100644 --- a/partials/startcontainer.html +++ b/partials/startcontainer.html @@ -9,17 +9,16 @@ Start container from Image - - Place each command on a new line - + + Input commands as an array - + - + - +