mirror of
https://github.com/webmin/webmin.git
synced 2026-02-03 06:03:28 +00:00
Add ability to adjust font size in terminal module
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
xterm=xterm-256color
|
||||
fontsize=15
|
||||
base_port=555
|
||||
rcfile=0
|
||||
locale=0
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
xterm=Set <tt>TERM</tt> environmental variable to,4,xterm+256color-xterm-256color,xterm+16color-xterm-16color,xterm-xterm,vt102-vt102,vt100-vt100,vt52-vt52,rxvt-rxvt,nsterm-nsterm,dtterm-dtterm,ansi-ansi
|
||||
size=Terminal width and height in characters,3,Automatic,5,,,Static (80x24)
|
||||
fontsize=Adjust font size,4,0-Auto,12-Small,15-Normal,18-Large,21-Huge
|
||||
locale=Set shell character encoding,10,0-Shell default,1-<tt>en_US.UTF-8</tt>,Custom
|
||||
rcfile=Execute initialization commands from file,10,0-Shell default,1-Module default,Custom
|
||||
screen_reader=Enable screen reader mode,1,true-Yes,false-No
|
||||
|
||||
@@ -55,6 +55,7 @@ my $def_cols_n = 80;
|
||||
my $def_rows_n = 24;
|
||||
my $xmlhr = $ENV{'HTTP_X_REQUESTED_WITH'} eq "XMLHttpRequest";
|
||||
my %term_opts;
|
||||
my $font_size = $config{'fontsize'} || 15;
|
||||
|
||||
# Parse module config
|
||||
my ($conf_cols_n, $conf_rows_n) = ($conf_size_str =~ /([\d]+)X([\d]+)/i);
|
||||
@@ -74,7 +75,9 @@ if ($conf_cols_n && $conf_rows_n && !$xmlhr) {
|
||||
|
||||
# Define columns and rows
|
||||
my $conf_screen_reader = $config{'screen_reader'} eq 'true' ? 'true' : 'false';
|
||||
$termjs_opts{'Options'} = "{ cols: $env_cols, rows: $env_rows, screenReaderMode: $conf_screen_reader }";
|
||||
$termjs_opts{'Options'} = "{ cols: $env_cols, rows: $env_rows, ".
|
||||
"screenReaderMode: $conf_screen_reader, ".
|
||||
"fontSize: $font_size }";
|
||||
|
||||
my $term_size = "
|
||||
min-width: ".($conf_cols_n ? "".($conf_cols_n * 9)."px" : "calc(100vw - 22px)").";
|
||||
|
||||
Reference in New Issue
Block a user