From 44a7dbe75c697cb1b24889c0a9f58106a75bc910 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Torkelsson?= Date: Fri, 14 Feb 2014 15:01:26 +0100 Subject: [PATCH 1/3] Add an option to keep the ordering of graphs in the order they were added. Default to the old sorted behaviour. --- functions.php | 11 +++++++++-- graph.php | 9 ++++++++- 2 files changed, 17 insertions(+), 3 deletions(-) diff --git a/functions.php b/functions.php index dd54b0d0..704669f5 100644 --- a/functions.php +++ b/functions.php @@ -747,6 +747,10 @@ function get_view_graph_elements($view) { } else { $graph_args_array[] = "z=" . $default_size; } + + if ( isset($item['sortit']) ) { + $graph_args_array[] = "sortit=" . $item['sortit']; + } // If graph type is not specified default to line graph if (isset($item['graph_type']) && @@ -1111,7 +1115,8 @@ function build_aggregate_graph_config ($graph_type, $hreg, $mreg, $glegend, - $exclude_host_from_legend_label) { + $exclude_host_from_legend_label, + $sortit = true) { global $conf, $index_array, $hosts, $grid, $clusters, $debug, $metrics; @@ -1157,7 +1162,9 @@ function build_aggregate_graph_config ($graph_type, } } } - ksort($metric_matches); + if($sortit) { + ksort($metric_matches); + } } if( isset($metric_matches)){ $metric_matches_unique = array_unique($metric_matches); diff --git a/graph.php b/graph.php index 45186123..f6e026da 100644 --- a/graph.php +++ b/graph.php @@ -293,13 +293,20 @@ function build_aggregate_graph_config_from_url($conf_graph_colors) { $exclude_host_from_legend_label = (array_key_exists('lgnd_xh', $_GET) && $_GET['lgnd_xh'] == "true") ? TRUE : FALSE; + + $sortit = true; + if($_GET['sortit'] == "false") { + $sortit = false; + } + $graph_config = build_aggregate_graph_config($graph_type, $line_width, $_GET['hreg'], $_GET['mreg'], $graph_legend, - $exclude_host_from_legend_label); + $exclude_host_from_legend_label, + $sortit); } // Set up From f4ea87b430ad4a8e83eebecb24a41c3c3ec5637a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bjo=CC=88rn=20Torkelsson?= Date: Fri, 13 Nov 2015 23:32:56 +0100 Subject: [PATCH 2/3] Don't create world writable directories! --- dwoo/Dwoo/Template/String.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dwoo/Dwoo/Template/String.php b/dwoo/Dwoo/Template/String.php index bbfb4c88..10cff88d 100644 --- a/dwoo/Dwoo/Template/String.php +++ b/dwoo/Dwoo/Template/String.php @@ -82,7 +82,7 @@ class Dwoo_Template_String implements Dwoo_ITemplate * * @var int */ - protected $chmod = 0777; + protected $chmod = 0755; /** * creates a template from a string From d89f072e7626d3b36e503c1bad62b98482dc4287 Mon Sep 17 00:00:00 2001 From: Adam Tygart Date: Fri, 30 Oct 2015 16:34:38 -0500 Subject: [PATCH 3/3] Case-Sensitivity fix for hostnames and cluster_view If case_sensitive_hostnames is set to false, lowercase the hostname for $host_url or else the graphs will not draw. --- cluster_view.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cluster_view.php b/cluster_view.php index 3ce94677..570a5192 100644 --- a/cluster_view.php +++ b/cluster_view.php @@ -257,7 +257,7 @@ function get_host_metric_graphs($showhosts, // If we're hiding DOWN hosts, we skip to next iteration of the loop. continue; } - $host_url = rawurlencode($host); + $host_url = ($case_sensitive_hostnames) ? rawurlencode($host) : strtolower(rawurlencode($host)); $host_link="\"?c=$cluster_url&h=$host_url&$get_metric_string\""; $textval = "";