mirror of
https://git.proxmox.com/git/pve-manager
synced 2025-06-14 05:05:19 +00:00

The use of the HTML doctype is recommended for Ext4 and Ext5, and is supported by all post 2008 browsers. Basically it tells the browser to interpret the HTML according to standards, and not according to what IE6 might have thought of it. This will also drop support for IE6 and IE7, which are anyway not supported by ext5. The HTML doctype will make all browsers switch to their standard compliant mode, hence we don't need anymore to toggle this specifically for IE. Signed-off-by: Emmanuel Kasper <e.kasper@proxmox.com>
67 lines
1.7 KiB
Perl
67 lines
1.7 KiB
Perl
package PVE::ExtJSIndex;
|
|
|
|
use strict;
|
|
use warnings;
|
|
|
|
sub get_index {
|
|
my ($lang, $username, $csrftoken, $console) = @_;
|
|
|
|
my $page = <<_EOD;
|
|
<!DOCTYPE html>
|
|
<html>
|
|
<head>
|
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
|
<title>Proxmox Virtual Environment</title>
|
|
|
|
<link rel="stylesheet" type="text/css" href="/pve2/ext4/resources/css/ext-all.css" />
|
|
<link rel="stylesheet" type="text/css" href="/pve2/css/ext-pve.css" />
|
|
_EOD
|
|
|
|
my $langfile = "/usr/share/pve-manager/locale/pve-lang-${lang}.js";
|
|
if (-f $langfile) {
|
|
$page .= "<script type='text/javascript' src='/pve2/locale/pve-lang-${lang}.js'></script>";
|
|
} else {
|
|
$page .= '<script type="text/javascript">function gettext(buf) { return buf; }</script>';
|
|
}
|
|
|
|
$page .= <<_EOD;
|
|
<script type="text/javascript" src="/pve2/ext4/ext-all-debug.js"></script>
|
|
<script type="text/javascript" src="/pve2/ext4/pvemanagerlib.js"></script>
|
|
<script type="text/javascript" src="/pve2/ext4/locale/ext-lang-${lang}.js"></script>
|
|
_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() { Ext.create('$workspace');});
|
|
_EOJS
|
|
|
|
$page .= <<_EOD;
|
|
<script type="text/javascript">$jssrc</script>
|
|
|
|
</head>
|
|
<body>
|
|
<!-- Fields required for history management -->
|
|
<form id="history-form" class="x-hidden">
|
|
<input type="hidden" id="x-history-field"/>
|
|
</form>
|
|
</body>
|
|
</html>
|
|
_EOD
|
|
|
|
return $page;
|
|
|
|
}
|
|
|
|
1;
|