mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Fixed small issue in search and showing Home dashboard when filtering by tag
This commit is contained in:
parent
6347b9b0d7
commit
a146a24c06
@ -14,7 +14,7 @@ function (angular, _, config) {
|
||||
$scope.giveSearchFocus = 0;
|
||||
$scope.selectedIndex = -1;
|
||||
$scope.results = {dashboards: [], tags: [], metrics: []};
|
||||
$scope.query = { query: '' };
|
||||
$scope.query = { query: '', tag: '', starred: false };
|
||||
$scope.db = datasourceSrv.getGrafanaDB();
|
||||
$scope.currentSearchId = 0;
|
||||
|
||||
@ -72,12 +72,17 @@ function (angular, _, config) {
|
||||
return dash;
|
||||
});
|
||||
|
||||
if ($scope.query.query === "" && !$scope.query.starred) {
|
||||
if ($scope.queryHasNoFilters()) {
|
||||
$scope.results.dashboards.unshift({ title: 'Home', url: config.appSubUrl + '/', isHome: true });
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
$scope.queryHasNoFilters = function() {
|
||||
var query = $scope.query;
|
||||
return query.query === '' && query.starred === false && query.tag === '';
|
||||
};
|
||||
|
||||
$scope.filterByTag = function(tag, evt) {
|
||||
$scope.query.tag = tag;
|
||||
$scope.query.tagcloud = false;
|
||||
|
Loading…
Reference in New Issue
Block a user