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

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

index 885cf1169197d71069ceac4b944891dd0f18adfc..b7210d4d2b920eb55f4fa7b0835c5cff4a91872b 100644 (file)
@@ -624,6 +624,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 => { 
@@ -691,6 +705,14 @@ __PACKAGE__->register_method ({
                   '-timeout', $timeout, '-authpath', $authpath, 
                   '-perm', 'Sys.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';