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
c521182c
Commit
c521182c
authored
Feb 25, 2016
by
Torkel Ödegaard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat(plugins): more work on plugins list/edit view
parent
8db7cf49
Show whitespace changes
Inline
Side-by-side
Showing
14 changed files
with
167 additions
and
149 deletions
+167
-149
pkg/api/dtos/plugins.go
+2
-26
pkg/api/index.go
+1
-1
pkg/api/plugin_setting.go
+22
-3
public/app/features/admin/partials/edit_org.html
+4
-1
public/app/features/admin/partials/edit_user.html
+4
-1
public/app/features/admin/partials/new_user.html
+4
-1
public/app/features/admin/partials/orgs.html
+4
-1
public/app/features/admin/partials/users.html
+4
-1
public/app/features/datasources/partials/list.html
+2
-2
public/app/features/plugins/partials/edit.html
+89
-85
public/sass/_grafana.scss
+1
-1
public/sass/layout/_page.scss
+4
-0
public/sass/pages/_apps.scss
+0
-26
public/sass/pages/_plugins.scss
+26
-0
No files found.
pkg/api/dtos/plugins.go
View file @
c521182c
package
dtos
import
(
"github.com/grafana/grafana/pkg/models"
"github.com/grafana/grafana/pkg/plugins"
)
import
"github.com/grafana/grafana/pkg/plugins"
type
PluginSetting
struct
{
Name
string
`json:"name"`
AppId
string
`json:"app
Id"`
PluginId
string
`json:"plugin
Id"`
Enabled
bool
`json:"enabled"`
Pinned
bool
`json:"pinned"`
Module
string
`json:"module"`
...
...
@@ -26,24 +23,3 @@ type PluginListItem struct {
Pinned
bool
`json:"pinned"`
Info
*
plugins
.
PluginInfo
`json:"info"`
}
func
NewPluginSettingDto
(
def
*
plugins
.
AppPlugin
,
data
*
models
.
PluginSetting
)
*
PluginSetting
{
dto
:=
&
PluginSetting
{
AppId
:
def
.
Id
,
Name
:
def
.
Name
,
Info
:
&
def
.
Info
,
Module
:
def
.
Module
,
BaseUrl
:
def
.
BaseUrl
,
Pages
:
def
.
Pages
,
Includes
:
def
.
Includes
,
}
if
data
!=
nil
{
dto
.
Enabled
=
data
.
Enabled
dto
.
Pinned
=
data
.
Pinned
dto
.
Info
=
&
def
.
Info
dto
.
JsonData
=
data
.
JsonData
}
return
dto
}
pkg/api/index.go
View file @
c521182c
...
...
@@ -72,7 +72,7 @@ func setIndexViewData(c *middleware.Context) (*dtos.IndexViewData, error) {
data
.
MainNavLinks
=
append
(
data
.
MainNavLinks
,
&
dtos
.
NavLink
{
Text
:
"Plugins"
,
Icon
:
"icon-gf icon-gf-apps"
,
Url
:
setting
.
AppSubUrl
+
"/
app
s"
,
Url
:
setting
.
AppSubUrl
+
"/
plugin
s"
,
})
}
...
...
pkg/api/plugin_setting.go
View file @
c521182c
...
...
@@ -38,15 +38,34 @@ func GetPluginList(c *middleware.Context) Response {
func
GetPluginSettingById
(
c
*
middleware
.
Context
)
Response
{
pluginId
:=
c
.
Params
(
":pluginId"
)
if
pluginDef
,
exists
:=
plugins
.
App
s
[
pluginId
];
!
exists
{
return
ApiError
(
404
,
"Plugin
Id
not found, no installed plugin with that id"
,
nil
)
if
def
,
exists
:=
plugins
.
Plugin
s
[
pluginId
];
!
exists
{
return
ApiError
(
404
,
"Plugin not found, no installed plugin with that id"
,
nil
)
}
else
{
dto
:=
&
dtos
.
PluginSetting
{
PluginId
:
def
.
Id
,
Name
:
def
.
Name
,
Info
:
&
def
.
Info
,
}
if
app
,
exists
:=
plugins
.
Apps
[
pluginId
];
exists
{
dto
.
Pages
=
app
.
Pages
dto
.
Includes
=
app
.
Includes
dto
.
BaseUrl
=
app
.
BaseUrl
dto
.
Module
=
app
.
Module
}
query
:=
m
.
GetPluginSettingByIdQuery
{
PluginId
:
pluginId
,
OrgId
:
c
.
OrgId
}
if
err
:=
bus
.
Dispatch
(
&
query
);
err
!=
nil
{
if
err
!=
m
.
ErrPluginSettingNotFound
{
return
ApiError
(
500
,
"Failed to get login settings"
,
nil
)
}
}
else
{
dto
.
Enabled
=
query
.
Result
.
Enabled
dto
.
Pinned
=
query
.
Result
.
Pinned
dto
.
JsonData
=
query
.
Result
.
JsonData
}
return
Json
(
200
,
dto
s
.
NewPluginSettingDto
(
pluginDef
,
query
.
Result
)
)
return
Json
(
200
,
dto
)
}
}
...
...
public/app/features/admin/partials/edit_org.html
View file @
c521182c
<navbar
icon=
"fa fa-fw fa-cogs"
title=
"Admin"
title-url=
"admin"
>
<nav-button
title=
"Orgs"
title-url=
"admin/orgs"
icon=
"icon-gf icon-gf-users"
></nav-button>
<a
href=
"admin/orgs"
class=
"navbar-page-btn"
>
<i
class=
"icon-gf icon-gf-users"
></i>
Orgs
</a>
</navbar>
<div
class=
"page-container"
>
...
...
public/app/features/admin/partials/edit_user.html
View file @
c521182c
<navbar
icon=
"fa fa-fw fa-cogs"
title=
"Admin"
title-url=
"admin"
>
<nav-button
title=
"Users"
title-url=
"admin/users"
icon=
"icon-gf icon-gf-users"
></nav-button>
<a
href=
"admin/users"
class=
"navbar-page-btn"
>
<i
class=
"icon-gf icon-gf-users"
></i>
Users
</a>
</navbar>
<div
class=
"page-container"
>
...
...
public/app/features/admin/partials/new_user.html
View file @
c521182c
<navbar
icon=
"fa fa-fw fa-cogs"
title=
"Admin"
title-url=
"admin"
>
<nav-button
title=
"Users"
title-url=
"admin/users"
icon=
"icon-gf icon-gf-users"
></nav-button>
<a
href=
"admin/users"
class=
"navbar-page-btn"
>
<i
class=
"icon-gf icon-gf-users"
></i>
Users
</a>
</navbar>
<div
class=
"page-container"
>
...
...
public/app/features/admin/partials/orgs.html
View file @
c521182c
<navbar
icon=
"fa fa-fw fa-cogs"
title=
"Admin"
title-url=
"admin"
>
<nav-button
title=
"Orgs"
title-url=
"admin/orgs"
icon=
"icon-gf icon-gf-users"
></nav-button>
<a
href=
"admin/orgs"
class=
"navbar-page-btn"
>
<i
class=
"icon-gf icon-gf-users"
></i>
Orgs
</a>
</navbar>
<div
class=
"page-container"
>
...
...
public/app/features/admin/partials/users.html
View file @
c521182c
<navbar
icon=
"fa fa-fw fa-cogs"
title=
"Admin"
title-url=
"admin"
>
<nav-button
title=
"Users"
title-url=
"admin/users"
icon=
"icon-gf icon-gf-users"
></nav-button>
<a
href=
"admin/users"
class=
"navbar-page-btn"
>
<i
class=
"icon-gf icon-gf-users"
></i>
Users
</a>
</navbar>
<div
class=
"page-container"
>
...
...
public/app/features/datasources/partials/list.html
View file @
c521182c
...
...
@@ -22,8 +22,8 @@
<table
class=
"filter-table"
ng-if=
"ctrl.datasources.length > 0"
>
<thead>
<tr>
<th><strong>
N
ame
</strong></th>
<th><strong>
U
rl
</strong></th>
<th><strong>
n
ame
</strong></th>
<th><strong>
u
rl
</strong></th>
<th
style=
"width: 60px;"
></th>
<th
style=
"width: 85px;"
></th>
<th
style=
"width: 44px;"
></th>
...
...
public/app/features/plugins/partials/edit.html
View file @
c521182c
<navbar
title=
"Plugins"
title-url=
"Plugins"
icon=
"icon-gf icon-gf-apps"
>
<navbar
title=
"Plugins"
title-url=
"plugins"
icon=
"icon-gf icon-gf-apps"
>
<a
href=
"plugins/apps"
class=
"navbar-page-btn"
>
<i
class=
"fa fa-cubes"
></i>
Apps
</a>
</navbar>
<div
class=
"page-container"
>
<div
class=
"flex-container"
>
<div
class=
"flex-column app-edit-logo-box"
>
<img
src=
"{{ctrl.appModel.info.logos.large}}"
>
</div>
<div
class=
"flex-column"
>
<div
class=
"page-header"
>
<img
class=
"page-header-logo"
src=
"{{ctrl.model.info.logos.large}}"
>
<h1>
{{ctrl.appM
odel.name}}
{{ctrl.m
odel.name}}
</h1>
</div>
<div
class=
"flex-container"
>
<div
class=
"app-edit-description"
>
{{ctrl.appM
odel.info.description}}
<br>
{{ctrl.m
odel.info.description}}
<br>
<span
style=
"small"
>
Version: {{ctrl.appModel.info.version}}
Updated: {{ctrl.appM
odel.info.updated}}
Version: {{ctrl.model.info.version}}
Updated: {{ctrl.m
odel.info.updated}}
</span>
</div>
<div
class=
"form-inline"
>
<editor-checkbox
text=
"Enabled"
model=
"ctrl.appM
odel.enabled"
change=
"ctrl.toggleEnabled()"
></editor-checkbox>
<editor-checkbox
text=
"Enabled"
model=
"ctrl.m
odel.enabled"
change=
"ctrl.toggleEnabled()"
></editor-checkbox>
<editor-checkbox
text=
"Pinned"
model=
"ctrl.appM
odel.pinned"
change=
"ctrl.togglePinned()"
></editor-checkbox>
<editor-checkbox
text=
"Pinned"
model=
"ctrl.m
odel.pinned"
change=
"ctrl.togglePinned()"
></editor-checkbox>
</div>
</div>
<div
class=
"flex-column"
>
<ul
class=
"app-edit-links"
>
<li>
By
<a
href=
"{{ctrl.appModel.info.author.url}}"
class=
"external-link"
target=
"_blank"
>
{{ctrl.appM
odel.info.author.name}}
</a>
By
<a
href=
"{{ctrl.model.info.author.url}}"
class=
"external-link"
target=
"_blank"
>
{{ctrl.m
odel.info.author.name}}
</a>
</li>
<li
ng-repeat=
"link in ctrl.appM
odel.info.links"
>
<li
ng-repeat=
"link in ctrl.m
odel.info.links"
>
<a
href=
"{{link.url}}"
class=
"external-link"
target=
"_blank"
>
{{link.name}}
</a>
</li>
</ul>
</div>
</div>
<section
class=
"simple-box"
>
<h3
class=
"simple-box-header"
>
Included with app:
</h3>
<div
class=
"flex-container"
>
<div
class=
"simple-box-body simple-box-column"
>
<div
class=
"simple-box-column-header"
>
<i
class=
"fa fa-th-large"
></i>
Dashboards
</div>
<ul>
<li><em
class=
"small"
>
None
</em></li>
</ul>
</div>
<div
class=
"simple-box-body simple-box-column"
>
<div
class=
"simple-box-column-header"
>
<i
class=
"fa fa-line-chart"
></i>
Panels
</div>
<ul>
<li
ng-show=
"!ctrl.includedPanels.length"
><em
class=
"small"
>
None
</em></li>
<li
ng-repeat=
"panel in ctrl.includedPanels"
>
{{panel.name}}
</li>
</ul>
</div>
<div
class=
"simple-box-body simple-box-column"
>
<div
class=
"simple-box-column-header"
>
<i
class=
"fa fa-database"
></i>
Datasources
</div>
<ul>
<li
ng-show=
"!ctrl.includedDatasources.length"
><em
class=
"small"
>
None
</em></li>
<li
ng-repeat=
"ds in ctrl.includedDatasources"
>
{{ds.name}}
</li>
</ul>
</div>
<div
class=
"simple-box-body simple-box-column"
>
<div
class=
"simple-box-column-header"
>
<i
class=
"fa fa-files-o"
></i>
Pages
</div>
<ul>
<li
ng-repeat=
"page in ctrl.appModel.pages"
>
<a
href=
"apps/{{ctrl.appId}}/page/{{page.slug}}"
class=
"external-link"
>
{{page.name}}
</a>
</li>
</ul>
</div>
</div>
</section>
<section
class=
"simple-box"
>
<h3
class=
"simple-box-header"
>
Dependencies:
</h3>
<div
class=
"simple-box-body"
>
Grafana 2.6.x
</div>
</section>
<section
class=
"simple-box"
>
<h3
class=
"simple-box-header"
>
Configuration:
</h3>
<div
class=
"simple-box-body"
>
<div
ng-if=
"ctrl.appModel.appId"
>
<plugin-component
type=
"app-config-ctrl"
></plugin-component>
<div
class=
"clearfix"
></div>
<button
type=
"submit"
class=
"btn btn-success"
ng-click=
"ctrl.update()"
>
Save
</button>
</div>
</div>
</section>
</div>
<!-- <section class="simple-box"> -->
<!-- <h3 class="simple-box-header">Included with app:</h3> -->
<!-- <div class="flex-container"> -->
<!-- <div class="simple-box-body simple-box-column"> -->
<!-- <div class="simple-box-column-header"> -->
<!-- <i class="fa fa-th-large"></i> -->
<!-- Dashboards -->
<!-- </div> -->
<!-- <ul> -->
<!-- <li><em class="small">None</em></li> -->
<!-- </ul> -->
<!-- </div> -->
<!-- <div class="simple-box-body simple-box-column"> -->
<!-- <div class="simple-box-column-header"> -->
<!-- <i class="fa fa-line-chart"></i> -->
<!-- Panels -->
<!-- </div> -->
<!-- <ul> -->
<!-- <li ng-show="!ctrl.includedPanels.length"><em class="small">None</em></li> -->
<!-- <li ng-repeat="panel in ctrl.includedPanels"> -->
<!-- {{panel.name}} -->
<!-- </li> -->
<!-- </ul> -->
<!-- </div> -->
<!-- <div class="simple-box-body simple-box-column"> -->
<!-- <div class="simple-box-column-header"> -->
<!-- <i class="fa fa-database"></i> -->
<!-- Datasources -->
<!-- </div> -->
<!-- <ul> -->
<!-- <li ng-show="!ctrl.includedDatasources.length"><em class="small">None</em></li> -->
<!-- <li ng-repeat="ds in ctrl.includedDatasources"> -->
<!-- {{ds.name}} -->
<!-- </li> -->
<!-- </ul> -->
<!-- </div> -->
<!-- <div class="simple-box-body simple-box-column"> -->
<!-- <div class="simple-box-column-header"> -->
<!-- <i class="fa fa-files-o"></i> -->
<!-- Pages -->
<!-- </div> -->
<!-- <ul> -->
<!-- <li ng-repeat="page in ctrl.model.pages"> -->
<!-- <a href="apps/{{ctrl.appId}}/page/{{page.slug}}" class="external-link">{{page.name}}</a> -->
<!-- </li> -->
<!-- </ul> -->
<!-- </div> -->
<!-- -->
<!-- </div> -->
<!-- </section> -->
<!-- -->
<!-- <section class="simple-box"> -->
<!-- <h3 class="simple-box-header">Dependencies:</h3> -->
<!-- <div class="simple-box-body"> -->
<!-- Grafana 2.6.x -->
<!-- </div> -->
<!-- </section> -->
<!-- -->
<!-- <section class="simple-box"> -->
<!-- <h3 class="simple-box-header">Configuration:</h3> -->
<!-- <div class="simple-box-body"> -->
<!-- <div ng-if="ctrl.model.appId"> -->
<!-- <plugin-component type="app-config-ctrl"></plugin-component> -->
<!-- <div class="clearfix"></div> -->
<!-- <button type="submit" class="btn btn-success" ng-click="ctrl.update()">Save</button> -->
<!-- </div> -->
<!-- </div> -->
<!-- </section> -->
<!-- -->
<!-- -->
<!-- </div> -->
public/sass/_grafana.scss
View file @
c521182c
...
...
@@ -72,7 +72,7 @@
@import
"pages/playlist"
;
@import
"pages/admin"
;
@import
"pages/alerting"
;
@import
"pages/
app
s"
;
@import
"pages/
plugin
s"
;
@import
"pages/signup"
;
@import
"pages/styleguide"
;
...
...
public/sass/layout/_page.scss
View file @
c521182c
...
...
@@ -27,6 +27,10 @@
background-image
:
linear-gradient
(
60deg
,
transparent
70%
,
darken
(
$page-bg
,
4%
)
98%
)
}
.page-header-logo
{
max-width
:
7rem
;
}
.page-header
{
padding
:
$spacer
0
$spacer
/
2
0
;
display
:
flex
;
...
...
public/sass/pages/_apps.scss
deleted
100644 → 0
View file @
8db7cf49
.app-edit-logo-box
{
padding
:
1
.2rem
;
background
:
$panel-bg
;
text-align
:
center
;
img
{
max-width
:
7rem
;
}
margin-right
:
2rem
;
}
.app-edit-links
{
list-style
:
none
;
margin
:
0
0
0
2rem
;
li
{
background
:
$panel-bg
;
margin-top
:
4px
;
padding
:
0
.2rem
1rem
;
}
}
.app-edit-description
{
font-style
:
italic
;
margin-bottom
:
1
.5rem
;
}
public/sass/pages/_plugins.scss
0 → 100644
View file @
c521182c
// .app-edit-logo-box {
// padding: 1.2rem;
// background: $panel-bg;
// text-align: center;
// img {
// max-width: 7rem;
// }
// margin-right: 2rem;
// }
//
// .app-edit-links {
// list-style: none;
// margin: 0 0 0 2rem;
//
// li {
// background: $panel-bg;
// margin-top: 4px;
// padding: 0.2rem 1rem;
// }
// }
//
// .app-edit-description {
// font-style: italic;
// margin-bottom: 1.5rem;
// }
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