From: <ca...@us...> - 2008-08-13 16:48:31
|
Revision: 1673 http://ganglia.svn.sourceforge.net/ganglia/?rev=1673&view=rev Author: carenas Date: 2008-08-13 16:48:38 +0000 (Wed, 13 Aug 2008) Log Message: ----------- web: keep grid summary always on top for meta view for all sorting methods as reported in BUG186 by Timothy Witham (patch provided), the grid summary was incorrectly being sorted with all other grid summaries when asking for a sorted view in the meta view page. svn merge -c 1480 trunk svn merge -c 1482 trunk Reviewed-by: Bernard Li <be...@va...> Modified Paths: -------------- branches/monitor-core-3.1/STATUS branches/monitor-core-3.1/web/meta_view.php Modified: branches/monitor-core-3.1/STATUS =================================================================== --- branches/monitor-core-3.1/STATUS 2008-08-13 16:29:48 UTC (rev 1672) +++ branches/monitor-core-3.1/STATUS 2008-08-13 16:48:38 UTC (rev 1673) @@ -25,6 +25,7 @@ * Include contrib directory with user provided goodies * Support for building C++ DSO * Support for building with Sun Studio 12 in OpenSolaris + * In meta view regardless of sorting grid summary always on top * Bug fixes and Enhancements RELEASE SHOWSTOPPERS: @@ -51,12 +52,6 @@ http://ganglia.svn.sourceforge.net/viewvc/ganglia?view=rev&revision=1389 +1: bnicholes - * web: keep grid summary always on top for meta view for all sorting methods - http://bugzilla.ganglia.info/cgi-bin/bugzilla/show_bug.cgi?id=186 - http://ganglia.svn.sourceforge.net/viewvc/ganglia?view=rev&revision=1480 - http://ganglia.svn.sourceforge.net/viewvc/ganglia?view=rev&revision=1482 - +1: carenas, bernardli - * gmond: solaris: define fabsf for solaris < 10 http://ganglia.svn.sourceforge.net/viewvc/ganglia?view=rev&revision=1518 +1: carenas Modified: branches/monitor-core-3.1/web/meta_view.php =================================================================== --- branches/monitor-core-3.1/web/meta_view.php 2008-08-13 16:29:48 UTC (rev 1672) +++ branches/monitor-core-3.1/web/meta_view.php 2008-08-13 16:48:38 UTC (rev 1673) @@ -36,25 +36,25 @@ isset($total_load) or $total_load = 0; $total_load += $value; } -# Insure self is always first -$sorted_sources[$self] = 999999; if ($sort == "descending") { + $sorted_sources[$self] = 999999999; arsort($sorted_sources); -} -else if ($sort == "by name") { +} else if ($sort == "by name") { # SORT HACK to keep $self first; see below: + $sorted_sources["AAAAA.$self"] = $sorted_sources[$self]; + unset($sorted_sources[$self]); 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; + $sorted_sources[$self] = 999999999; 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; + $sorted_sources[$self] = 999999999; arsort($sorted_sources); } else { $sorted_sources[$self] = -1; @@ -64,6 +64,10 @@ # Display the sources. The first is ourself, the rest are our children. foreach ( $sorted_sources as $source => $val ) { + # XXX: SORT HACK to keep $self first; see above + if ($source == "AAAAA.$self") { + $source = $self; + } $m = $metrics[$source]; $sourceurl = rawurlencode($source); if (isset($grid[$source]['GRID']) and $grid[$source]['GRID']) @@ -157,6 +161,7 @@ foreach ($sorted_sources as $c=>$value) { if ($c==$self) continue; + if ($c=="AAAAA.$self") continue; # SORT HACK; see above if (isset($private[$c]) and $private[$c]) { $Private[$c] = template("images/cluster_private.jpg"); continue; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |