filter out alpha plugins in api call, fixes #14030

This commit is contained in:
Torkel Ödegaard
2018-11-15 11:10:47 +01:00
parent b47a4954c9
commit 480da34279
5 changed files with 19 additions and 8 deletions

View File

@ -10,7 +10,7 @@ import (
"github.com/grafana/grafana/pkg/setting"
)
func GetPluginList(c *m.ReqContext) Response {
func (hs *HTTPServer) GetPluginList(c *m.ReqContext) Response {
typeFilter := c.Query("type")
enabledFilter := c.Query("enabled")
embeddedFilter := c.Query("embedded")
@ -39,6 +39,10 @@ func GetPluginList(c *m.ReqContext) Response {
continue
}
if pluginDef.State == plugins.PluginStateAlpha && !hs.Cfg.EnableAlphaPanels {
continue
}
listItem := dtos.PluginListItem{
Id: pluginDef.Id,
Name: pluginDef.Name,