fix(webterminal): url bug

pull/123/head
liuzheng712 2016-03-04 20:21:20 +08:00
parent 94a4d68be2
commit 2bd3fdb4e7
1 changed files with 2 additions and 2 deletions

View File

@ -61,7 +61,7 @@ function openTerminal(options) {
var protocol = 'ws://';
}
var endpoint = protocol + document.URL.match(RegExp('//(.*?)/'))[1] + '/ws/terminal' + document.URL.match(/(\?.*)/);
var endpoint = protocol + document.URL.match(RegExp('//(.*?)/'))[1] + '/ws/terminal' + document.URL.match(/(\?.*)/)[1];
var sock = new WebSocket(endpoint);
//var client = new WSSHClient();
var term = new Terminal({
@ -131,7 +131,7 @@ $(document).ready(function () {
var geom = resize();
console.log(geom);
term_client.term.resize(geom.cols, geom.rows);
term_client.client.send(JSON.stringify({'data':{'resize': {'rows': geom.rows, 'cols': geom.cols}}}));
term_client.client.send(JSON.stringify({'data':{'resize': {'rows': geom.rows, 'cols': geom.cols}});
$('#ssh').show();
}