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
1abdd170
Commit
1abdd170
authored
Mar 15, 2016
by
Torkel Ödegaard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ux(): fixes to cards and sorting plugin list, #4364
parent
dddd155a
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
21 additions
and
2 deletions
+21
-2
pkg/api/dtos/plugins.go
+14
-0
pkg/api/plugins.go
+5
-2
public/sass/components/_cards.scss
+2
-0
No files found.
pkg/api/dtos/plugins.go
View file @
1abdd170
...
...
@@ -26,6 +26,20 @@ type PluginListItem struct {
Info
*
plugins
.
PluginInfo
`json:"info"`
}
type
PluginList
[]
PluginListItem
func
(
slice
PluginList
)
Len
()
int
{
return
len
(
slice
)
}
func
(
slice
PluginList
)
Less
(
i
,
j
int
)
bool
{
return
slice
[
i
]
.
Name
<
slice
[
j
]
.
Name
}
func
(
slice
PluginList
)
Swap
(
i
,
j
int
)
{
slice
[
i
],
slice
[
j
]
=
slice
[
j
],
slice
[
i
]
}
type
ImportDashboardCommand
struct
{
PluginId
string
`json:"pluginId"`
Path
string
`json:"path"`
...
...
pkg/api/plugins.go
View file @
1abdd170
package
api
import
(
"sort"
"github.com/grafana/grafana/pkg/api/dtos"
"github.com/grafana/grafana/pkg/bus"
"github.com/grafana/grafana/pkg/middleware"
...
...
@@ -19,7 +21,7 @@ func GetPluginList(c *middleware.Context) Response {
return
ApiError
(
500
,
"Failed to get list of plugins"
,
err
)
}
result
:=
make
(
[]
*
dtos
.
PluginListItem
,
0
)
result
:=
make
(
dtos
.
PluginList
,
0
)
for
_
,
pluginDef
:=
range
plugins
.
Plugins
{
// filter out app sub plugins
if
embeddedFilter
==
"0"
&&
pluginDef
.
IncludedInAppId
!=
""
{
...
...
@@ -31,7 +33,7 @@ func GetPluginList(c *middleware.Context) Response {
continue
}
listItem
:=
&
dtos
.
PluginListItem
{
listItem
:=
dtos
.
PluginListItem
{
Id
:
pluginDef
.
Id
,
Name
:
pluginDef
.
Name
,
Type
:
pluginDef
.
Type
,
...
...
@@ -58,6 +60,7 @@ func GetPluginList(c *middleware.Context) Response {
result
=
append
(
result
,
listItem
)
}
sort
.
Sort
(
result
)
return
Json
(
200
,
result
)
}
...
...
public/sass/components/_cards.scss
View file @
1abdd170
...
...
@@ -76,6 +76,8 @@
.card-item-figure
{
margin
:
0
$spacer
$spacer
0
;
height
:
6rem
;
img
{
width
:
6rem
;
}
...
...
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