feat(apps): lots of more work on apps, changed app_plugin to app_settings in order to to confuse the app plugin model (definition) and app org settings

This commit is contained in:
Torkel Ödegaard
2016-01-10 21:37:11 +01:00
parent ab79348af5
commit c1e94e61d0
23 changed files with 272 additions and 220 deletions

View File

@ -118,18 +118,17 @@ func UpdateDataSource(c *middleware.Context, cmd m.UpdateDataSourceCommand) {
func GetDataSourcePlugins(c *middleware.Context) {
dsList := make(map[string]*plugins.DataSourcePlugin)
orgApps := m.GetAppPluginsQuery{OrgId: c.OrgId}
err := bus.Dispatch(&orgApps)
if err != nil {
if enabledPlugins, err := plugins.GetEnabledPlugins(c.OrgId); err != nil {
c.JsonApiErr(500, "Failed to get org apps", err)
}
enabledPlugins := plugins.GetEnabledPlugins(orgApps.Result)
return
} else {
for key, value := range enabledPlugins.DataSources {
if !value.BuiltIn {
dsList[key] = value
for key, value := range enabledPlugins.DataSources {
if !value.BuiltIn {
dsList[key] = value
}
}
}
c.JSON(200, dsList)
c.JSON(200, dsList)
}
}