Commit 9cebb23e by bergquist

dashboards as cfg: revert minor changes

parent 74e12c26
......@@ -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)
......
package dashboard
package dashboards
import (
"github.com/grafana/grafana/pkg/components/simplejson"
......
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
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment