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
05dfccbb
Commit
05dfccbb
authored
Feb 02, 2016
by
Torkel Ödegaard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat(plugins): moved annotation editor to new plugin component loader
parent
fc829b32
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
21 additions
and
94 deletions
+21
-94
public/app/core/directives/plugin_component.ts
+11
-0
public/app/features/annotations/annotations_srv.js
+0
-1
public/app/features/annotations/partials/editor.html
+4
-2
public/app/features/annotations/query_editor.ts
+0
-25
public/app/features/datasources/all.js
+0
-1
public/app/features/datasources/config_view.ts
+0
-25
public/app/plugins/datasource/graphite/module.ts
+4
-38
public/app/plugins/datasource/graphite/partials/annotations.editor.html
+2
-2
No files found.
public/app/core/directives/plugin_component.ts
View file @
05dfccbb
...
...
@@ -60,6 +60,17 @@ function pluginDirectiveLoader($compile, datasourceSrv, $rootScope) {
});
});
}
// QueryOptionsCtrl
case
"annotations-query-ctrl"
:
{
return
System
.
import
(
scope
.
currentDatasource
.
meta
.
module
).
then
(
function
(
dsModule
)
{
return
{
name
:
'annotations-query-ctrl-'
+
scope
.
currentDatasource
.
meta
.
id
,
bindings
:
{
annotation
:
"="
,
datasource
:
"="
},
attrs
:
{
"annotation"
:
"currentAnnotation"
,
datasource
:
"currentDatasource"
},
Component
:
dsModule
.
AnnotationsQueryCtrl
,
};
});
}
// ConfigCtrl
case
'datasource-config-ctrl'
:
{
return
System
.
import
(
scope
.
datasourceMeta
.
module
).
then
(
function
(
dsModule
)
{
...
...
public/app/features/annotations/annotations_srv.js
View file @
05dfccbb
...
...
@@ -2,7 +2,6 @@ define([
'angular'
,
'lodash'
,
'./editor_ctrl'
,
'./query_editor'
],
function
(
angular
,
_
)
{
'use strict'
;
...
...
public/app/features/annotations/partials/editor.html
View file @
05dfccbb
...
...
@@ -91,8 +91,10 @@
</div>
</div>
<annotations-query-editor
datasource=
"currentDatasource"
annotation=
"currentAnnotation"
>
</annotations-query-editor>
<rebuild-on-change
property=
"currentAnnotation.datasource"
>
<plugin-component
type=
"annotations-query-ctrl"
>
</plugin-component>
</rebuild-on-change>
<br>
<button
ng-show=
"mode === 'new'"
type=
"button"
class=
"btn btn-success"
ng-click=
"add()"
>
Add
</button>
...
...
public/app/features/annotations/query_editor.ts
deleted
100644 → 0
View file @
fc829b32
///<reference path="../../headers/common.d.ts" />
import
angular
from
'angular'
;
/** @ngInject */
function
annotationsQueryEditor
(
dynamicDirectiveSrv
)
{
return
dynamicDirectiveSrv
.
create
({
scope
:
{
annotation
:
"="
,
datasource
:
"="
},
watchPath
:
"annotation.datasource"
,
directive
:
scope
=>
{
return
System
.
import
(
scope
.
datasource
.
meta
.
module
).
then
(
function
(
dsModule
)
{
return
{
name
:
'annotation-query-editor-'
+
scope
.
datasource
.
meta
.
id
,
fn
:
dsModule
.
annotationsQueryEditor
,
};
});
},
});
}
angular
.
module
(
'grafana.directives'
).
directive
(
'annotationsQueryEditor'
,
annotationsQueryEditor
);
public/app/features/datasources/all.js
View file @
05dfccbb
define
([
'./list_ctrl'
,
'./edit_ctrl'
,
'./config_view'
,
],
function
()
{});
public/app/features/datasources/config_view.ts
deleted
100644 → 0
View file @
fc829b32
///<reference path="../../headers/common.d.ts" />
import
angular
from
'angular'
;
/** @ngInject */
function
dsConfigView
(
dynamicDirectiveSrv
)
{
return
dynamicDirectiveSrv
.
create
({
scope
:
{
dsMeta
:
"="
,
current
:
"="
},
watchPath
:
"dsMeta.module"
,
directive
:
scope
=>
{
return
System
.
import
(
scope
.
dsMeta
.
module
).
then
(
function
(
dsModule
)
{
return
{
name
:
'ds-config-'
+
scope
.
dsMeta
.
id
,
fn
:
dsModule
.
configView
,
};
});
},
});
}
angular
.
module
(
'grafana.directives'
).
directive
(
'dsConfigView'
,
dsConfigView
);
public/app/plugins/datasource/graphite/module.ts
View file @
05dfccbb
...
...
@@ -9,49 +9,15 @@ class GraphiteQueryOptionsCtrl {
static
templateUrl
=
'public/app/plugins/datasource/graphite/partials/query.options.html'
;
}
class
AnnotationsQueryCtrl
{
static
templateUrl
=
'public/app/plugins/datasource/graphite/partials/annotations.editor.html'
;
}
export
{
GraphiteDatasource
as
Datasource
,
GraphiteQueryCtrl
as
QueryCtrl
,
GraphiteConfigCtrl
as
ConfigCtrl
,
GraphiteQueryOptionsCtrl
as
QueryOptionsCtrl
,
AnnotationsQueryCtrl
as
AnnotationsQueryCtrl
,
};
// define([
// './datasource',
// ],
// function (GraphiteDatasource) {
// 'use strict';
//
// function metricsQueryEditor() {
// return {
// controller: 'GraphiteQueryCtrl',
// templateUrl: 'public/app/plugins/datasource/graphite/partials/query.editor.html'
// };
// }
//
// function metricsQueryOptions() {
// return {templateUrl: 'public/app/plugins/datasource/graphite/partials/query.options.html'};
// }
//
// function annotationsQueryEditor() {
// return {templateUrl: 'public/app/plugins/datasource/graphite/partials/annotations.editor.html'};
// }
//
// function configView() {
// return {templateUrl: 'public/app/plugins/datasource/graphite/partials/config.html'};
// }
//
// function ConfigView() {
// }
// ConfigView.templateUrl = 'public/app/plugins/datasource/graphite/partials/config.html';
//
// return {
// Datasource: GraphiteDatasource,
// configView: configView,
// annotationsQueryEditor: annotationsQueryEditor,
// metricsQueryEditor: metricsQueryEditor,
// metricsQueryOptions: metricsQueryOptions,
// ConfigView: ConfigView
// };
// });
public/app/plugins/datasource/graphite/partials/annotations.editor.html
View file @
05dfccbb
<div
class=
"editor-row"
>
<div
class=
"editor-option"
>
<label
class=
"small"
>
Graphite target expression
</label>
<input
type=
"text"
class=
"span10"
ng-model=
'annotation.target'
placeholder=
""
></input>
<input
type=
"text"
class=
"span10"
ng-model=
'
ctrl.
annotation.target'
placeholder=
""
></input>
</div>
</div>
<div
class=
"editor-row"
>
<div
class=
"editor-option"
>
<label
class=
"small"
>
Graphite event tags
</label>
<input
type=
"text"
ng-model=
'annotation.tags'
placeholder=
""
></input>
<input
type=
"text"
ng-model=
'
ctrl.
annotation.tags'
placeholder=
""
></input>
</div>
</div>
...
...
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