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
3191678b
Commit
3191678b
authored
Mar 08, 2016
by
Torkel Ödegaard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat(plugins): work on plugins that include dashboards
parent
091726b3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
27 additions
and
11 deletions
+27
-11
public/app/features/dashboard/import_list/import_list.ts
+18
-8
public/app/features/datasources/edit_ctrl.js
+7
-1
public/app/features/datasources/partials/edit.html
+2
-2
No files found.
public/app/features/dashboard/import_list/import_list.ts
View file @
3191678b
...
...
@@ -8,8 +8,13 @@ class DashboardScriptLoader {
}
export
class
DashImportListCtrl
{
dashboards
:
any
[];
plugin
:
any
;
constructor
(
private
$http
)
{
console
.
log
(
'importList'
,
this
);
this
.
dashboards
=
this
.
plugin
.
includes
.
filter
(
val
=>
val
.
type
===
'dashboard'
);
}
load
(
json
)
{
...
...
@@ -18,17 +23,22 @@ export class DashImportListCtrl {
}
import
()
{
var
url
=
'public/app/plugins/datasource/graphite/dashboards/carbon_stats.json'
;
this
.
$http
.
get
(
url
).
then
(
res
=>
{
this
.
load
(
res
.
data
);
});
// this.$http.get(url).then(res => {
// this.load(res.data);
// });
}
}
var
template
=
`
<h3 class="page-heading">Dashboards</h3>
<div class="gf-form-group">
<button class="btn btn-mini btn-inverse" ng-click="ctrl.import(dash)">Import</button>
<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">
<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>
</div>
`
;
...
...
public/app/features/datasources/edit_ctrl.js
View file @
3191678b
...
...
@@ -18,7 +18,13 @@ function (angular, _, config) {
module
.
controller
(
'DataSourceEditCtrl'
,
function
(
$scope
,
$q
,
backendSrv
,
$routeParams
,
$location
,
datasourceSrv
)
{
var
defaults
=
{
name
:
''
,
type
:
'graphite'
,
url
:
''
,
access
:
'proxy'
,
jsonData
:
{}};
var
defaults
=
{
name
:
''
,
type
:
'graphite'
,
url
:
''
,
access
:
'proxy'
,
jsonData
:
{}
};
$scope
.
init
=
function
()
{
$scope
.
isNew
=
true
;
...
...
public/app/features/datasources/partials/edit.html
View file @
3191678b
...
...
@@ -36,6 +36,8 @@ icon="icon-gf icon-gf-datasources">
<rebuild-on-change
property=
"datasourceMeta.id"
>
<plugin-component
type=
"datasource-config-ctrl"
>
</plugin-component>
<dashboard-import-list
plugin=
"datasourceMeta"
></dashboard-import-list>
</rebuild-on-change>
<div
ng-if=
"testing"
style=
"margin-top: 25px"
>
...
...
@@ -47,8 +49,6 @@ icon="icon-gf icon-gf-datasources">
</div>
</div>
<!-- <dashboard-import-list plugin="current"></dashboard-import-list> -->
<div
class=
"gf-form-button-row"
>
<button
type=
"submit"
class=
"btn btn-success"
ng-show=
"isNew"
ng-click=
"saveChanges()"
>
Add
</button>
<button
type=
"submit"
class=
"btn btn-success"
ng-show=
"!isNew"
ng-click=
"saveChanges()"
>
Save
</button>
...
...
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