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
d8b90721
Commit
d8b90721
authored
Dec 18, 2015
by
utkarshcmu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Able to display login Id of the user in Last Updated By
parent
cb5c1bd2
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
3 deletions
+21
-3
pkg/api/dashboard.go
+21
-3
No files found.
pkg/api/dashboard.go
View file @
d8b90721
...
...
@@ -4,7 +4,6 @@ import (
"encoding/json"
"os"
"path"
"strconv"
"strings"
"github.com/grafana/grafana/pkg/api/dtos"
...
...
@@ -49,6 +48,20 @@ func GetDashboard(c *middleware.Context) {
}
dash
:=
query
.
Result
// Finding the last updater of the dashboard
updater
:=
"Anonymous"
if
dash
.
UpdatedBy
!=
0
{
userQuery
:=
m
.
GetUserByIdQuery
{
Id
:
dash
.
UpdatedBy
}
userErr
:=
bus
.
Dispatch
(
&
userQuery
)
if
userErr
!=
nil
{
updater
=
"Unknown"
}
else
{
user
:=
userQuery
.
Result
updater
=
user
.
Login
}
}
dto
:=
dtos
.
DashboardFullWithMeta
{
Dashboard
:
dash
.
Data
,
Meta
:
dtos
.
DashboardMeta
{
...
...
@@ -60,7 +73,7 @@ func GetDashboard(c *middleware.Context) {
CanEdit
:
canEditDashboard
(
c
.
OrgRole
),
Created
:
dash
.
Created
,
Updated
:
dash
.
Updated
,
UpdatedBy
:
strconv
.
FormatInt
(
dash
.
UpdatedBy
,
10
)
,
UpdatedBy
:
updater
,
},
}
...
...
@@ -89,7 +102,12 @@ func DeleteDashboard(c *middleware.Context) {
func
PostDashboard
(
c
*
middleware
.
Context
,
cmd
m
.
SaveDashboardCommand
)
{
cmd
.
OrgId
=
c
.
OrgId
cmd
.
UpdatedBy
=
c
.
UserId
if
!
c
.
IsSignedIn
{
cmd
.
UpdatedBy
=
0
}
else
{
cmd
.
UpdatedBy
=
c
.
UserId
}
dash
:=
cmd
.
GetDashboardModel
()
if
dash
.
Id
==
0
{
...
...
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