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
3f266a3e
Commit
3f266a3e
authored
Jan 06, 2015
by
Torkel Ödegaard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed dashboard search
parent
3e076052
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
17 additions
and
3 deletions
+17
-3
grafana
+1
-1
pkg/stores/sqlstore/dashboards.go
+3
-1
pkg/stores/sqlstore/dashboards_test.go
+13
-1
No files found.
grafana
@
a5c8bbfe
Subproject commit
49b18e17d7574540cdbf8d208c968ea4db202954
Subproject commit
a5c8bbfe1f04830507d981dff5a44248ffeab04c
pkg/stores/sqlstore/dashboards.go
View file @
3f266a3e
...
...
@@ -55,7 +55,9 @@ func GetDashboard(query *m.GetDashboardQuery) error {
}
func
SearchDashboards
(
query
*
m
.
SearchDashboardsQuery
)
error
{
sess
:=
x
.
Limit
(
100
,
0
)
.
Where
(
"account_id=?"
,
query
.
AccountId
)
titleMatch
:=
"%"
+
query
.
Query
+
"%"
sess
:=
x
.
Limit
(
100
,
0
)
.
Where
(
"account_id=? AND title LIKE ?"
,
query
.
AccountId
,
titleMatch
)
sess
.
Table
(
"Dashboard"
)
query
.
Result
=
make
([]
*
m
.
SearchResult
,
0
)
...
...
pkg/stores/sqlstore/dashboards_test.go
View file @
3f266a3e
...
...
@@ -21,7 +21,7 @@ func TestDashboardDataAccess(t *testing.T) {
Dashboard
:
map
[
string
]
interface
{}{
"id"
:
nil
,
"title"
:
"test dash 23"
,
"tags"
:
make
([]
interface
{},
0
)
,
"tags"
:
[]
interface
{}{
"prod"
,
"webapp"
}
,
},
}
...
...
@@ -49,6 +49,18 @@ func TestDashboardDataAccess(t *testing.T) {
So
(
query
.
Result
.
Slug
,
ShouldEqual
,
"test-dash-23"
)
})
Convey
(
"Should be able to search for dashboard"
,
func
()
{
query
:=
m
.
SearchDashboardsQuery
{
Query
:
"%test%"
,
AccountId
:
1
,
}
err
:=
SearchDashboards
(
&
query
)
So
(
err
,
ShouldBeNil
)
So
(
len
(
query
.
Result
),
ShouldEqual
,
1
)
})
Convey
(
"Should not be able to save dashboard with same name"
,
func
()
{
cmd
:=
m
.
SaveDashboardCommand
{
AccountId
:
1
,
...
...
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