PVE-Manager v1.7-11 Mod

apmuthu

Renowned Member
Feb 26, 2009
871
11
83
Chennai - India & Singapore
github.com
In the Proxmox VE web GUI (pve-manager 1.7-11_all), we find that the list of downloadable templates are not in alphabetical order of atleast the package name.

Since it is posssible for more than one package to have the same name and possibly the same version number as well, the serial number of the lsiting is also added for uniqueness of record and the following code changes were incorporated to achieve a semblance of alphabetical order (only for the Section categories):

File: /usr/share/pve-manager/root/apl/download.htm
Lines 85-93:
Code:
   foreach my $k (sort keys %{$pkglist->{$sec}}) {
     my $d = $pkglist->{$sec}->{$k};
     next if $d->{certified};
     my $menu = $ddown->out_symbol ('menu0', '', "&aa=$k");

     $found = 1;
     $table->set_row_link ("?showinfo=$k");
     $table->add_row ('', $menu, $d->{headline}, $d->{version}, $d->{type}, $d->{package});
   }
have been replaced with:
Code:
   my %myset = ();

   foreach my $k (sort keys %{$pkglist->{$sec}}) {
     my $d = $pkglist->{$sec}->{$k};
     next if $d->{certified};
     my $menu = $ddown->out_symbol ('menu0', '', "&aa=$k");

     $found = 1;
     $d->{k}=$k;
     $d->{menu}=$menu;
     %myset->{$d->{package} . $d->{version} . $k} = $d;
   }
   foreach my $key (sort keys %myset) {
     $table->set_row_link ("?showinfo=" . %myset->{$key}->{k});
     $table->add_row ('', %myset->{$key}->{menu}, %myset->{$key}->{headline}, %myset->{$key}->{version}, %myset->{$key}->{type}, %myset->{$key}->{package});
   }
As my perl coding skills are a bit rough - it is certainly not my first 'language' - please polish and include it in the next release of pve-manager.

View attachment PVEManager-AlphabeticalFix.zip
 
since we're exchanging patches, here's my two cents: I just couldn't live without a favicon, so I drew one. It's ugly, but lets me distinguish PVE amongst the ton of tabs I currently have open.

View attachment favicon.ico.zip

it's a simple two-color icon, weighs 198 bytes. It should be put into apache's document root, in our case /usr/share/pve-manager/images/favicon.ico

PS - I hope Proxmox 2 will have a cool new favicon according to the new logo! And the overall style will be changed - are screenshots available anywhere?
PPS - the icon I made is Public Domain, anyone can use it and relicence as he likes.
 
The existing code does not provide for any favicon in the login page:
Lines 86-90 at /usr/share/pve-manager/root/login.pl
Code:
<head>  <title>Proxmox Virtual Environment</title>
  <meta http-equiv="Content-Type"content="text/html;charset=UTF-8">
  <LINK REL="stylesheet"type="text/css"HREF="[URL="http://forum.proxmox.com/view-source:https://virta/css/pve.css"]/css/pve.css[/URL]">
</head>
The html code needs to be altered as well in the following pages in /usr/share/pve-manager/root/:
Code:
login.pl
base.epl
openvz/console-direct.htm
qemu/vnc-direct.htm


The normal pages after login have:
Code:
 <head>  
 <title>Proxmox Virtual Environment</title>  
 <meta http-equiv="Content-Type" content="text/html;charset=UTF-8">  
 <meta http-equiv="expires" content="0">  <meta http-equiv="cache-control" content="no-cache">  
 <meta http-equiv="pragma" content="no-cache">  
 <link href="[URL="http://forum.proxmox.com/view-source:https://virta/css/pve.css"]/css/pve.css[/URL]" rel="stylesheet" type="text/css">
 <!--[if lt IE 8]>  
 <link href="/css/iehacks.css" rel="stylesheet" type="text/css">
 <![endif]-->  
 <script type="text/javascript" src="[URL="http://forum.proxmox.com/view-source:https://virta/javascript/prototype/prototype.js"]/javascript/prototype/prototype.js[/URL]"></script>  
 <script type="text/javascript" src="[URL="http://forum.proxmox.com/view-source:https://virta/css/pve.js"]/css/pve.js[/URL]"></script>
 </head>

We can addin the line for the favicon (aasuming it is placed in /usr/share/pve-manager/root) and the no robots as well:
Code:
  <META NAME="ROBOTS" CONTENT="NOINDEX,NOFOLLOW">
  <link rel="shortcut icon" href="/favicon.ico" />
The favicon line can also be:
Code:
  <link rel="icon" type="image/png" href="favicon.png">

Thanks for the simply lovely icon indeed!
 
Last edited:
In fact, it would be nice to put the following common code (along with the favicon and robots line referred in my first post in this topic) into a separate fragment such as titlecode.epl and include it in the needed pages:
Code:
<title>Proxmox Virtual Environment</title>  
 <meta http-equiv="Content-Type" content="text/html;charset=UTF-8">  
 <meta http-equiv="expires" content="0">  
 <meta http-equiv="cache-control" content="no-cache">  
 <meta http-equiv="pragma" content="no-cache">  
 <link href="[URL="http://forum.proxmox.com/view-source:https://virta/css/pve.css"][COLOR=#417394]/css/pve.css[/COLOR][/URL]" rel="stylesheet" type="text/css">

This will make for easy maintenance of changes and the pve-manager package can be made to write this file only if missing in the existing install so that any user changes will persist.
 
The location and name of the favicon:
Code:
/usr/share/pve-manager/images/favicon.ico
is fixed in
Code:
/etc/apache2/sites-available/pve.conf
in lines 47-48 as
Code:
# avoid authentication when accessing favicon
Alias /favicon.ico /usr/share/pve-manager/images/favicon.ico
Hence the entry in the <head> in not needed.
 
Last edited:
all modern browsers search for favicon.ico in the document root if one is not set in HTML. So just adding the file to the directory I've told will enable the favicon on all pages without any code editing :)
 
and about useability in general - I've got a few thoughts how to make proxmox more user-friendly. First of all - the icons! In current proxmox there are arrows instead of icons, and that's a bit confusing (took me some time to find how to add hardware to a KVM guest).
Let's look at similar projects:
ovz-web-panel - a really pretty front-end for OpenVZ. All sorts of different icons
phpvirtualbox - uses vbox icons. Also very intuitive.

That's why I wanted to see some proxmox2 screenshots - to know if a new look is part of it, or if all the new stuff will be under the hood. I could help with bringing icons from other projects into proxmox.
 
all modern browsers search for favicon.ico in the document root if one is not set in HTML. So just adding the file to the directory I've told will enable the favicon on all pages without any code editing :)
Yes you're right - the pve.conf file has the entry - and hence the file in the said folder (not the document root here) will work. See the last line of my former post.
 
yes, it's not the document root. I remember now - first I put the file into the document root, but it still didn't show up - so I looked through apache configs and found the entry you also pointed out.
 
till now we did not have any screenshot online but yes, we have eliminated the red arrow.

as soon as we publish the first beta any comment is welcome.
 
Since it is posssible for more than one package to have the same name and possibly the same version number as well,

Sorry, why do you think that should be possible? On Debian, packages names are unique. My idea was that appliance names are unique too.
 
Say we have debian 6.0 vtigercrm v5.2.1 Build 1 and 2. If we add the build number as part of the version number, then it is okay.

I now see that it affects only templates with some renaming done - so as to separate two versions with slight changes when we were lazy to change the dab.conf to the next build number. For example, if I build a template that comes out as:
Code:
debian-6.0-vtigercrm_5.2.1-2_i386.tar.gz
and build it again with some minor differences in the Makefile without changing the dab.conf inadvertantly and then realising the mistake only when transferring the template to the cache folder and renaming the second one to be:
Code:
debian-6.0-vtigercrm_5.2.1-2_a_i386.tar.gz
In this case the serial number comes to the rescue for uniqueness.

For strict adherence to the template naming norms the serial number would not be needed for uniqueness and just the package name and version number inclusive of the build number would suffice.
 
I now see that it affects only templates with some renaming done - so as to separate two versions with slight changes when we were lazy to change the dab.conf to the next build number. For example, if I build a template that comes out as:

Having globally unique appliance names is a good feature. I simply can't follow your arguments (you argument is laziness?).