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
e0ffcda3
Commit
e0ffcda3
authored
Dec 18, 2015
by
utkarshcmu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added UI , DB settings
parent
78fe5883
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
70 additions
and
5 deletions
+70
-5
pkg/api/dashboard.go
+2
-0
pkg/api/dtos/models.go
+3
-0
pkg/models/dashboards.go
+8
-0
pkg/services/sqlstore/migrations/dashboard_mig.go
+4
-4
public/app/features/dashboard/partials/settings.html
+53
-1
No files found.
pkg/api/dashboard.go
View file @
e0ffcda3
...
@@ -59,6 +59,8 @@ func GetDashboard(c *middleware.Context) {
...
@@ -59,6 +59,8 @@ func GetDashboard(c *middleware.Context) {
CanEdit
:
canEditDashboard
(
c
.
OrgRole
),
CanEdit
:
canEditDashboard
(
c
.
OrgRole
),
Created
:
dash
.
Created
,
Created
:
dash
.
Created
,
Updated
:
dash
.
Updated
,
Updated
:
dash
.
Updated
,
CreatedBy
:
dash
.
CreatedBy
,
UpdatedBy
:
dash
.
UpdatedBy
,
},
},
}
}
...
...
pkg/api/dtos/models.go
View file @
e0ffcda3
...
@@ -41,6 +41,8 @@ type DashboardMeta struct {
...
@@ -41,6 +41,8 @@ type DashboardMeta struct {
Expires
time
.
Time
`json:"expires"`
Expires
time
.
Time
`json:"expires"`
Created
time
.
Time
`json:"created"`
Created
time
.
Time
`json:"created"`
Updated
time
.
Time
`json:"updated"`
Updated
time
.
Time
`json:"updated"`
CreatedBy
string
`json:"createdBy"`
UpdatedBy
string
`json:"updatedBy"`
}
}
type
DashboardFullWithMeta
struct
{
type
DashboardFullWithMeta
struct
{
...
@@ -61,6 +63,7 @@ type DataSource struct {
...
@@ -61,6 +63,7 @@ type DataSource struct {
BasicAuth
bool
`json:"basicAuth"`
BasicAuth
bool
`json:"basicAuth"`
BasicAuthUser
string
`json:"basicAuthUser"`
BasicAuthUser
string
`json:"basicAuthUser"`
BasicAuthPassword
string
`json:"basicAuthPassword"`
BasicAuthPassword
string
`json:"basicAuthPassword"`
WithCredentials
bool
`json:"withCredentials"`
IsDefault
bool
`json:"isDefault"`
IsDefault
bool
`json:"isDefault"`
JsonData
map
[
string
]
interface
{}
`json:"jsonData"`
JsonData
map
[
string
]
interface
{}
`json:"jsonData"`
}
}
...
...
pkg/models/dashboards.go
View file @
e0ffcda3
...
@@ -33,6 +33,9 @@ type Dashboard struct {
...
@@ -33,6 +33,9 @@ type Dashboard struct {
Created
time
.
Time
Created
time
.
Time
Updated
time
.
Time
Updated
time
.
Time
CreatedBy
string
UpdatedBy
string
Title
string
Title
string
Data
map
[
string
]
interface
{}
Data
map
[
string
]
interface
{}
}
}
...
@@ -45,6 +48,8 @@ func NewDashboard(title string) *Dashboard {
...
@@ -45,6 +48,8 @@ func NewDashboard(title string) *Dashboard {
dash
.
Title
=
title
dash
.
Title
=
title
dash
.
Created
=
time
.
Now
()
dash
.
Created
=
time
.
Now
()
dash
.
Updated
=
time
.
Now
()
dash
.
Updated
=
time
.
Now
()
// TODO:dash.CreatedBy = "Creator"
// TODO:dash.UpdatedBy = "Creator"
dash
.
UpdateSlug
()
dash
.
UpdateSlug
()
return
dash
return
dash
}
}
...
@@ -76,11 +81,14 @@ func NewDashboardFromJson(data map[string]interface{}) *Dashboard {
...
@@ -76,11 +81,14 @@ func NewDashboardFromJson(data map[string]interface{}) *Dashboard {
if
dash
.
Data
[
"version"
]
!=
nil
{
if
dash
.
Data
[
"version"
]
!=
nil
{
dash
.
Version
=
int
(
dash
.
Data
[
"version"
]
.
(
float64
))
dash
.
Version
=
int
(
dash
.
Data
[
"version"
]
.
(
float64
))
dash
.
Updated
=
time
.
Now
()
dash
.
Updated
=
time
.
Now
()
// TODO:dash.UpdatedBy = "Updater"
}
}
}
else
{
}
else
{
dash
.
Data
[
"version"
]
=
0
dash
.
Data
[
"version"
]
=
0
dash
.
Created
=
time
.
Now
()
dash
.
Created
=
time
.
Now
()
dash
.
Updated
=
time
.
Now
()
dash
.
Updated
=
time
.
Now
()
// TODO:dash.CreatedBy = "Creator"
// TODO:dash.UpdatedBy = "Creator"
}
}
return
dash
return
dash
...
...
pkg/services/sqlstore/migrations/dashboard_mig.go
View file @
e0ffcda3
...
@@ -94,12 +94,12 @@ func addDashboardMigration(mg *Migrator) {
...
@@ -94,12 +94,12 @@ func addDashboardMigration(mg *Migrator) {
Mysql
(
"ALTER TABLE dashboard MODIFY data MEDIUMTEXT;"
))
Mysql
(
"ALTER TABLE dashboard MODIFY data MEDIUMTEXT;"
))
// add column to store creator of a dashboard
// add column to store creator of a dashboard
mg
.
AddMigration
(
"Add column created_by"
,
NewAddColumnMigration
(
dashboardV2
,
&
Column
{
mg
.
AddMigration
(
"Add column created_by
in dashboard - v2
"
,
NewAddColumnMigration
(
dashboardV2
,
&
Column
{
Name
:
"created_by"
,
Type
:
DB_
BigInt
,
Nullable
:
true
,
Name
:
"created_by"
,
Type
:
DB_
NVarchar
,
Length
:
255
,
Nullable
:
false
,
Default
:
"Anonymous"
,
}))
}))
// add column to store updater of a dashboard
// add column to store updater of a dashboard
mg
.
AddMigration
(
"Add column updated_by"
,
NewAddColumnMigration
(
dashboardV2
,
&
Column
{
mg
.
AddMigration
(
"Add column updated_by
in dashboard - v2
"
,
NewAddColumnMigration
(
dashboardV2
,
&
Column
{
Name
:
"updated_by"
,
Type
:
DB_
BigInt
,
Nullable
:
true
,
Name
:
"updated_by"
,
Type
:
DB_
NVarchar
,
Length
:
255
,
Nullable
:
false
,
Default
:
"Anonymous"
,
}))
}))
}
}
public/app/features/dashboard/partials/settings.html
View file @
e0ffcda3
...
@@ -5,7 +5,7 @@
...
@@ -5,7 +5,7 @@
</div>
</div>
<div
ng-model=
"editor.index"
bs-tabs
style=
"text-transform:capitalize;"
>
<div
ng-model=
"editor.index"
bs-tabs
style=
"text-transform:capitalize;"
>
<div
ng-repeat=
"tab in ['General', 'Rows', 'Links', 'Time picker']"
data-title=
"{{tab}}"
>
<div
ng-repeat=
"tab in ['General', 'Rows', 'Links', 'Time picker'
, 'Metadata'
]"
data-title=
"{{tab}}"
>
</div>
</div>
</div>
</div>
...
@@ -114,6 +114,58 @@
...
@@ -114,6 +114,58 @@
<gf-time-picker-settings
dashboard=
"dashboard"
></gf-time-picker-settings>
<gf-time-picker-settings
dashboard=
"dashboard"
></gf-time-picker-settings>
</div>
</div>
<div
ng-if=
"editor.index == 4"
>
<div
class=
"editor-row"
>
<div
class=
"tight-form-section"
>
<h5>
Info
</h5>
<div
class=
"tight-form"
>
<ul
class=
"tight-form-list"
>
<li
class=
"tight-form-item"
style=
"width: 120px"
>
Last updated at:
</li>
<li
class=
"tight-form-item"
style=
"width: 180px"
>
{{formatDate(dashboardMeta.updated)}}
</li>
</ul>
<div
class=
"clearfix"
></div>
</div>
<div
class=
"tight-form"
>
<ul
class=
"tight-form-list"
>
<li
class=
"tight-form-item"
style=
"width: 120px"
>
Last updated by:
</li>
<li
class=
"tight-form-item"
style=
"width: 180px"
>
{{dashboardMeta.updatedBy}}
</li>
</ul>
<div
class=
"clearfix"
></div>
</div>
<div
class=
"tight-form last"
>
<ul
class=
"tight-form-list"
>
<li
class=
"tight-form-item"
style=
"width: 120px"
>
Created at:
</li>
<li
class=
"tight-form-item"
style=
"width: 180px"
>
{{formatDate(dashboardMeta.created)}}
</li>
</ul>
<div
class=
"clearfix"
></div>
</div>
<div
class=
"tight-form last"
>
<ul
class=
"tight-form-list"
>
<li
class=
"tight-form-item"
style=
"width: 120px"
>
Created by:
</li>
<li
class=
"tight-form-item"
style=
"width: 180px"
>
{{dashboardMeta.createdBy}}
</li>
</ul>
<div
class=
"clearfix"
></div>
</div>
</div>
</div>
</div>
</div>
</div>
<div
class=
"clearfix"
></div>
<div
class=
"clearfix"
></div>
...
...
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