Menu

#33 Network Devices in Host view are unsorted

4.3-2
closed
None
5
2014-12-16
2014-12-10
Flow86
No

Hi,

its a small design "bug": the network devices in host view are unsorted. Thats annoying if you have a lot of host interfaces (like virtual ones or vlan-interfaces, etc ...)

adding a few lines in js/phpvirtualbox.js will fix that "issue":

{{{
d['networkInterfaces'].sort(
function(a,b) {
if(a['name'] == b['name']) return 0;
return (a['name'] < b['name']) ? -1 : 1;
}
);
}}}

before

{{{
for(var i = 0; i < d['networkInterfaces'].length; i++) {

            /* Interface Name */
            netRows[netRows.length] = {

}}}

Discussion

  • Flow86

    Flow86 - 2014-12-10

    damn it, I f***ed up the markup

    d['networkInterfaces'].sort(
                function(a,b) {
                            if(a['name'] == b['name']) return 0;
                            return (a['name'] < b['name']) ? -1 : 1;
                }
    );
    

    before

    for(var i = 0; i < d['networkInterfaces'].length; i++) {
    
                /* Interface Name */
                netRows[netRows.length] = {
    
     
  • Ian Moore

    Ian Moore - 2014-12-11

    More of a feature request, but it will be added in the next relase.

     
  • Ian Moore

    Ian Moore - 2014-12-11
    • status: open --> accepted
     
  • Ian Moore

    Ian Moore - 2014-12-11
    • Group: v1.0_(example) --> 4.3-2
     
  • Ian Moore

    Ian Moore - 2014-12-16

    Added / fixed in 4.3-2

     
  • Ian Moore

    Ian Moore - 2014-12-16
    • status: accepted --> closed
    • assigned_to: Ian Moore
     

Log in to post a comment.