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
78b9c300
Commit
78b9c300
authored
Mar 10, 2016
by
Torkel Ödegaard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat(plugins): minor progress on dashboard imports
parent
1951f385
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
31 additions
and
12 deletions
+31
-12
public/app/core/routes/routes.ts
+1
-0
public/app/features/dashboard/import_list/import_list.ts
+14
-7
public/app/features/datasources/edit_ctrl.ts
+5
-0
public/app/features/datasources/partials/edit.html
+9
-4
public/app/plugins/datasource/graphite/plugin.json
+2
-1
No files found.
public/app/core/routes/routes.ts
View file @
78b9c300
...
...
@@ -63,6 +63,7 @@ function setupAngularRoutes($routeProvider, $locationProvider) {
.
when
(
'/datasources/new'
,
{
templateUrl
:
'public/app/features/datasources/partials/edit.html'
,
controller
:
'DataSourceEditCtrl'
,
controllerAs
:
'ctrl'
,
resolve
:
loadOrgBundle
,
})
.
when
(
'/org'
,
{
...
...
public/app/features/dashboard/import_list/import_list.ts
View file @
78b9c300
...
...
@@ -31,14 +31,21 @@ export class DashImportListCtrl {
var
template
=
`
<div class="gf-form-group" ng-if="ctrl.dashboards.length">
<h3 class="page-heading">Dashboards</h3>
<div class="gf-form" ng-repeat="dash in ctrl.dashboards">
<label class="gf-form-label">
<table class="filter-table">
<tbody>
<tr ng-repeat="dash in ctrl.dashboards">
<td class="width-1">
<i class="icon-gf icon-gf-dashboard"></i>
</label>
<label class="gf-form-label width-20">{{dash.name}}</label>
<button class="btn btn-inverse gf-form-btn" ng-click="ctrl.import(dash)">Import</button>
</div>
</td>
<td>
{{dash.name}}</span>
</td>
<td class="width-2">
<button class="btn btn-primary btn-small">Install</button>
</td
</tr>
</tbody>
</table>
</div>
`
;
...
...
public/app/features/datasources/edit_ctrl.ts
View file @
78b9c300
...
...
@@ -22,6 +22,8 @@ export class DataSourceEditCtrl {
types
:
any
;
testing
:
any
;
datasourceMeta
:
any
;
tabIndex
:
number
;
hasDashboards
:
boolean
;
/** @ngInject */
constructor
(
...
...
@@ -34,6 +36,7 @@ export class DataSourceEditCtrl {
this
.
isNew
=
true
;
this
.
datasources
=
[];
this
.
tabIndex
=
0
;
this
.
loadDatasourceTypes
().
then
(()
=>
{
if
(
this
.
$routeParams
.
id
)
{
...
...
@@ -66,8 +69,10 @@ export class DataSourceEditCtrl {
}
typeChanged
()
{
this
.
hasDashboards
=
false
;
return
this
.
backendSrv
.
get
(
'/api/org/plugins/'
+
this
.
current
.
type
+
'/settings'
).
then
(
pluginInfo
=>
{
this
.
datasourceMeta
=
pluginInfo
;
this
.
hasDashboards
=
_
.
findWhere
(
pluginInfo
.
includes
,
{
type
:
'dashboard'
});
});
}
...
...
public/app/features/datasources/partials/edit.html
View file @
78b9c300
...
...
@@ -11,12 +11,12 @@
<ul
class=
"gf-tabs"
>
<li
class=
"gf-tabs-item"
>
<a
class=
"gf-tabs-link"
ng-click=
"ctrl.
editor.index = 0"
ng-class=
"{active: ctrl.editor.i
ndex === 0}"
>
<a
class=
"gf-tabs-link"
ng-click=
"ctrl.
tabIndex = 0"
ng-class=
"{active: ctrl.tabI
ndex === 0}"
>
Config
</a>
</li>
<li
class=
"gf-tabs-item"
ng-show=
"ctrl.hasDashboards"
ng-cloak
>
<a
class=
"gf-tabs-link"
ng-click=
"ctrl.
editor.index = 1"
ng-class=
"{active: ctrl.editor.i
ndex === 1}"
>
<a
class=
"gf-tabs-link"
ng-click=
"ctrl.
tabIndex = 1"
ng-class=
"{active: ctrl.tabI
ndex === 1}"
>
Dashboards
</a>
</li>
...
...
@@ -24,6 +24,7 @@
</div>
</div>
<div
ng-if=
"ctrl.tabIndex === 0"
class=
"tab-content"
>
<form
name=
"editForm"
>
<div
class=
"gf-form-group"
>
...
...
@@ -51,8 +52,6 @@
<rebuild-on-change
property=
"ctrl.datasourceMeta.id"
>
<plugin-component
type=
"datasource-config-ctrl"
>
</plugin-component>
<dashboard-import-list
plugin=
"ctrl.datasourceMeta"
></dashboard-import-list>
</rebuild-on-change>
<div
ng-if=
"testing"
style=
"margin-top: 25px"
>
...
...
@@ -74,5 +73,11 @@
</div>
</form>
</div>
<div
ng-if=
"ctrl.tabIndex === 1"
class=
"tab-content"
>
<dashboard-import-list
plugin=
"ctrl.datasourceMeta"
></dashboard-import-list>
</div>
</div>
public/app/plugins/datasource/graphite/plugin.json
View file @
78b9c300
...
...
@@ -4,7 +4,8 @@
"id"
:
"graphite"
,
"includes"
:
[
{
"type"
:
"dashboard"
,
"name"
:
"Carbon Stats"
,
"path"
:
"dashboards/carbon_stats.json"
}
{
"type"
:
"dashboard"
,
"name"
:
"Carbon Overview"
,
"path"
:
"dashboards/carbon_stats.json"
},
{
"type"
:
"dashboard"
,
"name"
:
"Carbon Agent Details"
,
"path"
:
"dashboards/carbon_stats.json"
}
],
"metrics"
:
true
,
...
...
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