mirror of https://github.com/portainer/portainer
Adding commit button
parent
2bc6b2995d
commit
968efed6c3
|
@ -40,6 +40,10 @@
|
||||||
ng-click="unpause()"
|
ng-click="unpause()"
|
||||||
ng-show="container.State.Running && container.State.Paused">Unpause
|
ng-show="container.State.Running && container.State.Paused">Unpause
|
||||||
</button>
|
</button>
|
||||||
|
<button class="btn btn-primary"
|
||||||
|
ng-click="commit()"
|
||||||
|
ng-show="container.State.Running && !container.State.Paused">Commit
|
||||||
|
</button>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<table class="table table-striped">
|
<table class="table table-striped">
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
angular.module('container', [])
|
angular.module('container', [])
|
||||||
.controller('ContainerController', ['$scope', '$routeParams', '$location', 'Container', 'Messages', 'ViewSpinner',
|
.controller('ContainerController', ['$scope', '$routeParams', '$location', 'Container', 'ContainerCommit', 'Messages', 'ViewSpinner',
|
||||||
function($scope, $routeParams, $location, Container, Messages, ViewSpinner) {
|
function($scope, $routeParams, $location, Container, ContainerCommit, Messages, ViewSpinner) {
|
||||||
$scope.changes = [];
|
$scope.changes = [];
|
||||||
$scope.edit = false;
|
$scope.edit = false;
|
||||||
|
|
||||||
|
@ -58,6 +58,16 @@ function($scope, $routeParams, $location, Container, Messages, ViewSpinner) {
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
$scope.commit = function() {
|
||||||
|
ViewSpinner.spin();
|
||||||
|
ContainerCommit.commit({id: $routeParams.id, repo: $scope.container.Config.Image}, function(d) {
|
||||||
|
update();
|
||||||
|
Messages.send("Container commited", $routeParams.id);
|
||||||
|
}, function(e) {
|
||||||
|
update();
|
||||||
|
Messages.error("Failure", "Container failed to commit." + e.data);
|
||||||
|
});
|
||||||
|
};
|
||||||
$scope.pause = function() {
|
$scope.pause = function() {
|
||||||
ViewSpinner.spin();
|
ViewSpinner.spin();
|
||||||
Container.pause({id: $routeParams.id}, function(d) {
|
Container.pause({id: $routeParams.id}, function(d) {
|
||||||
|
|
|
@ -20,6 +20,23 @@ angular.module('dockerui.services', ['ngResource'])
|
||||||
rename: {method: 'POST', params: {id: '@id', action: 'rename'}, isArray: false}
|
rename: {method: 'POST', params: {id: '@id', action: 'rename'}, isArray: false}
|
||||||
});
|
});
|
||||||
})
|
})
|
||||||
|
.factory('ContainerCommit', function ($resource, $http, Settings) {
|
||||||
|
'use strict';
|
||||||
|
return {
|
||||||
|
commit: function (params, callback) {
|
||||||
|
$http({
|
||||||
|
method: 'POST',
|
||||||
|
url: Settings.url + '/commit',
|
||||||
|
params: {
|
||||||
|
'container': params.id,
|
||||||
|
'repo': params.repo
|
||||||
|
}
|
||||||
|
}).success(callback).error(function (data, status, headers, config) {
|
||||||
|
console.log(error, data);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
};
|
||||||
|
})
|
||||||
.factory('ContainerLogs', function ($resource, $http, Settings) {
|
.factory('ContainerLogs', function ($resource, $http, Settings) {
|
||||||
'use strict';
|
'use strict';
|
||||||
return {
|
return {
|
||||||
|
|
Loading…
Reference in New Issue