A lot of work on backend plugin model for frontend components, right now for data sources, will enable dropin plugins for data sources and panels, #1472

This commit is contained in:
Torkel Ödegaard
2015-02-27 22:29:00 +01:00
parent 5bd5713a52
commit c198242292
42 changed files with 159 additions and 249 deletions

View File

@@ -40,7 +40,7 @@ type DataSource struct {
Id int64 `json:"id"`
OrgId int64 `json:"orgId"`
Name string `json:"name"`
Type m.DsType `json:"type"`
Type string `json:"type"`
Access m.DsAccess `json:"access"`
Url string `json:"url"`
Password string `json:"password"`

View File

@@ -6,6 +6,7 @@ import (
"github.com/grafana/grafana/pkg/bus"
"github.com/grafana/grafana/pkg/middleware"
m "github.com/grafana/grafana/pkg/models"
"github.com/grafana/grafana/pkg/plugins"
"github.com/grafana/grafana/pkg/setting"
)
@@ -38,6 +39,13 @@ func getFrontendSettingsMap(c *middleware.Context) (map[string]interface{}, erro
"url": url,
}
meta, exists := plugins.DataSources[ds.Type]
if !exists {
//return nil, errors.New(fmt.Sprintf("Could not find plugin definition for data source: %v", ds.Type))
}
dsMap["meta"] = meta
if ds.IsDefault {
defaultDatasource = ds.Name
}