fix(container-console): use xterm.js v2 (#262)

pull/263/head
Anthony Lapenna 8 years ago committed by GitHub
parent 8f7f4acc0d
commit 134416c9a3

@ -82,16 +82,14 @@ function ($scope, $stateParams, Settings, Container, Exec, $timeout, Messages) {
$scope.connected = true; $scope.connected = true;
socket.onopen = function(evt) { socket.onopen = function(evt) {
$('#loadConsoleSpinner').hide(); $('#loadConsoleSpinner').hide();
term = new Terminal({ term = new Terminal();
cols: width,
rows: height,
cursorBlink: true
});
term.on('data', function (data) { term.on('data', function (data) {
socket.send(data); socket.send(data);
}); });
term.open(document.getElementById('terminal-container')); term.open(document.getElementById('terminal-container'));
term.resize(width, height);
term.setOption('cursorBlink', true);
socket.onmessage = function (e) { socket.onmessage = function (e) {
term.write(e.data); term.write(e.data);
@ -102,8 +100,6 @@ function ($scope, $stateParams, Settings, Container, Exec, $timeout, Messages) {
}; };
socket.onclose = function(evt) { socket.onclose = function(evt) {
$scope.connected = false; $scope.connected = false;
// term.write("Session terminated");
// term.destroy();
}; };
}; };
} }

@ -41,7 +41,7 @@
"lodash": "4.12.0", "lodash": "4.12.0",
"rdash-ui": "1.0.*", "rdash-ui": "1.0.*",
"moment": "~2.14.1", "moment": "~2.14.1",
"xterm.js": "~1.1.3" "xterm.js": "~2.0.1"
}, },
"resolutions": { "resolutions": {
"angular": "1.5.5" "angular": "1.5.5"

@ -73,7 +73,7 @@ module.exports = function (grunt) {
'bower_components/lodash/dist/lodash.min.js', 'bower_components/lodash/dist/lodash.min.js',
'bower_components/filesize/lib/filesize.min.js', 'bower_components/filesize/lib/filesize.min.js',
'bower_components/moment/min/moment.min.js', 'bower_components/moment/min/moment.min.js',
'bower_components/xterm.js/src/xterm.js', 'bower_components/xterm.js/dist/xterm.js',
'assets/js/jquery.gritter.js', // Using custom version to fix error in minified build due to "use strict" 'assets/js/jquery.gritter.js', // Using custom version to fix error in minified build due to "use strict"
'assets/js/legend.js' // Not a bower package 'assets/js/legend.js' // Not a bower package
], ],
@ -88,7 +88,7 @@ module.exports = function (grunt) {
'bower_components/font-awesome/css/font-awesome.min.css', 'bower_components/font-awesome/css/font-awesome.min.css',
'bower_components/rdash-ui/dist/css/rdash.min.css', 'bower_components/rdash-ui/dist/css/rdash.min.css',
'bower_components/angular-ui-select/dist/select.min.css', 'bower_components/angular-ui-select/dist/select.min.css',
'bower_components/xterm.js/src/xterm.css', 'bower_components/xterm.js/dist/xterm.css',
'bower_components/Hover/css/hover-min.css' 'bower_components/Hover/css/hover-min.css'
] ]
}, },

Loading…
Cancel
Save