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
f4a01394
Commit
f4a01394
authored
May 03, 2016
by
Torkel Ödegaard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat(pluginlist): link in plugin list now goes to app/plugin default nav unless enabled
parent
5ffd5769
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
8 additions
and
3 deletions
+8
-3
pkg/api/dtos/plugins.go
+1
-0
pkg/api/plugins.go
+6
-0
pkg/plugins/app_plugin.go
+0
-2
public/app/plugins/panel/pluginlist/module.html
+1
-1
No files found.
pkg/api/dtos/plugins.go
View file @
f4a01394
...
@@ -29,6 +29,7 @@ type PluginListItem struct {
...
@@ -29,6 +29,7 @@ type PluginListItem struct {
Info
*
plugins
.
PluginInfo
`json:"info"`
Info
*
plugins
.
PluginInfo
`json:"info"`
LatestVersion
string
`json:"latestVersion"`
LatestVersion
string
`json:"latestVersion"`
HasUpdate
bool
`json:"hasUpdate"`
HasUpdate
bool
`json:"hasUpdate"`
DefaultNavUrl
string
`json:"defaultNavUrl"`
}
}
type
PluginList
[]
PluginListItem
type
PluginList
[]
PluginListItem
...
...
pkg/api/plugins.go
View file @
f4a01394
...
@@ -8,6 +8,7 @@ import (
...
@@ -8,6 +8,7 @@ import (
"github.com/grafana/grafana/pkg/middleware"
"github.com/grafana/grafana/pkg/middleware"
m
"github.com/grafana/grafana/pkg/models"
m
"github.com/grafana/grafana/pkg/models"
"github.com/grafana/grafana/pkg/plugins"
"github.com/grafana/grafana/pkg/plugins"
"github.com/grafana/grafana/pkg/setting"
)
)
func
GetPluginList
(
c
*
middleware
.
Context
)
Response
{
func
GetPluginList
(
c
*
middleware
.
Context
)
Response
{
...
@@ -46,6 +47,7 @@ func GetPluginList(c *middleware.Context) Response {
...
@@ -46,6 +47,7 @@ func GetPluginList(c *middleware.Context) Response {
Info
:
&
pluginDef
.
Info
,
Info
:
&
pluginDef
.
Info
,
LatestVersion
:
pluginDef
.
GrafanaNetVersion
,
LatestVersion
:
pluginDef
.
GrafanaNetVersion
,
HasUpdate
:
pluginDef
.
GrafanaNetHasUpdate
,
HasUpdate
:
pluginDef
.
GrafanaNetHasUpdate
,
DefaultNavUrl
:
pluginDef
.
DefaultNavUrl
,
}
}
if
pluginSetting
,
exists
:=
pluginSettingsMap
[
pluginDef
.
Id
];
exists
{
if
pluginSetting
,
exists
:=
pluginSettingsMap
[
pluginDef
.
Id
];
exists
{
...
@@ -53,6 +55,10 @@ func GetPluginList(c *middleware.Context) Response {
...
@@ -53,6 +55,10 @@ func GetPluginList(c *middleware.Context) Response {
listItem
.
Pinned
=
pluginSetting
.
Pinned
listItem
.
Pinned
=
pluginSetting
.
Pinned
}
}
if
listItem
.
DefaultNavUrl
==
""
||
!
listItem
.
Enabled
{
listItem
.
DefaultNavUrl
=
setting
.
AppSubUrl
+
"/plugins/"
+
listItem
.
Id
+
"/edit"
}
// filter out disabled
// filter out disabled
if
enabledFilter
==
"1"
&&
!
listItem
.
Enabled
{
if
enabledFilter
==
"1"
&&
!
listItem
.
Enabled
{
continue
continue
...
...
pkg/plugins/app_plugin.go
View file @
f4a01394
...
@@ -76,8 +76,6 @@ func (app *AppPlugin) initApp() {
...
@@ -76,8 +76,6 @@ func (app *AppPlugin) initApp() {
}
}
}
}
app
.
DefaultNavUrl
=
setting
.
AppSubUrl
+
"/plugins/"
+
app
.
Id
+
"/edit"
// slugify pages
// slugify pages
for
_
,
include
:=
range
app
.
Includes
{
for
_
,
include
:=
range
app
.
Includes
{
if
include
.
Slug
==
""
{
if
include
.
Slug
==
""
{
...
...
public/app/plugins/panel/pluginlist/module.html
View file @
f4a01394
...
@@ -4,7 +4,7 @@
...
@@ -4,7 +4,7 @@
{{category.header}}
{{category.header}}
</h6>
</h6>
<div
class=
"pluginlist-item"
ng-repeat=
"plugin in category.list"
>
<div
class=
"pluginlist-item"
ng-repeat=
"plugin in category.list"
>
<a
class=
"pluginlist-link pluginlist-link-{{plugin.state}} pointer"
href=
"
plugins/{{plugin.id}}/edit
"
>
<a
class=
"pluginlist-link pluginlist-link-{{plugin.state}} pointer"
href=
"
{{plugin.defaultNavUrl}}
"
>
<span>
<span>
<img
ng-src=
"{{plugin.info.logos.small}}"
class=
"pluginlist-image"
>
<img
ng-src=
"{{plugin.info.logos.small}}"
class=
"pluginlist-image"
>
<span
class=
"pluginlist-title"
>
{{plugin.name}}
</span>
<span
class=
"pluginlist-title"
>
{{plugin.name}}
</span>
...
...
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