package PVE::ExtJSIndex; use strict; use warnings; sub get_index { my ($lang, $username, $csrftoken, $console, $nodename) = @_; my $page = <<_EOD; $nodename - 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; Ext.History.fieldid = 'x-history-field'; Ext.onReady(function() { Ext.create('$workspace');}); _EOJS $page .= <<_EOD;
_EOD return $page; } 1;