|
|
@ -255,17 +255,21 @@ function ImageController($scope, $routeParams, $location, Image) {
|
|
|
|
|
|
|
|
|
|
|
|
function StartContainerController($scope, $routeParams, $location, Container) {
|
|
|
|
function StartContainerController($scope, $routeParams, $location, Container) {
|
|
|
|
$scope.template = 'partials/startcontainer.html';
|
|
|
|
$scope.template = 'partials/startcontainer.html';
|
|
|
|
$scope.memory = 0;
|
|
|
|
$scope.config = {
|
|
|
|
$scope.memorySwap = 0;
|
|
|
|
memory: 0,
|
|
|
|
$scope.env = '';
|
|
|
|
memorySwap: 0,
|
|
|
|
$scope.dns = '';
|
|
|
|
env: '',
|
|
|
|
$scope.volumesFrom = '';
|
|
|
|
commands: '',
|
|
|
|
$scope.commands = '';
|
|
|
|
volumesFrom: ''
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
$scope.commandPlaceholder = '["/bin/echo", "Hello world"]';
|
|
|
|
|
|
|
|
|
|
|
|
$scope.launchContainer = function() {
|
|
|
|
$scope.launchContainer = function() {
|
|
|
|
|
|
|
|
$scope.response = '';
|
|
|
|
|
|
|
|
|
|
|
|
var cmds = null;
|
|
|
|
var cmds = null;
|
|
|
|
if ($scope.commands !== '') {
|
|
|
|
if ($scope.config.commands !== '') {
|
|
|
|
cmds = $scope.commands.split('\n');
|
|
|
|
cmds = angular.fromJson($scope.config.commands);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
var id = $routeParams.id;
|
|
|
|
var id = $routeParams.id;
|
|
|
|
var ctor = Container;
|
|
|
|
var ctor = Container;
|
|
|
@ -274,10 +278,10 @@ function StartContainerController($scope, $routeParams, $location, Container) {
|
|
|
|
|
|
|
|
|
|
|
|
Container.create({
|
|
|
|
Container.create({
|
|
|
|
Image: id,
|
|
|
|
Image: id,
|
|
|
|
Memory: $scope.memory,
|
|
|
|
Memory: $scope.config.memory,
|
|
|
|
MemorySwap: $scope.memorySwap,
|
|
|
|
MemorySwap: $scope.config.memorySwap,
|
|
|
|
Cmd: cmds,
|
|
|
|
Cmd: cmds,
|
|
|
|
VolumesFrom: $scope.volumesFrom
|
|
|
|
VolumesFrom: $scope.config.volumesFrom
|
|
|
|
}, function(d) {
|
|
|
|
}, function(d) {
|
|
|
|
console.log(d);
|
|
|
|
console.log(d);
|
|
|
|
if (d.Id) {
|
|
|
|
if (d.Id) {
|
|
|
|