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
1ab11540
Commit
1ab11540
authored
Jan 19, 2016
by
utkarshcmu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Optimized backend queries
parent
8f067a5e
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
3 additions
and
5 deletions
+3
-5
pkg/api/api.go
+1
-2
pkg/api/index.go
+1
-1
pkg/services/sqlstore/dashboard_snapshot.go
+1
-2
No files found.
pkg/api/api.go
View file @
1ab11540
...
...
@@ -69,7 +69,6 @@ func Register(r *macaron.Macaron) {
// dashboard snapshots
r
.
Get
(
"/dashboard/snapshot/*"
,
Index
)
r
.
Get
(
"/dashboard/snapshots/"
,
reqSignedIn
,
Index
)
// api for dashboard snapshots
r
.
Post
(
"/api/snapshots/"
,
bind
(
m
.
CreateDashboardSnapshotCommand
{}),
CreateDashboardSnapshot
)
...
...
@@ -184,7 +183,7 @@ func Register(r *macaron.Macaron) {
r
.
Get
(
"/tags"
,
GetDashboardTags
)
})
//
d
ashboard snapshots
//
D
ashboard snapshots
r
.
Group
(
"/dashboard/snapshots"
,
func
()
{
r
.
Get
(
"/"
,
wrap
(
SearchDashboardSnapshots
))
})
...
...
pkg/api/index.go
View file @
1ab11540
...
...
@@ -63,7 +63,7 @@ func setIndexViewData(c *middleware.Context) (*dtos.IndexViewData, error) {
data
.
MainNavLinks
=
append
(
data
.
MainNavLinks
,
&
dtos
.
NavLink
{
Text
:
"Snapshots"
,
Icon
:
"fa fa-fw fa-camera-retro"
,
Url
:
"/
dashboard/
snapshots"
,
Url
:
"/snapshots"
,
})
if
c
.
OrgRole
==
m
.
ROLE_ADMIN
{
...
...
pkg/services/sqlstore/dashboard_snapshot.go
View file @
1ab11540
...
...
@@ -68,7 +68,7 @@ func GetDashboardSnapshot(query *m.GetDashboardSnapshotQuery) error {
func
SearchDashboardSnapshots
(
query
*
m
.
GetDashboardSnapshotsQuery
)
error
{
var
snapshots
=
make
(
m
.
DashboardSnapshots
,
0
)
sess
:=
x
.
Limit
(
query
.
Limit
)
sess
:=
x
.
Cols
(
"name,key,delete_key"
)
.
Limit
(
query
.
Limit
)
if
query
.
Name
!=
""
{
sess
.
Where
(
"name LIKE ?"
,
query
.
Name
)
...
...
@@ -77,6 +77,5 @@ func SearchDashboardSnapshots(query *m.GetDashboardSnapshotsQuery) error {
sess
.
Where
(
"org_id = ?"
,
query
.
OrgId
)
err
:=
sess
.
Find
(
&
snapshots
)
query
.
Result
=
snapshots
return
err
}
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