Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
N
nexpie-grafana-theme
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Registry
Registry
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Kornkitt Poolsup
nexpie-grafana-theme
Commits
fe567313
Commit
fe567313
authored
Jun 08, 2016
by
Carl Bergquist
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #5292 from Thib17/master
Enable the "limit" param in /api/search
parents
7d6cda49
3d776851
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
9 additions
and
1 deletions
+9
-1
pkg/services/search/handlers.go
+1
-0
pkg/services/search/models.go
+1
-0
pkg/services/sqlstore/dashboard.go
+7
-1
No files found.
pkg/services/search/handlers.go
View file @
fe567313
...
...
@@ -44,6 +44,7 @@ func searchHandler(query *Query) error {
IsStarred
:
query
.
IsStarred
,
OrgId
:
query
.
OrgId
,
DashboardIds
:
query
.
DashboardIds
,
Limit
:
query
.
Limit
,
}
if
err
:=
bus
.
Dispatch
(
&
dashQuery
);
err
!=
nil
{
...
...
pkg/services/search/models.go
View file @
fe567313
...
...
@@ -42,6 +42,7 @@ type FindPersistedDashboardsQuery struct {
UserId
int64
IsStarred
bool
DashboardIds
[]
int
Limit
int
Result
HitList
}
pkg/services/sqlstore/dashboard.go
View file @
fe567313
...
...
@@ -123,6 +123,11 @@ type DashboardSearchProjection struct {
}
func
SearchDashboards
(
query
*
search
.
FindPersistedDashboardsQuery
)
error
{
limit
:=
query
.
Limit
if
limit
==
0
{
limit
=
1000
}
var
sql
bytes
.
Buffer
params
:=
make
([]
interface
{},
0
)
...
...
@@ -165,7 +170,8 @@ func SearchDashboards(query *search.FindPersistedDashboardsQuery) error {
params
=
append
(
params
,
"%"
+
query
.
Title
+
"%"
)
}
sql
.
WriteString
(
fmt
.
Sprintf
(
" ORDER BY dashboard.title ASC LIMIT 1000"
))
sql
.
WriteString
(
fmt
.
Sprintf
(
" ORDER BY dashboard.title ASC LIMIT ?"
))
params
=
append
(
params
,
limit
)
var
res
[]
DashboardSearchProjection
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment