dashboards as cfg: revert minor changes
This commit is contained in:
1 parent
74e12c260f
commit
9cebb23e01
27 files changed
+20
-13
No files matched your search
@@ -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)
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
package dashboard
|
||||
package dashboards
|
||||
|
||||
import (
|
||||
"io/ioutil"
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
package dashboard
|
||||
package dashboards
|
||||
|
||||
import (
|
||||
"context"
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
package dashboard
|
||||
package dashboards
|
||||
|
||||
import (
|
||||
"testing"
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
package dashboard
|
||||
package dashboards
|
||||
|
||||
import (
|
||||
"context"
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
package dashboard
|
||||
package dashboards
|
||||
|
||||
import (
|
||||
"github.com/grafana/grafana/pkg/bus"
|
||||
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
+1
-1
@@ -1,4 +1,4 @@
|
||||
package dashboard
|
||||
package dashboards
|
||||
|
||||
import (
|
||||
"github.com/grafana/grafana/pkg/components/simplejson"
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
package datasource
|
||||
package datasources
|
||||
|
||||
import (
|
||||
"errors"
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
package datasource
|
||||
package datasources
|
||||
|
||||
import (
|
||||
"testing"
|
||||
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
+1
-1
@@ -1,4 +1,4 @@
|
||||
package datasource
|
||||
package datasources
|
||||
|
||||
import "github.com/grafana/grafana/pkg/models"
|
||||
import "github.com/grafana/grafana/pkg/components/simplejson"
|
||||
@@ -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/dashboards"
|
||||
"github.com/grafana/grafana/pkg/services/provisioning/datasources"
|
||||
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 := datasources.Provision(datasourcePath); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
dashboardPath := makeAbsolute(cfg.Section("paths").Key("dashboards").String(), homePath)
|
||||
_, err := dashboard.Provision(ctx, dashboardPath)
|
||||
_, err := dashboards.Provision(ctx, dashboardPath)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user