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
fcd86fb2
Commit
fcd86fb2
authored
Feb 01, 2018
by
bergquist
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
make it easier for dashboards to generate ur;
parent
74ca6f6d
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
1 deletions
+6
-1
pkg/api/alerting.go
+1
-1
pkg/models/dashboards.go
+5
-0
No files found.
pkg/api/alerting.go
View file @
fcd86fb2
...
@@ -105,7 +105,7 @@ func transformToDTOs(alerts []*models.Alert, c *middleware.Context) ([]*dtos.Ale
...
@@ -105,7 +105,7 @@ func transformToDTOs(alerts []*models.Alert, c *middleware.Context) ([]*dtos.Ale
for
_
,
alert
:=
range
alertDTOs
{
for
_
,
alert
:=
range
alertDTOs
{
for
_
,
dash
:=
range
dashboardsQuery
.
Result
{
for
_
,
dash
:=
range
dashboardsQuery
.
Result
{
if
alert
.
DashboardId
==
dash
.
Id
{
if
alert
.
DashboardId
==
dash
.
Id
{
alert
.
DashbboardUri
=
models
.
GetDashboardUrl
(
dash
.
Uid
,
dash
.
Slug
)
alert
.
DashbboardUri
=
dash
.
GenerateUrl
(
)
break
break
}
}
}
}
...
...
pkg/models/dashboards.go
View file @
fcd86fb2
...
@@ -162,6 +162,11 @@ func (dash *Dashboard) GetUrl() string {
...
@@ -162,6 +162,11 @@ func (dash *Dashboard) GetUrl() string {
return
GetDashboardFolderUrl
(
dash
.
IsFolder
,
dash
.
Uid
,
dash
.
Slug
)
return
GetDashboardFolderUrl
(
dash
.
IsFolder
,
dash
.
Uid
,
dash
.
Slug
)
}
}
// Return the html url for a dashboard
func
(
dash
*
Dashboard
)
GenerateUrl
()
string
{
return
GetDashboardUrl
(
dash
.
Uid
,
dash
.
Slug
)
}
// GetDashboardFolderUrl return the html url for a folder if it's folder, otherwise for a dashboard
// GetDashboardFolderUrl return the html url for a folder if it's folder, otherwise for a dashboard
func
GetDashboardFolderUrl
(
isFolder
bool
,
uid
string
,
slug
string
)
string
{
func
GetDashboardFolderUrl
(
isFolder
bool
,
uid
string
,
slug
string
)
string
{
if
isFolder
{
if
isFolder
{
...
...
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