add pluginBundle backend api methods and SQL storage
This commit is contained in:
1 parent
bd4cb549d6
commit
c4a0fe0234
13 files changed
+219
-23
No files matched your search
@@ -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