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
87fc8367
Commit
87fc8367
authored
Feb 11, 2016
by
Torkel Ödegaard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat(imports): work on datasource dashboards
parent
ac5f7ecd
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
74 additions
and
2 deletions
+74
-2
public/app/features/dashboard/all.js
+1
-0
public/app/features/dashboard/import_list/import_list.ts
+50
-0
public/app/features/datasources/edit_ctrl.js
+0
-2
public/app/features/datasources/partials/edit.html
+2
-0
public/app/plugins/datasource/graphite/dashboards/carbon_stats.json
+21
-0
No files found.
public/app/features/dashboard/all.js
View file @
87fc8367
...
...
@@ -13,6 +13,7 @@ define([
'./timeSrv'
,
'./unsavedChangesSrv'
,
'./timepicker/timepicker'
,
'./import_list/import_list'
,
'./graphiteImportCtrl'
,
'./dynamicDashboardSrv'
,
'./importCtrl'
,
...
...
public/app/features/dashboard/import_list/import_list.ts
0 → 100644
View file @
87fc8367
///<reference path="../../../headers/common.d.ts" />
import
angular
from
'angular'
;
import
coreModule
from
'app/core/core_module'
;
class
DashboardScriptLoader
{
}
export
class
DashImportListCtrl
{
constructor
(
private
$http
)
{
console
.
log
(
'importList'
,
this
);
}
load
(
json
)
{
var
model
=
angular
.
fromJson
(
json
);
console
.
log
(
model
);
}
import
()
{
var
url
=
'public/app/plugins/datasource/graphite/dashboards/carbon_stats.json'
;
this
.
$http
.
get
(
url
).
then
(
res
=>
{
this
.
load
(
res
.
data
);
});
}
}
var
template
=
`
<button class="btn btn-mini btn-inverse" ng-click="ctrl.import(dash)">Import</span>
`
;
export
function
dashboardImportList
()
{
return
{
restrict
:
'E'
,
template
:
template
,
controller
:
DashImportListCtrl
,
bindToController
:
true
,
controllerAs
:
'ctrl'
,
scope
:
{
plugin
:
"="
}
};
}
coreModule
.
directive
(
'dashboardImportList'
,
dashboardImportList
);
public/app/features/datasources/edit_ctrl.js
View file @
87fc8367
...
...
@@ -105,8 +105,6 @@ function (angular, _, config) {
$scope
.
updateFrontendSettings
().
then
(
function
()
{
if
(
test
)
{
$scope
.
testDatasource
();
}
else
{
$location
.
path
(
'datasources'
);
}
});
});
...
...
public/app/features/datasources/partials/edit.html
View file @
87fc8367
...
...
@@ -55,6 +55,8 @@
</div>
</div>
<dashboard-import-list
plugin=
"current"
></dashboard-import-list>
<div
class=
"pull-right"
style=
"margin-top: 35px"
>
<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>
...
...
public/app/plugins/datasource/graphite/dashboards/carbon_stats.json
0 → 100644
View file @
87fc8367
{
"__inputs"
:
{
"graphite"
:
{
"type"
:
"datasource"
,
"description"
:
"Graphite datasource"
}
},
"title"
:
"Carbon stats"
,
"version"
:
1
,
"rows"
:
[
{
"panels"
:
[
{
"type"
:
"graph"
,
"datasource"
:
"__$graphite"
}
]
}
]
}
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