]> git.proxmox.com Git - pve-container.git/commitdiff
allow width and height parameter for vncproxy
authorDominik Csapak <d.csapak@proxmox.com>
Wed, 24 May 2017 10:30:48 +0000 (12:30 +0200)
committerWolfgang Bumiller <w.bumiller@proxmox.com>
Fri, 2 Jun 2017 07:15:57 +0000 (09:15 +0200)
so that the novnc console can request a different screen size

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
src/PVE/API2/LXC.pm

index 8db4fab08448e5406486d4055bd36b528443e522..d9ad5ff9cd4db4264eabb44e7f3048fafeb2800f 100644 (file)
@@ -651,6 +651,20 @@ __PACKAGE__->register_method ({
                type => 'boolean',
                description => "use websocket instead of standard VNC.",
            },
+           width => {
+               optional => 1,
+               description => "sets the width of the console in pixels.",
+               type => 'integer',
+               minimum => 16,
+               maximum => 4096,
+           },
+           height => {
+               optional => 1,
+               description => "sets the height of the console in pixels.",
+               type => 'integer',
+               minimum => 16,
+               maximum => 2160,
+           },
        },
     },
     returns => {
@@ -713,6 +727,14 @@ __PACKAGE__->register_method ({
                       '-timeout', $timeout, '-authpath', $authpath,
                       '-perm', 'VM.Console'];
 
+           if ($param->{width}) {
+               push @$cmd, '-width', $param->{width};
+           }
+
+           if ($param->{height}) {
+               push @$cmd, '-height', $param->{height};
+           }
+
            if ($param->{websocket}) {
                $ENV{PVE_VNC_TICKET} = $ticket; # pass ticket to vncterm
                push @$cmd, '-notls', '-listen', 'localhost';