started work datasources admin

This commit is contained in:
Torkel Ödegaard
2014-12-16 12:04:08 +01:00
parent f665a30d28
commit b70a3f0958
14 changed files with 104 additions and 21 deletions
+4
View File
@@ -25,6 +25,10 @@ func Register(m *macaron.Macaron) {
m.Post("/api/account/using/:id", auth, SetUsingAccount)
m.Get("/api/account/others", auth, GetOtherAccounts)
// datasources
m.Get("/admin/datasources/", auth, Index)
m.Get("/api/admin/datasources/", auth, GetDataSources)
// user register
m.Get("/register/*_", Index)
m.Post("/api/account", CreateAccount)
+17
View File
@@ -0,0 +1,17 @@
package api
import (
"github.com/torkelo/grafana-pro/pkg/bus"
"github.com/torkelo/grafana-pro/pkg/middleware"
m "github.com/torkelo/grafana-pro/pkg/models"
)
func GetDataSources(c *middleware.Context) {
query := m.GetDataSourcesQuery{AccountId: c.Account.Id}
err := bus.SendQuery(&query)
if err != nil {
c.JsonApiErr(500, "Failed to query datasources", err)
return
}
}