mirror of
https://github.com/grafana/grafana.git
synced 2025-08-01 02:11:50 +08:00
add pluginBundle backend api methods and SQL storage
This commit is contained in:
@ -172,13 +172,18 @@ func (scanner *PluginScanner) loadPluginJson(pluginJsonFilePath string) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
func GetEnabledPlugins(bundles map[string]models.PluginBundle) EnabledPlugins {
|
||||
func GetEnabledPlugins(orgBundles []*models.PluginBundle) EnabledPlugins {
|
||||
enabledPlugins := NewEnabledPlugins()
|
||||
|
||||
orgBundlesMap := make(map[string]*models.PluginBundle)
|
||||
for _, orgBundle := range orgBundles {
|
||||
orgBundlesMap[orgBundle.Type] = orgBundle
|
||||
}
|
||||
|
||||
for bundleType, bundle := range Bundles {
|
||||
enabled := bundle.Enabled
|
||||
// check if the bundle is stored in the DB.
|
||||
if b, ok := bundles[bundleType]; ok {
|
||||
if b, ok := orgBundlesMap[bundleType]; ok {
|
||||
enabled = b.Enabled
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user