1
0
Fork 0
mirror of https://github.com/portainer/portainer.git synced 2025-07-23 07:19:41 +02:00

Use modal for creating a new container

This commit is contained in:
Michael Crosby 2013-06-18 14:28:22 -09:00
parent c3377073e3
commit c4b0a2257f
5 changed files with 62 additions and 35 deletions

View file

@ -195,8 +195,8 @@ function ImageController($scope, $routeParams, $location, Image) {
$scope.getHistory = function() {
Image.history({id: $routeParams.id}, function(d) {
$scope.history = d;
});
$scope.history = d;
});
};
$scope.updateTag = function() {
@ -209,7 +209,11 @@ function ImageController($scope, $routeParams, $location, Image) {
setFailedResponse($scope, e.data, '#response');
});
};
$scope.create = function() {
$('#create-modal').modal('show');
};
Image.get({id: $routeParams.id}, function(d) {
$scope.image = d;
}, function(e) {
@ -234,9 +238,12 @@ function StartContainerController($scope, $routeParams, $location, Container) {
};
$scope.commandPlaceholder = '["/bin/echo", "Hello world"]';
$scope.launchContainer = function() {
$scope.close = function() {
$('#create-modal').modal('hide');
};
$scope.create = function() {
$scope.response = '';
var cmds = null;
if ($scope.config.commands !== '') {
cmds = angular.fromJson($scope.config.commands);
@ -257,6 +264,7 @@ function StartContainerController($scope, $routeParams, $location, Container) {
if (d.Id) {
ctor.start({id: d.Id}, function(cd) {
console.log(cd);
$('#create-modal').modal('hide');
loc.path('/containers/' + d.Id + '/');
}, function(e) {
console.log(e);