diff -c -r ganglia-3.0.4/web/cluster_view.php web+/cluster_view.php
*** ganglia-3.0.4/web/cluster_view.php	2006-12-25 04:02:38.000000000 -0600
--- web+/cluster_view.php	2007-04-11 12:12:49.744719000 -0500
***************
*** 124,130 ****
     case "descending":
        arsort($sorted_hosts);
        break;
!    case "by hostname":
        ksort($sorted_hosts);
        break;
     default:
--- 124,130 ----
     case "descending":
        arsort($sorted_hosts);
        break;
!    case "by name":
        ksort($sorted_hosts);
        break;
     default:
diff -c -r ganglia-3.0.4/web/get_context.php web+/get_context.php
*** ganglia-3.0.4/web/get_context.php	2006-12-25 04:02:38.000000000 -0600
--- web+/get_context.php	2007-04-11 12:12:49.750722000 -0500
***************
*** 116,121 ****
--- 116,129 ----
  if (!$sort)
        $sort = "descending";
  
+ # Since cluster context do not have the option to sort "by down host", change
+ # sort order to "descending" if previous sort order is "by down host"
+ if ($context == "cluster") {
+     if ($sort == "by hosts up" || $sort == "by hosts down") {
+         $sort = "descending";
+     }
+ }
+ 
  # A hack for pre-2.5.0 ganglia data sources.
  $always_constant = array(
     "swap_total" => 1,
Only in web+/: get_context.php~
diff -c -r ganglia-3.0.4/web/header.php web+/header.php
*** ganglia-3.0.4/web/header.php	2006-12-25 04:02:38.000000000 -0600
--- web+/header.php	2007-04-11 12:12:49.757720000 -0500
***************
*** 293,299 ****
     {
        $context_sorts[]="ascending";
        $context_sorts[]="descending";
!       $context_sorts[]="by hostname";
  
        $sort_menu = "<B>Sorted</B>&nbsp;&nbsp;"
           ."<SELECT NAME=\"s\" OnChange=\"ganglia_form.submit();\">\n";
--- 293,307 ----
     {
        $context_sorts[]="ascending";
        $context_sorts[]="descending";
!       $context_sorts[]="by name";
! 
!       #
!       # Show sort order options for meta context only:
!       #
!       if ($context == "meta" ) {
!           $context_sorts[]="by hosts up";
!           $context_sorts[]="by hosts down";
!       }
  
        $sort_menu = "<B>Sorted</B>&nbsp;&nbsp;"
           ."<SELECT NAME=\"s\" OnChange=\"ganglia_form.submit();\">\n";
Only in web+/: header.php~
diff -c -r ganglia-3.0.4/web/meta_view.php web+/meta_view.php
*** ganglia-3.0.4/web/meta_view.php	2006-12-25 04:02:38.000000000 -0600
--- web+/meta_view.php	2007-04-11 12:12:49.763720000 -0500
***************
*** 32,50 ****
        $load_one = $metrics[$c]["load_one"]['SUM'];
        $value = (double) $load_one / $cpucount;
        $sorted_sources[$c] = $value;
        isset($total_load) or $total_load = 0;
        $total_load += $value;   
     }
  # Insure self is always first 
! $sorted_sources[$self] = $total_load + 1;
  
  if ($sort == "descending") {
        arsort($sorted_sources);
  }
! else if ($sort == "by hostname") {
! 	  ksort($sorted_sources);
! }
! else {
        asort($sorted_sources);
  }
  
--- 32,63 ----
        $load_one = $metrics[$c]["load_one"]['SUM'];
        $value = (double) $load_one / $cpucount;
        $sorted_sources[$c] = $value;
+       $values[$c] = $value;
        isset($total_load) or $total_load = 0;
        $total_load += $value;   
     }
  # Insure self is always first 
! $sorted_sources[$self] = 999999;
  
  if ($sort == "descending") {
        arsort($sorted_sources);
  }
! else if ($sort == "by name") {
!       ksort($sorted_sources);
! } else if ($sort == "by hosts up") {
!       foreach ($sorted_sources as $source => $val) {
!             $sorted_sources[$source] = intval($grid[$source]['HOSTS_UP']);
!       }
!       $sorted_sources[$self] = 999999;
!       arsort($sorted_sources);
! } else if ($sort == "by hosts down") {
!       foreach ($sorted_sources as $source => $val) {
!             $sorted_sources[$source] = intval($grid[$source]['HOSTS_DOWN']);
!       }
!       $sorted_sources[$self] = 999999;
!       arsort($sorted_sources);
! } else {
!       $sorted_sources[$self] = -1;
        asort($sorted_sources);
  }
  
***************
*** 152,160 ****
        $names[]=$c;
  
        if (isset($grid[$c]['GRID']) and $grid[$c]['GRID'])
!          $image = load_image("grid", $value);
        else
!          $image = load_image("cluster", $value);
        $Images[]=$image;
     }
     # Add private cluster pictures to the end.
--- 165,173 ----
        $names[]=$c;
  
        if (isset($grid[$c]['GRID']) and $grid[$c]['GRID'])
!          $image = load_image("grid", $values[$c]);
        else
!          $image = load_image("cluster", $values[$c]);
        $Images[]=$image;
     }
     # Add private cluster pictures to the end.
Only in web+/: meta_view.php~
