fix(container-console): fix an issue with scrollbar (#932) (#1086)

pull/1092/head
Liam Cottam 2017-08-04 07:02:26 +01:00 committed by Anthony Lapenna
parent 86c450bd91
commit cf5c3ee536
2 changed files with 8 additions and 1 deletions

View File

@ -38,7 +38,7 @@ function ($scope, $stateParams, Container, Image, EndpointProvider, Notification
$scope.connect = function() {
$('#loadConsoleSpinner').show();
var termWidth = Math.round($('#terminal-container').width() / 8.2);
var termWidth = Math.floor(($('#terminal-container').width() - 20) / 8.39);
var termHeight = 30;
var command = $scope.formValues.isCustomCommand ?
$scope.formValues.customCommand : $scope.formValues.command;
@ -97,6 +97,11 @@ function ($scope, $stateParams, Container, Image, EndpointProvider, Notification
term.open(document.getElementById('terminal-container'), true);
term.resize(width, height);
term.setOption('cursorBlink', true);
term.fit();
window.onresize = function() {
term.fit();
};
socket.onmessage = function (e) {
term.write(e.data);

View File

@ -12,6 +12,7 @@ js:
- bower_components/splitargs/src/splitargs.js
- bower_components/toastr/toastr.js
- bower_components/xterm.js/dist/xterm.js
- bower_components/xterm.js/dist/addons/fit/fit.js
- assets/js/legend.js
minified:
- bower_components/jquery/dist/jquery.min.js
@ -25,6 +26,7 @@ js:
- bower_components/splitargs/src/splitargs.js
- bower_components/toastr/toastr.min.js
- bower_components/xterm.js/dist/xterm.js
- bower_components/xterm.js/dist/addons/fit/fit.js
- assets/js/legend.js
css:
regular: