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
0918063c
Commit
0918063c
authored
Jan 08, 2016
by
bergquist
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix(playlist): move dashboard uri cration to Backend
parent
22c001c8
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
23 additions
and
4 deletions
+23
-4
pkg/api/playlist.go
+11
-1
pkg/models/playlist.go
+11
-0
pkg/services/sqlstore/playlist.go
+1
-0
public/app/features/playlist/playlist_routes.js
+0
-3
No files found.
pkg/api/playlist.go
View file @
0918063c
...
...
@@ -63,7 +63,17 @@ func GetPlaylistDashboards(c *middleware.Context) Response {
return
ApiError
(
500
,
"Playlist not found"
,
err
)
}
return
Json
(
200
,
query
.
Result
)
dtos
:=
make
([]
m
.
PlaylistDashboardDto
,
0
)
for
_
,
item
:=
range
*
query
.
Result
{
dtos
=
append
(
dtos
,
m
.
PlaylistDashboardDto
{
Id
:
item
.
Id
,
Slug
:
item
.
Slug
,
Title
:
item
.
Title
,
Uri
:
"db/"
+
item
.
Slug
,
})
}
return
Json
(
200
,
dtos
)
}
func
DeletePlaylist
(
c
*
middleware
.
Context
)
Response
{
...
...
pkg/models/playlist.go
View file @
0918063c
...
...
@@ -34,6 +34,17 @@ type Playlists []*Playlist
type
PlaylistDashboards
[]
*
PlaylistDashboard
//
// DTOS
//
type
PlaylistDashboardDto
struct
{
Id
int64
`json:"id"`
Slug
string
`json:"slug"`
Title
string
`json:"title"`
Uri
string
`json:"uri"`
}
//
// COMMANDS
//
type
PlaylistQuery
struct
{
...
...
pkg/services/sqlstore/playlist.go
View file @
0918063c
...
...
@@ -105,6 +105,7 @@ func GetPlaylistDashboards(query *m.GetPlaylistDashboardsQuery) error {
var
playlist
=
m
.
Playlist
{}
hasPlaylist
,
err
:=
x
.
Id
(
query
.
Id
)
.
Get
(
&
playlist
)
query
.
Result
=
&
dashboards
if
err
!=
nil
{
...
...
public/app/features/playlist/playlist_routes.js
View file @
0918063c
...
...
@@ -33,9 +33,6 @@ function (angular, config, _) {
.
then
(
function
(
playlist
)
{
return
backendSrv
.
get
(
'/api/playlists/'
+
playlistId
+
'/dashboards'
)
.
then
(
function
(
dashboards
)
{
_
.
each
(
dashboards
,
function
(
dashboard
)
{
dashboard
.
uri
=
'db/'
+
dashboard
.
slug
;
});
playlistSrv
.
start
(
dashboards
,
playlist
.
timespan
);
});
});
...
...
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