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;