refactor(containers) : remove duplicate base URL assignment

pull/12191/head
강지원 4 weeks ago
parent 549ee0a945
commit c138e90210

@ -23,6 +23,10 @@ angular.module('portainer.docker').controller('ContainerConsoleController', [
connected: 2,
});
const isHttpOrigin = window.location.origin.startsWith('http');
const isNotDdExtension = !window.ddExtension;
const base = isHttpOrigin && isNotDdExtension ? `${window.location.origin}${baseHref()}` : baseHref();
$scope.loaded = false;
$scope.states = states;
$scope.state = states.disconnected;
@ -57,7 +61,6 @@ angular.module('portainer.docker').controller('ContainerConsoleController', [
id: attachId,
};
const base = window.location.origin.startsWith('http') && !window.ddExtension ? `${window.location.origin}${baseHref()}` : baseHref();
var url =
base +
'api/websocket/attach?' +
@ -96,7 +99,6 @@ angular.module('portainer.docker').controller('ContainerConsoleController', [
id: data.Id,
};
const base = window.location.origin.startsWith('http') && !window.ddExtension ? `${window.location.origin}${baseHref()}` : baseHref();
var url =
base +
'api/websocket/exec?' +

Loading…
Cancel
Save