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
b28ea0b4
Commit
b28ea0b4
authored
Dec 05, 2017
by
bergquist
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dashboards as cfg: type
parent
2a18345e
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
7 additions
and
7 deletions
+7
-7
pkg/services/provisioning/dashboards/dashboard.go
+1
-1
pkg/services/provisioning/dashboards/file_reader.go
+1
-1
pkg/services/provisioning/dashboards/file_reader_test.go
+5
-5
No files found.
pkg/services/provisioning/dashboards/dashboard.go
View file @
b28ea0b4
...
...
@@ -33,7 +33,7 @@ func (provider *DashboardProvisioner) Provision(ctx context.Context) error {
for
_
,
cfg
:=
range
cfgs
{
switch
cfg
.
Type
{
case
"file"
:
fileReader
,
err
:=
NewDashboardFile
r
eader
(
cfg
,
provider
.
log
.
New
(
"type"
,
cfg
.
Type
,
"name"
,
cfg
.
Name
))
fileReader
,
err
:=
NewDashboardFile
R
eader
(
cfg
,
provider
.
log
.
New
(
"type"
,
cfg
.
Type
,
"name"
,
cfg
.
Name
))
if
err
!=
nil
{
return
err
}
...
...
pkg/services/provisioning/dashboards/file_reader.go
View file @
b28ea0b4
...
...
@@ -26,7 +26,7 @@ type fileReader struct {
cache
*
gocache
.
Cache
}
func
NewDashboardFile
r
eader
(
cfg
*
DashboardsAsConfig
,
log
log
.
Logger
)
(
*
fileReader
,
error
)
{
func
NewDashboardFile
R
eader
(
cfg
*
DashboardsAsConfig
,
log
log
.
Logger
)
(
*
fileReader
,
error
)
{
path
,
ok
:=
cfg
.
Options
[
"folder"
]
.
(
string
)
if
!
ok
{
return
nil
,
fmt
.
Errorf
(
"Failed to load dashboards. folder param is not a string"
)
...
...
pkg/services/provisioning/dashboards/file_reader_test.go
View file @
b28ea0b4
...
...
@@ -41,7 +41,7 @@ func TestDashboardFileReader(t *testing.T) {
Convey
(
"Can read default dashboard"
,
func
()
{
cfg
.
Options
[
"folder"
]
=
defaultDashboards
reader
,
err
:=
NewDashboardFile
r
eader
(
cfg
,
logger
)
reader
,
err
:=
NewDashboardFile
R
eader
(
cfg
,
logger
)
So
(
err
,
ShouldBeNil
)
err
=
reader
.
walkFolder
()
...
...
@@ -58,7 +58,7 @@ func TestDashboardFileReader(t *testing.T) {
Slug
:
"grafana"
,
})
reader
,
err
:=
NewDashboardFile
r
eader
(
cfg
,
logger
)
reader
,
err
:=
NewDashboardFile
R
eader
(
cfg
,
logger
)
So
(
err
,
ShouldBeNil
)
err
=
reader
.
walkFolder
()
...
...
@@ -77,7 +77,7 @@ func TestDashboardFileReader(t *testing.T) {
Slug
:
"grafana"
,
})
reader
,
err
:=
NewDashboardFile
r
eader
(
cfg
,
logger
)
reader
,
err
:=
NewDashboardFile
R
eader
(
cfg
,
logger
)
So
(
err
,
ShouldBeNil
)
err
=
reader
.
walkFolder
()
...
...
@@ -94,7 +94,7 @@ func TestDashboardFileReader(t *testing.T) {
Folder
:
""
,
}
_
,
err
:=
NewDashboardFile
r
eader
(
cfg
,
logger
)
_
,
err
:=
NewDashboardFile
R
eader
(
cfg
,
logger
)
So
(
err
,
ShouldNotBeNil
)
})
...
...
@@ -109,7 +109,7 @@ func TestDashboardFileReader(t *testing.T) {
},
}
_
,
err
:=
NewDashboardFile
r
eader
(
cfg
,
logger
)
_
,
err
:=
NewDashboardFile
R
eader
(
cfg
,
logger
)
So
(
err
,
ShouldBeNil
)
})
})
...
...
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