2024-06-10 18:54:31 +00:00
|
|
|
import { resizeTTY } from '@/react/docker/proxy/queries/useExecResizeTTYMutation';
|
2017-07-13 16:04:58 +00:00
|
|
|
|
2024-06-10 18:54:31 +00:00
|
|
|
angular.module('portainer.docker').factory('ExecService', ExecServiceFactory);
|
2017-07-13 16:04:58 +00:00
|
|
|
|
2024-06-10 18:54:31 +00:00
|
|
|
/* @ngInject */
|
|
|
|
function ExecServiceFactory(AngularToReact) {
|
|
|
|
const { useAxios, injectEnvironmentId } = AngularToReact;
|
2017-07-13 16:04:58 +00:00
|
|
|
|
2024-06-10 18:54:31 +00:00
|
|
|
return {
|
|
|
|
resizeTTY: useAxios(injectEnvironmentId(resizeTTYAngularJS)),
|
|
|
|
};
|
2017-07-13 16:04:58 +00:00
|
|
|
|
2024-06-10 18:54:31 +00:00
|
|
|
/**
|
|
|
|
* @param {EnvironmentId} environmentId Injected
|
|
|
|
* @param {string} execId
|
|
|
|
* @param {number} width
|
|
|
|
* @param {number} height
|
|
|
|
* @param timeout DEPRECATED: Previously used in pure AJS implementation
|
|
|
|
*/
|
|
|
|
async function resizeTTYAngularJS(environmentId, execId, width, height) {
|
|
|
|
return resizeTTY(environmentId, execId, { width, height });
|
|
|
|
}
|
|
|
|
}
|