[pve-devel] [PATCH 2/2] Enhance pveproxy by adding an optional ext5 parameter to load the extjs 5 framework

Emmanuel Kasper e.kasper at proxmox.com
Thu Apr 2 14:51:58 CEST 2015


Calling the pveproxy with https://localhost:8006/?ext5=1 will
load the web ui with the extjs 5 js libs.
Please note that at the momment the workspace does not load with
extjs 5.

Signed-off-by: Emmanuel Kasper <e.kasper at proxmox.com>
---
 PVE/Makefile |  1 +
 bin/pveproxy | 19 ++++++++++++-------
 2 files changed, 13 insertions(+), 7 deletions(-)

diff --git a/PVE/Makefile b/PVE/Makefile
index bb18920..4116e7b 100644
--- a/PVE/Makefile
+++ b/PVE/Makefile
@@ -7,6 +7,7 @@ PERLSOURCE = 			\
 	API2Tools.pm		\
 	API2Client.pm		\
 	ExtJSIndex.pm		\
+	ExtJSIndex5.pm		\
 	TouchIndex.pm		\
 	NoVncIndex.pm		\
 	HTTPServer.pm		\
diff --git a/bin/pveproxy b/bin/pveproxy
index 09d1215..bcec0f9 100755
--- a/bin/pveproxy
+++ b/bin/pveproxy
@@ -22,6 +22,7 @@ use PVE::API2::Formatter::HTML;
 use PVE::HTTPServer;
 
 use PVE::ExtJSIndex;
+use PVE::ExtJSIndex5;
 use PVE::NoVncIndex;
 use PVE::TouchIndex;
 
@@ -204,18 +205,22 @@ sub get_index {
 	$mobile = $args->{mobile} ? 1 : 0;
     }
 
+	my $ext5;
+	if (defined($args->{ext5})) {
+	$ext5 = $args->{ext5} ? 1 : 0;
+    }
+
     my $page;
 
     if (defined($args->{console}) && $args->{novnc}) {
-	$page = PVE::NoVncIndex::get_index($lang, $username, $token, $args->{console});
-    } else {
-	if ($mobile) {
-	    $page = PVE::TouchIndex::get_index($lang, $username, $token, $args->{console});
+		$page = PVE::NoVncIndex::get_index($lang, $username, $token, $args->{console});
+    } elsif ($mobile) {
+		$page = PVE::TouchIndex::get_index($lang, $username, $token, $args->{console});
+	} elsif ($ext5) {
+		$page = PVE::ExtJSIndex5::get_index($lang, $username, $token, $args->{console});
 	} else {
-	    $page = PVE::ExtJSIndex::get_index($lang, $username, $token, $args->{console});
+		$page = PVE::ExtJSIndex::get_index($lang, $username, $token, $args->{console});
 	}
-    }
-
     my $headers = HTTP::Headers->new(Content_Type => "text/html; charset=utf-8");
     my $resp = HTTP::Response->new(200, "OK", $headers, $page); 
 
-- 
2.1.4





More information about the pve-devel mailing list