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
b5726a8d
Commit
b5726a8d
authored
Jan 14, 2016
by
Torkel Ödegaard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat(plugins): completed upgrade of all built in panels
parent
1d9ad9be
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
69 additions
and
22 deletions
+69
-22
public/app/features/panel/query_editor.ts
+4
-0
public/app/partials/dashboard.html
+0
-2
public/app/plugins/panel/singlestat/controller.js
+0
-1
public/app/plugins/panel/table/controller.ts
+1
-1
public/app/plugins/panel/table/editor.ts
+1
-1
public/app/plugins/panel/table/module.ts
+4
-3
public/app/plugins/panel/text/module.js
+13
-12
public/app/plugins/plugin_api.md
+46
-2
No files found.
public/app/features/panel/query_editor.ts
View file @
b5726a8d
...
...
@@ -11,6 +11,10 @@ function metricsQueryEditor(dynamicDirectiveSrv, datasourceSrv) {
return
datasourceSrv
.
get
(
datasource
).
then
(
ds
=>
{
scope
.
datasource
=
ds
;
if
(
!
scope
.
target
.
refId
)
{
scope
.
target
.
refId
=
'A'
;
}
return
System
.
import
(
ds
.
meta
.
module
).
then
(
dsModule
=>
{
return
{
name
:
'metrics-query-editor-'
+
ds
.
meta
.
id
,
...
...
public/app/partials/dashboard.html
View file @
b5726a8d
...
...
@@ -10,8 +10,6 @@
<div
ng-if=
"submenuEnabled"
ng-include=
"'app/partials/submenu.html'"
>
</div>
<asd-test></asd-test>
<div
class=
"clearfix"
></div>
<div
class=
"main-view-container"
>
...
...
public/app/plugins/panel/singlestat/controller.js
View file @
b5726a8d
...
...
@@ -11,7 +11,6 @@ function (angular, app, _, kbn, TimeSeries, PanelMeta) {
/** @ngInject */
function
SingleStatCtrl
(
$scope
,
panelSrv
,
panelHelper
)
{
console
.
log
(
'controller'
);
$scope
.
panelMeta
=
new
PanelMeta
({
panelName
:
'Singlestat'
,
...
...
public/app/plugins/panel/table/controller.ts
View file @
b5726a8d
...
...
@@ -20,7 +20,7 @@ export class TablePanelCtrl {
metricsEditor
:
true
,
});
$scope
.
panelMeta
.
addEditorTab
(
'Options'
,
'app/plugins/panel
s
/table/options.html'
);
$scope
.
panelMeta
.
addEditorTab
(
'Options'
,
'app/plugins/panel/table/options.html'
);
$scope
.
panelMeta
.
addEditorTab
(
'Time range'
,
'app/features/panel/partials/panelTime.html'
);
var
panelDefaults
=
{
...
...
public/app/plugins/panel/table/editor.ts
View file @
b5726a8d
...
...
@@ -118,7 +118,7 @@ export function tablePanelEditor($q, uiSegmentSrv) {
return
{
restrict
:
'E'
,
scope
:
true
,
templateUrl
:
'app/plugins/panel
s
/table/editor.html'
,
templateUrl
:
'app/plugins/panel/table/editor.html'
,
controller
:
TablePanelEditorCtrl
,
};
}
public/app/plugins/panel/table/module.ts
View file @
b5726a8d
...
...
@@ -10,7 +10,9 @@ import {TablePanelCtrl} from './controller';
import
{
TableRenderer
}
from
'./renderer'
;
import
{
tablePanelEditor
}
from
'./editor'
;
export
function
tablePanel
()
{
angular
.
module
(
'grafana.directives'
).
directive
(
'grafanaPanelTableEditor'
,
tablePanelEditor
);
function
tablePanel
()
{
'use strict'
;
return
{
restrict
:
'E'
,
...
...
@@ -102,5 +104,4 @@ export function tablePanel() {
};
}
angular
.
module
(
'grafana.directives'
).
directive
(
'grafanaPanelTable'
,
tablePanel
);
angular
.
module
(
'grafana.directives'
).
directive
(
'grafanaPanelTableEditor'
,
tablePanelEditor
);
export
{
tablePanel
as
panel
};
public/app/plugins/panel/text/module.js
View file @
b5726a8d
...
...
@@ -10,17 +10,7 @@ function (angular, app, _, require, PanelMeta) {
var
converter
;
var
module
=
angular
.
module
(
'grafana.panels.text'
,
[]);
app
.
useModule
(
module
);
module
.
directive
(
'grafanaPanelText'
,
function
()
{
return
{
controller
:
'TextPanelCtrl'
,
templateUrl
:
'app/plugins/panel/text/module.html'
,
};
});
module
.
controller
(
'TextPanelCtrl'
,
function
(
$scope
,
templateSrv
,
$sce
,
panelSrv
)
{
function
TextPanelCtrl
(
$scope
,
templateSrv
,
$sce
,
panelSrv
)
{
$scope
.
panelMeta
=
new
PanelMeta
({
panelName
:
'Text'
,
...
...
@@ -107,5 +97,16 @@ function (angular, app, _, require, PanelMeta) {
};
$scope
.
init
();
});
}
function
textPanel
()
{
return
{
controller
:
TextPanelCtrl
,
templateUrl
:
'app/plugins/panel/text/module.html'
,
};
}
return
{
panel
:
textPanel
,
};
});
public/app/plugins/plugin_api.md
View file @
b5726a8d
# Plugin API
##
Changelog
##
# 3.0 changes to plugin api changes
2.
5.1
There has been big changes to both data source and plugin schema (plugin.json) and how
you write the plugin main module.
#### Datasource plugin
Now data source plugins AMD/SystemJS module should return:
```
javascript
return
{
Datasource
:
ElasticDatasource
,
configView
:
editView
.
default
,
annotationsQueryEditor
:
annotationsQueryEditor
,
metricsQueryEditor
:
metricsQueryEditor
,
metricsQueryOptions
:
metricsQueryOptions
,
};
```
Where ElasticDatasource is a constructor function to a javascript. The constructor
function can take angular services and
`instanceSettings`
as parameters.
Example:
```
javascript
function
ElasticDatasource
(
instanceSettings
,
templateSrv
)
{
this
.
instanceSettings
=
this
.
instanceSettings
;
///...
};
```
A datasource module can optionally return a configView directive function, metricsQueryEditor directive function, etc.
Example:
```
javascript
function
metricsQueryEditor
()
{
return
{
controller
:
'ElasticQueryCtrl'
,
templateUrl
:
'app/plugins/datasource/elasticsearch/partials/query.editor.html'
};
}
```
#### Panel plugin
The panel plugin AMD/SystemJS module should return an object with a property named
`panel`
. This needs to be
a directive function.
### 2.5.1 changes
datasource annotationQuery changed. now single options parameter with:
-
range
-
rangeRaw
...
...
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