mirror of https://github.com/portainer/portainer
feat(console): add protocol awareness to switch between ws:// and wss:// (#135)
parent
b098cd5638
commit
ccb812cc33
|
@ -36,7 +36,12 @@ function ($scope, $stateParams, Settings, Container, Exec, $timeout, Messages, e
|
||||||
if (d.Id) {
|
if (d.Id) {
|
||||||
var execId = d.Id;
|
var execId = d.Id;
|
||||||
resizeTTY(execId, termHeight, termWidth);
|
resizeTTY(execId, termHeight, termWidth);
|
||||||
var url = window.location.href.split('#')[0].replace('http://', 'ws://') + 'ws/exec?id=' + execId;
|
var url = window.location.href.split('#')[0] + 'ws/exec?id=' + execId;
|
||||||
|
if (url.indexOf('https') > -1) {
|
||||||
|
url = url.replace('https://', 'wss://');
|
||||||
|
} else {
|
||||||
|
url = url.replace('http://', 'ws://');
|
||||||
|
}
|
||||||
initTerm(url, termHeight, termWidth);
|
initTerm(url, termHeight, termWidth);
|
||||||
} else {
|
} else {
|
||||||
$('#loadConsoleSpinner').hide();
|
$('#loadConsoleSpinner').hide();
|
||||||
|
|
Loading…
Reference in New Issue