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
9cebb23e
Commit
9cebb23e
authored
Nov 30, 2017
by
bergquist
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dashboards as cfg: revert minor changes
parent
74e12c26
Show whitespace changes
Inline
Side-by-side
Showing
27 changed files
with
20 additions
and
13 deletions
+20
-13
pkg/api/dashboard.go
+7
-0
pkg/services/provisioning/dashboards/config_reader.go
+1
-1
pkg/services/provisioning/dashboards/dashboard.go
+1
-1
pkg/services/provisioning/dashboards/dashboard_test.go
+1
-1
pkg/services/provisioning/dashboards/file_reader.go
+1
-1
pkg/services/provisioning/dashboards/file_reader_test.go
+1
-1
pkg/services/provisioning/dashboards/test-configs/dashboards-from-disk/dev-dashboards.yaml
+0
-0
pkg/services/provisioning/dashboards/test-dashboards/broken-dashboards/empty-json.json
+0
-0
pkg/services/provisioning/dashboards/test-dashboards/broken-dashboards/invalid.json
+0
-0
pkg/services/provisioning/dashboards/test-dashboards/folder-one/dashboard1.json
+0
-0
pkg/services/provisioning/dashboards/test-dashboards/folder-one/dashboard2.json
+0
-0
pkg/services/provisioning/dashboards/test-dashboards/one-dashboard/dashboard1.json
+0
-0
pkg/services/provisioning/dashboards/types.go
+1
-1
pkg/services/provisioning/datasources/datasources.go
+1
-1
pkg/services/provisioning/datasources/datasources_test.go
+1
-1
pkg/services/provisioning/datasources/test-configs/all-properties/all-properties.yaml
+0
-0
pkg/services/provisioning/datasources/test-configs/all-properties/not.yaml.txt
+0
-0
pkg/services/provisioning/datasources/test-configs/all-properties/second.yaml
+0
-0
pkg/services/provisioning/datasources/test-configs/broken-yaml/broken.yaml
+0
-0
pkg/services/provisioning/datasources/test-configs/double-default/default-1.yaml
+0
-0
pkg/services/provisioning/datasources/test-configs/double-default/default-2.yaml
+0
-0
pkg/services/provisioning/datasources/test-configs/insert-two-delete-two/one-datasources.yaml
+0
-0
pkg/services/provisioning/datasources/test-configs/insert-two-delete-two/two-datasources.yml
+0
-0
pkg/services/provisioning/datasources/test-configs/two-datasources/two-datasources.yaml
+0
-0
pkg/services/provisioning/datasources/test-configs/zero-datasources/placeholder-for-git
+0
-0
pkg/services/provisioning/datasources/types.go
+1
-1
pkg/services/provisioning/provisioning.go
+4
-4
No files found.
pkg/api/dashboard.go
View file @
9cebb23e
...
...
@@ -3,6 +3,7 @@ package api
import
(
"encoding/json"
"fmt"
//"github.com/grafana/grafana/pkg/services/dashboards"
"os"
"path"
"strings"
...
...
@@ -124,6 +125,12 @@ func PostDashboard(c *middleware.Context, cmd m.SaveDashboardCommand) Response {
dash
:=
cmd
.
GetDashboardModel
()
// dashItem := &dashboards.SaveDashboardItem{
// Dashboard: dash,
// Message: cmd.Message,
// }
// err := dashboards.SaveDashboard(dashItem)
// Check if Title is empty
if
dash
.
Title
==
""
{
return
ApiError
(
400
,
m
.
ErrDashboardTitleEmpty
.
Error
(),
nil
)
...
...
pkg/services/provisioning/dashboard/config_reader.go
→
pkg/services/provisioning/dashboard
s
/config_reader.go
View file @
9cebb23e
package
dashboard
package
dashboard
s
import
(
"io/ioutil"
...
...
pkg/services/provisioning/dashboard/dashboard.go
→
pkg/services/provisioning/dashboard
s
/dashboard.go
View file @
9cebb23e
package
dashboard
package
dashboard
s
import
(
"context"
...
...
pkg/services/provisioning/dashboard/dashboard_test.go
→
pkg/services/provisioning/dashboard
s
/dashboard_test.go
View file @
9cebb23e
package
dashboard
package
dashboard
s
import
(
"testing"
...
...
pkg/services/provisioning/dashboard/file_reader.go
→
pkg/services/provisioning/dashboard
s
/file_reader.go
View file @
9cebb23e
package
dashboard
package
dashboard
s
import
(
"context"
...
...
pkg/services/provisioning/dashboard/file_reader_test.go
→
pkg/services/provisioning/dashboard
s
/file_reader_test.go
View file @
9cebb23e
package
dashboard
package
dashboard
s
import
(
"github.com/grafana/grafana/pkg/bus"
...
...
pkg/services/provisioning/dashboard/test-configs/dashboards-from-disk/dev-dashboards.yaml
→
pkg/services/provisioning/dashboard
s
/test-configs/dashboards-from-disk/dev-dashboards.yaml
View file @
9cebb23e
File moved
pkg/services/provisioning/dashboard/test-dashboards/broken-dashboards/empty-json.json
→
pkg/services/provisioning/dashboard
s
/test-dashboards/broken-dashboards/empty-json.json
View file @
9cebb23e
File moved
pkg/services/provisioning/dashboard/test-dashboards/broken-dashboards/invalid.json
→
pkg/services/provisioning/dashboard
s
/test-dashboards/broken-dashboards/invalid.json
View file @
9cebb23e
File moved
pkg/services/provisioning/dashboard/test-dashboards/folder-one/dashboard1.json
→
pkg/services/provisioning/dashboard
s
/test-dashboards/folder-one/dashboard1.json
View file @
9cebb23e
File moved
pkg/services/provisioning/dashboard/test-dashboards/folder-one/dashboard2.json
→
pkg/services/provisioning/dashboard
s
/test-dashboards/folder-one/dashboard2.json
View file @
9cebb23e
File moved
pkg/services/provisioning/dashboard/test-dashboards/one-dashboard/dashboard1.json
→
pkg/services/provisioning/dashboard
s
/test-dashboards/one-dashboard/dashboard1.json
View file @
9cebb23e
File moved
pkg/services/provisioning/dashboard/types.go
→
pkg/services/provisioning/dashboard
s
/types.go
View file @
9cebb23e
package
dashboard
package
dashboard
s
import
(
"github.com/grafana/grafana/pkg/components/simplejson"
...
...
pkg/services/provisioning/datasource/datasources.go
→
pkg/services/provisioning/datasource
s
/datasources.go
View file @
9cebb23e
package
datasource
package
datasource
s
import
(
"errors"
...
...
pkg/services/provisioning/datasource/datasources_test.go
→
pkg/services/provisioning/datasource
s
/datasources_test.go
View file @
9cebb23e
package
datasource
package
datasource
s
import
(
"testing"
...
...
pkg/services/provisioning/datasource/test-configs/all-properties/all-properties.yaml
→
pkg/services/provisioning/datasource
s
/test-configs/all-properties/all-properties.yaml
View file @
9cebb23e
File moved
pkg/services/provisioning/datasource/test-configs/all-properties/not.yaml.txt
→
pkg/services/provisioning/datasource
s
/test-configs/all-properties/not.yaml.txt
View file @
9cebb23e
File moved
pkg/services/provisioning/datasource/test-configs/all-properties/second.yaml
→
pkg/services/provisioning/datasource
s
/test-configs/all-properties/second.yaml
View file @
9cebb23e
File moved
pkg/services/provisioning/datasource/test-configs/broken-yaml/broken.yaml
→
pkg/services/provisioning/datasource
s
/test-configs/broken-yaml/broken.yaml
View file @
9cebb23e
File moved
pkg/services/provisioning/datasource/test-configs/double-default/default-1.yaml
→
pkg/services/provisioning/datasource
s
/test-configs/double-default/default-1.yaml
View file @
9cebb23e
File moved
pkg/services/provisioning/datasource/test-configs/double-default/default-2.yaml
→
pkg/services/provisioning/datasource
s
/test-configs/double-default/default-2.yaml
View file @
9cebb23e
File moved
pkg/services/provisioning/datasource/test-configs/insert-two-delete-two/one-datasources.yaml
→
pkg/services/provisioning/datasource
s
/test-configs/insert-two-delete-two/one-datasources.yaml
View file @
9cebb23e
File moved
pkg/services/provisioning/datasource/test-configs/insert-two-delete-two/two-datasources.yml
→
pkg/services/provisioning/datasource
s
/test-configs/insert-two-delete-two/two-datasources.yml
View file @
9cebb23e
File moved
pkg/services/provisioning/datasource/test-configs/two-datasources/two-datasources.yaml
→
pkg/services/provisioning/datasource
s
/test-configs/two-datasources/two-datasources.yaml
View file @
9cebb23e
File moved
pkg/services/provisioning/datasource/test-configs/zero-datasources/placeholder-for-git
→
pkg/services/provisioning/datasource
s
/test-configs/zero-datasources/placeholder-for-git
View file @
9cebb23e
File moved
pkg/services/provisioning/datasource/types.go
→
pkg/services/provisioning/datasource
s
/types.go
View file @
9cebb23e
package
datasource
package
datasource
s
import
"github.com/grafana/grafana/pkg/models"
import
"github.com/grafana/grafana/pkg/components/simplejson"
...
...
pkg/services/provisioning/provisioning.go
View file @
9cebb23e
...
...
@@ -4,19 +4,19 @@ import (
"context"
"path/filepath"
"github.com/grafana/grafana/pkg/services/provisioning/dashboard"
"github.com/grafana/grafana/pkg/services/provisioning/datasource"
"github.com/grafana/grafana/pkg/services/provisioning/dashboard
s
"
"github.com/grafana/grafana/pkg/services/provisioning/datasource
s
"
ini
"gopkg.in/ini.v1"
)
func
Init
(
ctx
context
.
Context
,
homePath
string
,
cfg
*
ini
.
File
)
error
{
datasourcePath
:=
makeAbsolute
(
cfg
.
Section
(
"paths"
)
.
Key
(
"datasources"
)
.
String
(),
homePath
)
if
err
:=
datasource
.
Provision
(
datasourcePath
);
err
!=
nil
{
if
err
:=
datasource
s
.
Provision
(
datasourcePath
);
err
!=
nil
{
return
err
}
dashboardPath
:=
makeAbsolute
(
cfg
.
Section
(
"paths"
)
.
Key
(
"dashboards"
)
.
String
(),
homePath
)
_
,
err
:=
dashboard
.
Provision
(
ctx
,
dashboardPath
)
_
,
err
:=
dashboard
s
.
Provision
(
ctx
,
dashboardPath
)
if
err
!=
nil
{
return
err
}
...
...
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