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'):
self.termlog.write(message)
self.channel.resize_pty(
width=int(jsondata.get('data').get('resize').get('cols', 80)),
height=int(jsondata.get('data').get('resize').get('rows', 24))
width=int(jsondata.get('data').get('resize').get('cols', 100)),
height=int(jsondata.get('data').get('resize').get('rows', 35))
)
elif jsondata.get('data'):
self.termlog.recoder = True

4
static/js/record.js

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

12
static/js/webterminal.js

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

Loading…
Cancel
Save