Skip to content

Commit 1584dac

Browse files
committed
Merge branch 'master' of github.com:grafana/grafana
2 parents 79986e5 + ced3baf commit 1584dac

File tree

6 files changed

+12
-6
lines changed

6 files changed

+12
-6
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
* **InfluxDB**: Add spread function, closes [#5211](https://github.com/grafana/grafana/issues/5211)
1111
* **Scripts**: Use restart instead of start for deb package script, closes [#5282](https://github.com/grafana/grafana/pull/5282)
1212
* **Logging**: Moved to structured logging lib, and moved to component specific level filters via config file, closes [#4590](https://github.com/grafana/grafana/issues/4590)
13+
* **Search**: Add search limit query parameter, closes [#5292](https://github.com/grafana/grafana/pull/5292)
1314

1415
## Breaking changes
1516
* **Logging** : Changed default logging output format (now structured into message, and key value pairs, with logger key acting as component). You can also no change in config to json log ouput.

pkg/services/search/handlers.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ func searchHandler(query *Query) error {
4444
IsStarred: query.IsStarred,
4545
OrgId: query.OrgId,
4646
DashboardIds: query.DashboardIds,
47+
Limit: query.Limit,
4748
}
4849

4950
if err := bus.Dispatch(&dashQuery); err != nil {

pkg/services/search/models.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ type FindPersistedDashboardsQuery struct {
4242
UserId int64
4343
IsStarred bool
4444
DashboardIds []int
45+
Limit int
4546

4647
Result HitList
4748
}

pkg/services/sqlstore/dashboard.go

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,11 @@ type DashboardSearchProjection struct {
123123
}
124124

125125
func SearchDashboards(query *search.FindPersistedDashboardsQuery) error {
126+
limit := query.Limit
127+
if limit == 0 {
128+
limit = 1000
129+
}
130+
126131
var sql bytes.Buffer
127132
params := make([]interface{}, 0)
128133

@@ -165,7 +170,8 @@ func SearchDashboards(query *search.FindPersistedDashboardsQuery) error {
165170
params = append(params, "%"+query.Title+"%")
166171
}
167172

168-
sql.WriteString(fmt.Sprintf(" ORDER BY dashboard.title ASC LIMIT 1000"))
173+
sql.WriteString(fmt.Sprintf(" ORDER BY dashboard.title ASC LIMIT ?"))
174+
params = append(params, limit)
169175

170176
var res []DashboardSearchProjection
171177

public/app/features/org/partials/profile.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ <h3 class="page-heading">Organizations</h3>
5151
<span class="btn btn-primary btn-mini" ng-show="org.orgId === contextSrv.user.orgId">
5252
Current
5353
</span>
54-
<a ng-click="setUsingOrg(org)" class="btn btn-inverse btn-mini" ng-show="org.orgId !== contextSrv.user.orgId">
54+
<a ng-click="ctrl.setUsingOrg(org)" class="btn btn-inverse btn-mini" ng-show="org.orgId !== contextSrv.user.orgId">
5555
Select
5656
</a>
5757
</td>

public/app/plugins/datasource/opentsdb/datasource.js

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -403,10 +403,7 @@ function (angular, _, dateMath) {
403403
} else {
404404
return _.findIndex(options.targets, function(target) {
405405
if (target.filters && target.filters.length > 0) {
406-
return target.metric === metricData.metric &&
407-
_.all(target.filters, function(filter) {
408-
return filter.tagk === interpolatedTagValue === "*";
409-
});
406+
return target.metric === metricData.metric;
410407
} else {
411408
return target.metric === metricData.metric &&
412409
_.all(target.tags, function(tagV, tagK) {

0 commit comments

Comments
 (0)