[pve-devel] [PATCH pve-manager 1/3] When running with extjs=1, construct the includes lists based on manager6 dir content

Emmanuel Kasper e.kasper at proxmox.com
Tue Jan 26 10:47:07 CET 2016



On 01/25/2016 05:38 PM, Dietmar Maurer wrote:
>> @@ -6,6 +9,13 @@ use warnings;
>>  sub get_index {
>>      my ($lang, $username, $csrftoken, $console) = @_;
>>  
>> +    my $manager_source_dir = '/usr/share/pve-manager/manager6/';
>> +
>> +#    # exit early to avoid this being run by mistake
>> +    if ( ! -d $manager_source_dir) {
>> +	return "$manager_source_dir not found";
>> +    }
>> +
>>      my $page = <<_EOD;
>>  <!DOCTYPE html>
>>  <html>
>> @@ -14,6 +24,7 @@ sub get_index {
>>      <title>Proxmox Virtual Environment</title>
>>      <link rel="stylesheet" type="text/css"
>> href="/pve2/ext6/theme-triton/resources/theme-triton-all.css" />
>>      <link rel="stylesheet" type="text/css" href="/pve2/css/ext-pve.css" />
>> +    <script type="text/javascript"
>> src="/pve2/ext6/ext-all-debug.js"></script>
>>  _EOD
>>  
>>      my $langfile = "/usr/share/pve-manager/locale/pve-lang-${lang}.js";
>> @@ -23,207 +34,219 @@ _EOD
>>  	$page .= '<script type="text/javascript">function gettext(buf) { return buf;
>> }</script>';
>>      }
>>  
>> -    $page .= <<_EOD;
>> -    <script type="text/javascript"
>> src="/pve2/ext6/ext-all-debug.js"></script>
> 
> Why do you change the include ordering? AFAIK pve-lang-${lang}.js needs 
> to be loaded before ext-all-debug.js?

I moved the out the ext-all-debug include upper so it is grouped with
the other include.

pve-lang-${lang}.js do not use the framework code, so it it safe to
include it before including the framework





More information about the pve-devel mailing list