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
cc0cc8dd
Commit
cc0cc8dd
authored
Feb 05, 2018
by
Carl Bergquist
Committed by
Torkel Ödegaard
Feb 05, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
changes to new urlformat for home dashboard (#10738)
parent
0701188e
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
7 additions
and
6 deletions
+7
-6
pkg/api/dashboard.go
+3
-2
pkg/models/dashboards.go
+1
-1
pkg/services/alerting/eval_context.go
+1
-1
pkg/services/sqlstore/dashboard.go
+1
-1
public/app/routes/dashboard_loaders.ts
+1
-1
No files found.
pkg/api/dashboard.go
View file @
cc0cc8dd
...
...
@@ -293,10 +293,11 @@ func GetHomeDashboard(c *middleware.Context) Response {
}
if
prefsQuery
.
Result
.
HomeDashboardId
!=
0
{
slugQuery
:=
m
.
GetDashboard
Slug
ByIdQuery
{
Id
:
prefsQuery
.
Result
.
HomeDashboardId
}
slugQuery
:=
m
.
GetDashboard
Ref
ByIdQuery
{
Id
:
prefsQuery
.
Result
.
HomeDashboardId
}
err
:=
bus
.
Dispatch
(
&
slugQuery
)
if
err
==
nil
{
dashRedirect
:=
dtos
.
DashboardRedirect
{
RedirectUri
:
"db/"
+
slugQuery
.
Result
}
url
:=
m
.
GetDashboardUrl
(
slugQuery
.
Result
.
Uid
,
slugQuery
.
Result
.
Slug
)
dashRedirect
:=
dtos
.
DashboardRedirect
{
RedirectUri
:
url
}
return
Json
(
200
,
&
dashRedirect
)
}
else
{
log
.
Warn
(
"Failed to get slug from database, %s"
,
err
.
Error
())
...
...
pkg/models/dashboards.go
View file @
cc0cc8dd
...
...
@@ -293,7 +293,7 @@ type DashboardRef struct {
Slug
string
}
type
GetDashboard
UID
ByIdQuery
struct
{
type
GetDashboard
Ref
ByIdQuery
struct
{
Id
int64
Result
*
DashboardRef
}
pkg/services/alerting/eval_context.go
View file @
cc0cc8dd
...
...
@@ -90,7 +90,7 @@ func (c *EvalContext) GetDashboardUID() (*m.DashboardRef, error) {
return
c
.
dashboardRef
,
nil
}
uidQuery
:=
&
m
.
GetDashboard
UID
ByIdQuery
{
Id
:
c
.
Rule
.
DashboardId
}
uidQuery
:=
&
m
.
GetDashboard
Ref
ByIdQuery
{
Id
:
c
.
Rule
.
DashboardId
}
if
err
:=
bus
.
Dispatch
(
uidQuery
);
err
!=
nil
{
return
nil
,
err
}
...
...
pkg/services/sqlstore/dashboard.go
View file @
cc0cc8dd
...
...
@@ -569,7 +569,7 @@ func GetDashboardsBySlug(query *m.GetDashboardsBySlugQuery) error {
return
nil
}
func
GetDashboardUIDById
(
query
*
m
.
GetDashboard
UID
ByIdQuery
)
error
{
func
GetDashboardUIDById
(
query
*
m
.
GetDashboard
Ref
ByIdQuery
)
error
{
var
rawSql
=
`SELECT uid, slug from dashboard WHERE Id=?`
us
:=
&
m
.
DashboardRef
{}
...
...
public/app/routes/dashboard_loaders.ts
View file @
cc0cc8dd
...
...
@@ -9,7 +9,7 @@ export class LoadDashboardCtrl {
if
(
!
$routeParams
.
uid
&&
!
$routeParams
.
slug
)
{
backendSrv
.
get
(
'/api/dashboards/home'
).
then
(
function
(
homeDash
)
{
if
(
homeDash
.
redirectUri
)
{
$location
.
path
(
'dashboard/'
+
homeDash
.
redirectUri
);
$location
.
path
(
homeDash
.
redirectUri
);
}
else
{
var
meta
=
homeDash
.
meta
;
meta
.
canSave
=
meta
.
canShare
=
meta
.
canStar
=
false
;
...
...
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