From c3884919d365f9c90f259cb8dbccedcc21280d82 Mon Sep 17 00:00:00 2001 From: Boaz Leskes Date: Mon, 27 Jan 2014 21:19:05 +0100 Subject: [PATCH] do not opent the first chart column in node/index stats if no query was specified. Also strip url params when checking navigation url for current page. --- kibana/dashboards/indices_stats.js | 13 ++++--------- kibana/dashboards/nodes_stats.js | 12 ++++-------- kibana/panels/navigation/module.js | 5 ++++- 3 files changed, 12 insertions(+), 18 deletions(-) diff --git a/kibana/dashboards/indices_stats.js b/kibana/dashboards/indices_stats.js index c327db5bd8a7..fc1fa457fb5f 100644 --- a/kibana/dashboards/indices_stats.js +++ b/kibana/dashboards/indices_stats.js @@ -66,13 +66,8 @@ if (!_.isUndefined(ARGS.queries)) { }]; })); } else { - // No queries passed? Initialize a single query to match everything - queries = { - 0: { - query: '*', - id: 0 - } - }; + // No queries passed + queries = {}; } var show = (ARGS.show || "").split(','); @@ -395,11 +390,11 @@ dashboard.rows = _.map(rows, function (r) { return r; }); -if (!showedSomething && dashboard.rows.length > 0) { +// open the first row if nothing was opened and we have queries (o.w. it's meaningless) +if (!showedSomething && dashboard.rows.length > 0 && _.size(queries) > 0) { dashboard.rows[0].collapse = false; } - dashboard.pulldowns = [ { "type": "query", diff --git a/kibana/dashboards/nodes_stats.js b/kibana/dashboards/nodes_stats.js index af2cf7114432..5b6be9c70a20 100644 --- a/kibana/dashboards/nodes_stats.js +++ b/kibana/dashboards/nodes_stats.js @@ -68,13 +68,8 @@ if (!_.isUndefined(ARGS.queries)) { })); marker_query = "(" + _.pluck(queries, "query").join(") OR (") + ")"; } else { - // No queries passed? Initialize a single query to match everything - queries = { - 0: { - query: '*', - id: 0 - } - }; + // No queries passed + queries = {}; } var annotate_config; @@ -690,7 +685,8 @@ dashboard.rows = _.map(rows, function (r) { return r; }); -if (!showedSomething && dashboard.rows.length > 0) { +// open the first row if nothing was opened and we have queries (o.w. it's meaningless) +if (!showedSomething && dashboard.rows.length > 0 && _.size(queries) > 0) { dashboard.rows[0].collapse = false; } diff --git a/kibana/panels/navigation/module.js b/kibana/panels/navigation/module.js index 9b3b0c8dc455..515a730b71fe 100644 --- a/kibana/panels/navigation/module.js +++ b/kibana/panels/navigation/module.js @@ -75,7 +75,10 @@ function (angular, app, $, _) { $scope.links = _.filter(response.data.links, function (link) { a.attr("href", link.url); - return a[0].href !== window.location.href; + var current = window.location.href; + // remove parameters + current = current.replace(/\?.*$/,''); + return a[0].href !== current; }); }); }