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
00a6efa1
Commit
00a6efa1
authored
Feb 01, 2016
by
utkarshcmu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Excluded total calculations from backend
parent
c5377fb4
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
1 additions
and
63 deletions
+1
-63
pkg/api/dashboard.go
+0
-26
pkg/api/dtos/models.go
+0
-3
public/app/features/dashboard/partials/settings.html
+1
-34
No files found.
pkg/api/dashboard.go
View file @
00a6efa1
...
...
@@ -58,9 +58,6 @@ func GetDashboard(c *middleware.Context) {
creator
=
getUserLogin
(
dash
.
CreatedBy
)
}
// Finding total panels and queries on the dashboard
totalRows
,
totalPanels
,
totalQueries
:=
getTotalRowsPanelsAndQueries
(
dash
.
Data
)
dto
:=
dtos
.
DashboardFullWithMeta
{
Dashboard
:
dash
.
Data
,
Meta
:
dtos
.
DashboardMeta
{
...
...
@@ -74,9 +71,6 @@ func GetDashboard(c *middleware.Context) {
Updated
:
dash
.
Updated
,
UpdatedBy
:
updater
,
CreatedBy
:
creator
,
TotalRows
:
totalRows
,
TotalPanels
:
totalPanels
,
TotalQueries
:
totalQueries
,
Version
:
dash
.
Version
,
},
}
...
...
@@ -95,26 +89,6 @@ func getUserLogin(userId int64) string {
}
}
func
getTotalRowsPanelsAndQueries
(
data
map
[
string
]
interface
{})
(
int
,
int
,
int
)
{
totalRows
,
totalPanels
,
totalQueries
:=
0
,
0
,
0
if
rows
,
rowsOk
:=
data
[
"rows"
];
rowsOk
{
totalRows
=
len
(
rows
.
([]
interface
{}))
if
totalRows
>
0
{
for
_
,
rowElement
:=
range
rows
.
([]
interface
{})
{
if
panels
,
panelsOk
:=
rowElement
.
(
map
[
string
]
interface
{})[
"panels"
];
panelsOk
{
totalPanels
+=
len
(
panels
.
([]
interface
{}))
for
_
,
panelElement
:=
range
panels
.
([]
interface
{})
{
if
targets
,
targetsOk
:=
panelElement
.
(
map
[
string
]
interface
{})[
"targets"
];
targetsOk
{
totalQueries
+=
len
(
targets
.
([]
interface
{}))
}
}
}
}
}
}
return
totalRows
,
totalPanels
,
totalQueries
}
func
DeleteDashboard
(
c
*
middleware
.
Context
)
{
slug
:=
c
.
Params
(
":slug"
)
...
...
pkg/api/dtos/models.go
View file @
00a6efa1
...
...
@@ -43,9 +43,6 @@ type DashboardMeta struct {
Updated
time
.
Time
`json:"updated"`
UpdatedBy
string
`json:"updatedBy"`
CreatedBy
string
`json:"createdBy"`
TotalRows
int
`json:"totalRows"`
TotalPanels
int
`json:"totalPanels"`
TotalQueries
int
`json:"totalQueries"`
Version
int
`json:"version"`
}
...
...
public/app/features/dashboard/partials/settings.html
View file @
00a6efa1
...
...
@@ -167,40 +167,7 @@
<div
class=
"tight-form"
>
<ul
class=
"tight-form-list"
>
<li
class=
"tight-form-item"
style=
"width: 120px"
>
Total rows:
</li>
<li
class=
"tight-form-item"
style=
"width: 180px"
>
{{dashboardMeta.totalRows}}
</li>
</ul>
<div
class=
"clearfix"
></div>
</div>
<div
class=
"tight-form"
>
<ul
class=
"tight-form-list"
>
<li
class=
"tight-form-item"
style=
"width: 120px"
>
Total panels:
</li>
<li
class=
"tight-form-item"
style=
"width: 180px"
>
{{dashboardMeta.totalPanels}}
</li>
</ul>
<div
class=
"clearfix"
></div>
</div>
<div
class=
"tight-form"
>
<ul
class=
"tight-form-list"
>
<li
class=
"tight-form-item"
style=
"width: 120px"
>
Total queries:
</li>
<li
class=
"tight-form-item"
style=
"width: 180px"
>
{{dashboardMeta.totalQueries}}
</li>
</ul>
<div
class=
"clearfix"
></div>
</div>
<div
class=
"tight-form"
>
<ul
class=
"tight-form-list"
>
<li
class=
"tight-form-item"
style=
"width: 120px"
>
Version:
Current version:
</li>
<li
class=
"tight-form-item"
style=
"width: 180px"
>
{{dashboardMeta.version}}
...
...
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