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.

This commit is contained in:
Boaz Leskes 2014-01-27 21:19:05 +01:00
parent b029508331
commit c3884919d3
3 changed files with 12 additions and 18 deletions

View file

@ -66,13 +66,8 @@ if (!_.isUndefined(ARGS.queries)) {
}]; }];
})); }));
} else { } else {
// No queries passed? Initialize a single query to match everything // No queries passed
queries = { queries = {};
0: {
query: '*',
id: 0
}
};
} }
var show = (ARGS.show || "").split(','); var show = (ARGS.show || "").split(',');
@ -395,11 +390,11 @@ dashboard.rows = _.map(rows, function (r) {
return 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.rows[0].collapse = false;
} }
dashboard.pulldowns = [ dashboard.pulldowns = [
{ {
"type": "query", "type": "query",

View file

@ -68,13 +68,8 @@ if (!_.isUndefined(ARGS.queries)) {
})); }));
marker_query = "(" + _.pluck(queries, "query").join(") OR (") + ")"; marker_query = "(" + _.pluck(queries, "query").join(") OR (") + ")";
} else { } else {
// No queries passed? Initialize a single query to match everything // No queries passed
queries = { queries = {};
0: {
query: '*',
id: 0
}
};
} }
var annotate_config; var annotate_config;
@ -690,7 +685,8 @@ dashboard.rows = _.map(rows, function (r) {
return 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.rows[0].collapse = false;
} }

View file

@ -75,7 +75,10 @@ function (angular, app, $, _) {
$scope.links = _.filter(response.data.links, function (link) { $scope.links = _.filter(response.data.links, function (link) {
a.attr("href", link.url); 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;
}); });
}); });
} }