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
c41c771e
Commit
c41c771e
authored
May 24, 2016
by
Torkel Ödegaard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix(home dashboard): fixed handling error when default dashboard is not found, fixes #5141
parent
f1ec270e
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
6 deletions
+5
-6
pkg/api/dashboard.go
+5
-6
No files found.
pkg/api/dashboard.go
View file @
c41c771e
...
@@ -8,6 +8,7 @@ import (
...
@@ -8,6 +8,7 @@ import (
"github.com/grafana/grafana/pkg/api/dtos"
"github.com/grafana/grafana/pkg/api/dtos"
"github.com/grafana/grafana/pkg/bus"
"github.com/grafana/grafana/pkg/bus"
"github.com/grafana/grafana/pkg/log"
"github.com/grafana/grafana/pkg/metrics"
"github.com/grafana/grafana/pkg/metrics"
"github.com/grafana/grafana/pkg/middleware"
"github.com/grafana/grafana/pkg/middleware"
m
"github.com/grafana/grafana/pkg/models"
m
"github.com/grafana/grafana/pkg/models"
...
@@ -167,14 +168,12 @@ func GetHomeDashboard(c *middleware.Context) {
...
@@ -167,14 +168,12 @@ func GetHomeDashboard(c *middleware.Context) {
if
prefsQuery
.
Result
.
HomeDashboardId
!=
0
{
if
prefsQuery
.
Result
.
HomeDashboardId
!=
0
{
slugQuery
:=
m
.
GetDashboardSlugByIdQuery
{
Id
:
prefsQuery
.
Result
.
HomeDashboardId
}
slugQuery
:=
m
.
GetDashboardSlugByIdQuery
{
Id
:
prefsQuery
.
Result
.
HomeDashboardId
}
err
:=
bus
.
Dispatch
(
&
slugQuery
)
err
:=
bus
.
Dispatch
(
&
slugQuery
)
if
err
!=
nil
{
if
err
==
nil
{
c
.
JsonApiErr
(
500
,
"Failed to get slug from database"
,
err
)
return
}
dashRedirect
:=
dtos
.
DashboardRedirect
{
RedirectUri
:
"db/"
+
slugQuery
.
Result
}
dashRedirect
:=
dtos
.
DashboardRedirect
{
RedirectUri
:
"db/"
+
slugQuery
.
Result
}
c
.
JSON
(
200
,
&
dashRedirect
)
c
.
JSON
(
200
,
&
dashRedirect
)
return
}
else
{
log
.
Warn
(
"Failed to get slug from database, %s"
,
err
.
Error
())
}
}
}
filePath
:=
path
.
Join
(
setting
.
StaticRootPath
,
"dashboards/home.json"
)
filePath
:=
path
.
Join
(
setting
.
StaticRootPath
,
"dashboards/home.json"
)
...
...
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