Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
N
nexpie-grafana-theme
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Registry
Registry
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Kornkitt Poolsup
nexpie-grafana-theme
Commits
21e47d76
Unverified
Commit
21e47d76
authored
Nov 15, 2018
by
Marcus Efraimsson
Committed by
GitHub
Nov 15, 2018
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #14081 from grafana/filter-alpha-plugins
filter out alpha plugins in plugins api
parents
b47a4954
480da342
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
19 additions
and
8 deletions
+19
-8
pkg/api/api.go
+1
-1
pkg/api/dtos/plugins.go
+4
-4
pkg/api/frontendsettings.go
+1
-1
pkg/api/plugins.go
+5
-1
pkg/plugins/models.go
+8
-1
No files found.
pkg/api/api.go
View file @
21e47d76
...
...
@@ -242,7 +242,7 @@ func (hs *HTTPServer) registerRoutes() {
apiRoute
.
Get
(
"/datasources/id/:name"
,
Wrap
(
GetDataSourceIdByName
),
reqSignedIn
)
apiRoute
.
Get
(
"/plugins"
,
Wrap
(
GetPluginList
))
apiRoute
.
Get
(
"/plugins"
,
Wrap
(
hs
.
GetPluginList
))
apiRoute
.
Get
(
"/plugins/:pluginId/settings"
,
Wrap
(
GetPluginSettingByID
))
apiRoute
.
Get
(
"/plugins/:pluginId/markdown/:name"
,
Wrap
(
GetPluginMarkdown
))
...
...
pkg/api/dtos/plugins.go
View file @
21e47d76
...
...
@@ -19,9 +19,9 @@ type PluginSetting struct {
JsonData
map
[
string
]
interface
{}
`json:"jsonData"`
DefaultNavUrl
string
`json:"defaultNavUrl"`
LatestVersion
string
`json:"latestVersion"`
HasUpdate
bool
`json:"hasUpdate"`
State
string
`json:"state"`
LatestVersion
string
`json:"latestVersion"`
HasUpdate
bool
`json:"hasUpdate"`
State
plugins
.
PluginState
`json:"state"`
}
type
PluginListItem
struct
{
...
...
@@ -34,7 +34,7 @@ type PluginListItem struct {
LatestVersion
string
`json:"latestVersion"`
HasUpdate
bool
`json:"hasUpdate"`
DefaultNavUrl
string
`json:"defaultNavUrl"`
State
string
`json:"state"`
State
plugins
.
PluginState
`json:"state"`
}
type
PluginList
[]
PluginListItem
...
...
pkg/api/frontendsettings.go
View file @
21e47d76
...
...
@@ -133,7 +133,7 @@ func (hs *HTTPServer) getFrontendSettingsMap(c *m.ReqContext) (map[string]interf
panels
:=
map
[
string
]
interface
{}{}
for
_
,
panel
:=
range
enabledPlugins
.
Panels
{
if
panel
.
State
==
"alpha"
&&
!
hs
.
Cfg
.
EnableAlphaPanels
{
if
panel
.
State
==
plugins
.
PluginStateAlpha
&&
!
hs
.
Cfg
.
EnableAlphaPanels
{
continue
}
...
...
pkg/api/plugins.go
View file @
21e47d76
...
...
@@ -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
,
...
...
pkg/plugins/models.go
View file @
21e47d76
...
...
@@ -17,6 +17,13 @@ var (
PluginTypeDashboard
=
"dashboard"
)
type
PluginState
string
var
(
PluginStateAlpha
PluginState
=
"alpha"
PluginStateBeta
PluginState
=
"beta"
)
type
PluginNotFoundError
struct
{
PluginId
string
}
...
...
@@ -39,7 +46,7 @@ type PluginBase struct {
Module
string
`json:"module"`
BaseUrl
string
`json:"baseUrl"`
HideFromList
bool
`json:"hideFromList,omitempty"`
State
string
`json:"state,omitempty"`
State
PluginState
`json:"state,omitempty"`
IncludedInAppId
string
`json:"-"`
PluginDir
string
`json:"-"`
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment