mirror of
https://github.com/grafana/grafana.git
synced 2025-07-30 02:12:29 +08:00
feat(apps): began work on support for apps that contain data sources
This commit is contained in:
@ -77,6 +77,19 @@ func (app *AppPlugin) Load(decoder *json.Decoder, pluginDir string) error {
|
||||
}
|
||||
}
|
||||
|
||||
// check if we have child datasources
|
||||
for _, ds := range DataSources {
|
||||
if strings.HasPrefix(ds.PluginDir, app.PluginDir) {
|
||||
ds.IncludedInAppId = app.Id
|
||||
app.Includes = append(app.Includes, &AppIncludeInfo{
|
||||
Name: ds.Name,
|
||||
Id: ds.Id,
|
||||
Type: ds.Type,
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
// slugify pages
|
||||
for _, page := range app.Pages {
|
||||
if page.Slug == "" {
|
||||
page.Slug = slug.Make(page.Name)
|
||||
|
Reference in New Issue
Block a user