mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
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:
@@ -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"`
|
||||
|
||||
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user