]> git.proxmox.com Git - pve-manager.git/commitdiff
pveproxy: allow to request debug sources directly over GET parameter
authorThomas Lamprecht <t.lamprecht@proxmox.com>
Tue, 9 Jul 2019 13:06:34 +0000 (15:06 +0200)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Tue, 9 Jul 2019 13:07:41 +0000 (15:07 +0200)
Avoids the need to stop the current pveproxy and restart it in debug
mode, if one wants to get the debug un-minified sources for ExtJS,
for example.

For a local PVE instance the following URL would ensure you load the
debug sources:
https://localhost:8006/?debug#v1:0:18:4:25:19::8:20:28

For convenience allow to omit the parameters value, and default to
true, iow, ?debug and ?debug=1 are the same, one could force it off -
even if the server was started in debug mode - by using ?debug=0

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
PVE/Service/pveproxy.pm

index 4a515707b9a6a295ced8ed2e0161d2d49bffc1a8..a07330c4399b8e173f99ae2aeaa25ced99b37162 100755 (executable)
@@ -220,6 +220,11 @@ sub get_index {
        $wtversion = $1;
     };
 
+    my $debug = $server->{debug};
+    if (exists $args->{debug}) {
+       $debug = !defined($args->{debug}) || $args->{debug};
+    }
+
     my $vars = {
        lang => $lang,
        langfile => $langfile,
@@ -227,7 +232,7 @@ sub get_index {
        token => $token,
        console => $args->{console},
        nodename => $nodename,
-       debug => $server->{debug},
+       debug => $debug,
        version => "$version",
        wtversion => $wtversion,
     };