From 124b9f8d6602de6b00953ee7ba0e4dbcc3758e46 Mon Sep 17 00:00:00 2001 From: Emmanuel Kasper Date: Thu, 2 Apr 2015 14:51:57 +0200 Subject: [PATCH] Add new ExtJSIndex5 package to allow running the pveproxy with two different versions of extjs Signed-off-by: Emmanuel Kasper --- PVE/ExtJSIndex5.pm | 69 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 69 insertions(+) create mode 100644 PVE/ExtJSIndex5.pm diff --git a/PVE/ExtJSIndex5.pm b/PVE/ExtJSIndex5.pm new file mode 100644 index 00000000..ae6b8f98 --- /dev/null +++ b/PVE/ExtJSIndex5.pm @@ -0,0 +1,69 @@ +package PVE::ExtJSIndex5; + +use strict; +use warnings; + +sub get_index { + my ($lang, $username, $csrftoken, $console) = @_; + + my $page = <<_EOD; + + + + + Proxmox Virtual Environment + + + +_EOD + + my $langfile = "/usr/share/pve-manager/locale/pve-lang-${lang}.js"; + if (-f $langfile) { + $page .= ""; + } else { + $page .= ''; + } + + $page .= <<_EOD; + + + +_EOD + + my $jssrc = <<_EOJS; +if (typeof(PVE) === 'undefined') PVE = {}; +PVE.UserName = '$username' +PVE.CSRFPreventionToken = '$csrftoken'; +_EOJS + + my $workspace = defined($console) ? + "PVE.ConsoleWorkspace" : "PVE.StdWorkspace"; + + $jssrc .= <<_EOJS; +// we need this (the java applet ignores the zindex) +Ext.useShims = true; +Ext.History.fieldid = 'x-history-field'; +Ext.onReady(function() { + console.log(Ext.getVersion().version); + Ext.create('$workspace'); +}); +_EOJS + + $page .= <<_EOD; + + + + + +
+ +
+ + +_EOD + + return $page; + +} + +1;