diff --git a/cluster_view.php b/cluster_view.php index 77660f9f..f2673a46 100644 --- a/cluster_view.php +++ b/cluster_view.php @@ -603,9 +603,9 @@ function get_load_heatmap($hosts_up, $user, $metrics, $data) { $conf['show_stacked_graphs'] == 1 and ! preg_match("/_report$/", $metricname)) { $cluster_url = rawurlencode($clustername); - $stacked_args = "m=$metricname&c=$cluster_url&r=$range&st=$cluster[LOCALTIME]"; + $stacked_args = "m=$metricname&c=$cluster_url&r=$range&st=$cluster[LOCALTIME]"; if (isset($user['host_regex'])) - $stacked_args .= "&host_regex=" . $user['host_regex']; + $stacked_args .= "&host_regex=" . $user['host_regex']; $data->assign("stacked_graph_args", $stacked_args); } diff --git a/functions.php b/functions.php index bc3c4572..39302bbf 100644 --- a/functions.php +++ b/functions.php @@ -572,10 +572,17 @@ function get_available_views() { } $view = json_decode(file_get_contents($view_config_file), TRUE); - // Check whether view type has been specified ie. regex. If not it's standard view - isset($view['view_type']) ? $view_type = $view['view_type'] : $view_type = "standard"; - $available_views[] = array ( "file_name" => $view_config_file, "view_name" => $view['view_name'], - "default_size" => $view['default_size'], "items" => $view['items'], "view_type" => $view_type); + // Check whether view type has been specified ie. regex. + // If not it's standard view + $view_type = + isset($view['view_type']) ? $view['view_type'] : "standard"; + $default_size = isset($view['default_size']) ? + $view['default_size'] : $conf['default_view_graph_size']; + $available_views[] = array ("file_name" => $view_config_file, + "view_name" => $view['view_name'], + "default_size" => $default_size, + "items" => $view['items'], + "view_type" => $view_type); unset($view); diff --git a/header.php b/header.php index 388f9aec..6d13db44 100644 --- a/header.php +++ b/header.php @@ -145,6 +145,7 @@ } elseif ( $context == "views") { if( checkAccess( GangliaAcl::ALL_VIEWS, GangliaAcl::EDIT, $conf ) ) { $alt_view = ''; + $alt_view .= '  '; } } diff --git a/inspect_graph.php b/inspect_graph.php index c1d8760b..8efc0c71 100644 --- a/inspect_graph.php +++ b/inspect_graph.php @@ -56,10 +56,10 @@ function utcTimeStr(tstamp) { var date = new Date(tstamp); - var month = date.getUTCMonth(); + var month = date.getUTCMonth() + 1; if ( month < 10 ) month = "0" + month; - var day = date.getUTCDay(); + var day = date.getUTCDate(); if ( day < 10 ) day = "0" + day; var hr = date.getUTCHours(); diff --git a/templates/default/views_view.tpl b/templates/default/views_view.tpl index c4bb7d5c..c6387459 100644 --- a/templates/default/views_view.tpl +++ b/templates/default/views_view.tpl @@ -23,6 +23,22 @@ .click(function() { $( "#create-new-view-dialog" ).dialog( "open" ); }); + $("#delete_view_button") + .button() + .click(function() { + if ($("#vn").val() != "") { + $.get('views_view.php?view_name=' + + encodeURIComponent($("#vn").val()) + + '&delete_view&views_menu', + function(data) { + $("#views_menu").html(data); + $("#view_graphs").html(""); + $.cookie('ganglia-selected-view-' + window.name, ""); + $("#vn").val(""); + }); + } else + alert("Please select the view to delete"); + }); highlightSelectedView('{$view_name}'); });