Browse Source

默认terminal大小100x35

pull/195/head
liuzheng712 9 years ago
parent
commit
aabab653d3
  1. 4
      run_server.py
  2. 4
      static/js/record.js
  3. 12
      static/js/webterminal.js

4
run_server.py

@ -366,8 +366,8 @@ class WebTerminalHandler(tornado.websocket.WebSocketHandler):
if 'resize' in jsondata.get('data'): if 'resize' in jsondata.get('data'):
self.termlog.write(message) self.termlog.write(message)
self.channel.resize_pty( self.channel.resize_pty(
width=int(jsondata.get('data').get('resize').get('cols', 80)), width=int(jsondata.get('data').get('resize').get('cols', 100)),
height=int(jsondata.get('data').get('resize').get('rows', 24)) height=int(jsondata.get('data').get('resize').get('rows', 35))
) )
elif jsondata.get('data'): elif jsondata.get('data'):
self.termlog.recoder = True self.termlog.recoder = True

4
static/js/record.js

@ -108,8 +108,8 @@ NgApp.controller('TerminalRecordCtrl', function ($scope, $http) {
}; };
var term = new Terminal({ var term = new Terminal({
rows: 24, rows: 35,
cols: 80, cols: 100,
useStyle: true, useStyle: true,
screenKeys: true screenKeys: true
}); });

12
static/js/webterminal.js

@ -60,11 +60,11 @@ function openTerminal(options) {
rowHeight = localStorage.getItem('term-row'); rowHeight = localStorage.getItem('term-row');
colWidth = localStorage.getItem('term-col'); colWidth = localStorage.getItem('term-col');
} catch (err) { } catch (err) {
rowHeight = 24; rowHeight = 35;
colWidth = 80 colWidth = 100
} }
if(rowHeight){}else{rowHeight=24}; if(rowHeight){}else{rowHeight=35};
if(colWidth){}else{colWidth=80}; if(colWidth){}else{colWidth=100};
var term = new Terminal({ var term = new Terminal({
rows: rowHeight, rows: rowHeight,
@ -128,8 +128,8 @@ $(document).ready(function () {
$('#term-row')[0].value = localStorage.getItem('term-row'); $('#term-row')[0].value = localStorage.getItem('term-row');
$('#term-col')[0].value = localStorage.getItem('term-col'); $('#term-col')[0].value = localStorage.getItem('term-col');
} catch (err) { } catch (err) {
$('#term-row')[0].value = 24; $('#term-row')[0].value = 35;
$('#term-col')[0].value = 80; $('#term-col')[0].value = 100;
} }
$('#col-row').click(function () { $('#col-row').click(function () {
var col = $('#term-col').val(); var col = $('#term-col').val();

Loading…
Cancel
Save