diff --git a/conf/grafana.ini b/conf/grafana.ini index b60b338b5bb..a39009b9ad3 100644 --- a/conf/grafana.ini +++ b/conf/grafana.ini @@ -63,24 +63,12 @@ type = sqlite3 host = 127.0.0.1:3306 name = grafana user = root -PASSWD = +password = ; For "postgres" only, either "disable", "require" or "verify-full" ssl_mode = disable ; For "sqlite3" only path = data/grafana.db -; [database] -; ; Either "mysql", "postgres" or "sqlite3", it's your choice -; type = postgres -; host = 127.0.0.1:5432 -; name = grafana -; user = grafana -; password = grafana -; ; For "postgres" only, either "disable", "require" or "verify-full" -; ssl_mode = disable -; ; For "sqlite3" only -; path = data/grafana.db -; [log] root_path = ; Either "console", "file", "conn", "smtp" or "database", default is "console" diff --git a/grafana b/grafana index 1d769fe41cf..b66894f7278 160000 --- a/grafana +++ b/grafana @@ -1 +1 @@ -Subproject commit 1d769fe41cf348d88636938fcb06afcf3425d45b +Subproject commit b66894f72780cbed0edb01f9bd26cc47298daa98 diff --git a/pkg/api/api.go b/pkg/api/api.go index 434535c6891..48180af74dc 100644 --- a/pkg/api/api.go +++ b/pkg/api/api.go @@ -27,11 +27,14 @@ func Register(m *macaron.Macaron) { m.Get("/api/account/others", auth, GetOtherAccounts) // data sources - m.Get("/admin/datasources/", auth, Index) - m.Get("/api/admin/datasources/list", auth, GetDataSources) - m.Put("/api/admin/datasources", auth, AddDataSource) - m.Post("/api/admin/datasources", auth, UpdateDataSource) - m.Delete("/api/admin/datasources/:id", auth, DeleteDataSource) + m.Get("/acount/datasources/", auth, Index) + m.Get("/api/datasources/list", auth, GetDataSources) + m.Put("/api/datasources", auth, AddDataSource) + m.Post("/api/datasources", auth, UpdateDataSource) + m.Delete("/api/datasources/:id", auth, DeleteDataSource) + + // system admin + m.Get("/admin", auth, Index) // data source proxy m.Any("/api/datasources/proxy/:id/*", auth, ProxyDataSourceRequest) diff --git a/pkg/api/frontendsettings.go b/pkg/api/frontendsettings.go index 0e0e75699b6..a2b98e6e410 100644 --- a/pkg/api/frontendsettings.go +++ b/pkg/api/frontendsettings.go @@ -25,7 +25,7 @@ func getFrontendSettings(c *middleware.Context) (map[string]interface{}, error) datasources := make(map[string]interface{}) - for i, ds := range accountDataSources { + for _, ds := range accountDataSources { url := ds.Url if ds.Access == m.DS_ACCESS_PROXY { @@ -46,12 +46,6 @@ func getFrontendSettings(c *middleware.Context) (map[string]interface{}, error) } } - // temp hack, first is always default - // TODO: implement default ds account setting - if i == 0 { - dsMap["default"] = true - } - datasources[ds.Name] = dsMap }