mirror of
https://github.com/webmin/webmin.git
synced 2026-03-20 08:40:24 +00:00
Drop rows and columns as terminal will fit the container automatically
This commit is contained in:
@@ -1,3 +1 @@
|
||||
base_port=555
|
||||
cols=80
|
||||
rows=24
|
||||
|
||||
@@ -1,3 +1 @@
|
||||
base_port=Base port number for Websockets connections,0,5
|
||||
cols=Terminal width in characters,0,5
|
||||
rows=Terminal height in characters,0,5
|
||||
|
||||
@@ -61,15 +61,9 @@ print &ui_table_row(undef, "<div id=terminal></div>", 2);
|
||||
print &ui_table_end();
|
||||
print "</center>\n";
|
||||
my $url = "wss://".$ENV{'HTTP_HOST'}.$wspath;
|
||||
my $rows = $config{'rows'} || 24;
|
||||
my $cols = $config{'cols'} || 80;
|
||||
print <<EOF;
|
||||
<script>
|
||||
var term = new Terminal({
|
||||
rows: $rows,
|
||||
cols: $cols,
|
||||
});
|
||||
term.open(document.getElementById('terminal'));
|
||||
var term = new Terminal();
|
||||
var socket = new WebSocket('$url', 'binary');
|
||||
var attachAddon = new AttachAddon.AttachAddon(socket);
|
||||
term.loadAddon(attachAddon);
|
||||
|
||||
Reference in New Issue
Block a user