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

#592 feat(container-details): rename console to exec and add attach console

This commit is contained in:
Tilman Vatteroth 2019-04-20 17:18:33 +02:00
parent ff59f2d85f
commit f2deaee110
13 changed files with 258 additions and 25 deletions

View file

@ -0,0 +1,27 @@
angular.module('portainer.docker')
.factory('AttachService', ['$q', '$timeout', 'Container', function AttachServiceFactory($q, $timeout, Container) {
'use strict';
var service = {};
service.resizeTTY = function(execId, height, width, timeout) {
var deferred = $q.defer();
$timeout(function() {
Container.resize({}, { id: execId, height: height, width: width }).$promise
.then(function success(data) {
if (data.message) {
deferred.reject({ msg: 'Unable to attach to container', err: data.message });
} else {
deferred.resolve(data);
}
})
.catch(function error(err) {
deferred.reject({ msg: 'Unable to attach to container', err: err });
});
}, timeout);
return deferred.promise;
};
return service;
}]);