mirror of https://github.com/portainer/portainer
fix kubectl terminal not showing bottom line in some browser (#5444)
parent
80465367a5
commit
0ff9d49c6f
|
@ -39,6 +39,7 @@ export default class KubectlShellController {
|
||||||
}
|
}
|
||||||
|
|
||||||
configureSocketAndTerminal(socket, term) {
|
configureSocketAndTerminal(socket, term) {
|
||||||
|
var vm = this;
|
||||||
socket.onopen = function () {
|
socket.onopen = function () {
|
||||||
const terminal_container = document.getElementById('terminal-container');
|
const terminal_container = document.getElementById('terminal-container');
|
||||||
term.open(terminal_container);
|
term.open(terminal_container);
|
||||||
|
@ -55,7 +56,7 @@ export default class KubectlShellController {
|
||||||
});
|
});
|
||||||
|
|
||||||
this.$window.onresize = function () {
|
this.$window.onresize = function () {
|
||||||
term.fit();
|
vm.TerminalWindow.terminalresize();
|
||||||
};
|
};
|
||||||
|
|
||||||
socket.onmessage = function (msg) {
|
socket.onmessage = function (msg) {
|
||||||
|
|
|
@ -60,7 +60,7 @@ ul.sidebar li .shell-item-center a:hover {
|
||||||
bottom: 0;
|
bottom: 0;
|
||||||
left: 0;
|
left: 0;
|
||||||
width: 100vw;
|
width: 100vw;
|
||||||
height: 480px;
|
height: 495px;
|
||||||
z-index: 1000;
|
z-index: 1000;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
angular.module('portainer').service('TerminalWindow', function ($window) {
|
angular.module('portainer').service('TerminalWindow', function ($window) {
|
||||||
|
const terminalHeight = 495;
|
||||||
this.terminalopen = function () {
|
this.terminalopen = function () {
|
||||||
const terminalHeight = 480;
|
|
||||||
const contentWrapperHeight = $window.innerHeight;
|
const contentWrapperHeight = $window.innerHeight;
|
||||||
const newContentWrapperHeight = contentWrapperHeight - terminalHeight;
|
const newContentWrapperHeight = contentWrapperHeight - terminalHeight;
|
||||||
document.getElementById('content-wrapper').style.height = newContentWrapperHeight + 'px';
|
document.getElementById('content-wrapper').style.height = newContentWrapperHeight + 'px';
|
||||||
|
@ -16,4 +16,11 @@ angular.module('portainer').service('TerminalWindow', function ($window) {
|
||||||
document.getElementById('content-wrapper').style.overflowY = wrapperCSS.overflowY;
|
document.getElementById('content-wrapper').style.overflowY = wrapperCSS.overflowY;
|
||||||
document.getElementById('sidebar-wrapper').style.height = wrapperCSS.height;
|
document.getElementById('sidebar-wrapper').style.height = wrapperCSS.height;
|
||||||
};
|
};
|
||||||
|
this.terminalresize = function () {
|
||||||
|
const contentWrapperHeight = $window.innerHeight;
|
||||||
|
const newContentWrapperHeight = contentWrapperHeight - terminalHeight;
|
||||||
|
document.getElementById('content-wrapper').style.height = newContentWrapperHeight + 'px';
|
||||||
|
document.getElementById('content-wrapper').style.overflowY = 'auto';
|
||||||
|
document.getElementById('sidebar-wrapper').style.height = newContentWrapperHeight + 'px';
|
||||||
|
};
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in New Issue