mirror of https://github.com/portainer/portainer
refactor(containers) : remove duplicate base URL assignment
parent
549ee0a945
commit
c138e90210
|
@ -23,6 +23,10 @@ angular.module('portainer.docker').controller('ContainerConsoleController', [
|
||||||
connected: 2,
|
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.loaded = false;
|
||||||
$scope.states = states;
|
$scope.states = states;
|
||||||
$scope.state = states.disconnected;
|
$scope.state = states.disconnected;
|
||||||
|
@ -57,7 +61,6 @@ angular.module('portainer.docker').controller('ContainerConsoleController', [
|
||||||
id: attachId,
|
id: attachId,
|
||||||
};
|
};
|
||||||
|
|
||||||
const base = window.location.origin.startsWith('http') && !window.ddExtension ? `${window.location.origin}${baseHref()}` : baseHref();
|
|
||||||
var url =
|
var url =
|
||||||
base +
|
base +
|
||||||
'api/websocket/attach?' +
|
'api/websocket/attach?' +
|
||||||
|
@ -96,7 +99,6 @@ angular.module('portainer.docker').controller('ContainerConsoleController', [
|
||||||
id: data.Id,
|
id: data.Id,
|
||||||
};
|
};
|
||||||
|
|
||||||
const base = window.location.origin.startsWith('http') && !window.ddExtension ? `${window.location.origin}${baseHref()}` : baseHref();
|
|
||||||
var url =
|
var url =
|
||||||
base +
|
base +
|
||||||
'api/websocket/exec?' +
|
'api/websocket/exec?' +
|
||||||
|
|
Loading…
Reference in New Issue