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
ed499621
Commit
ed499621
authored
Aug 15, 2015
by
Torkel Ödegaard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
refactor(): began work on big design change for how data source query editors are loaded
parent
16fa5c4d
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
38 additions
and
22 deletions
+38
-22
public/app/features/panel/panelDirective.js
+20
-4
public/app/partials/metrics.html
+8
-1
public/app/plugins/datasource/graphite/partials/query.editor.html
+0
-0
public/app/plugins/datasource/graphite/queryCtrl.js
+8
-15
public/app/plugins/datasource/influxdb/partials/query.editor.html
+1
-1
public/app/plugins/datasource/influxdb_08/partials/query.editor.html
+1
-1
No files found.
public/app/features/panel/panelDirective.js
View file @
ed499621
...
...
@@ -6,9 +6,9 @@ define([
function
(
angular
,
$
,
config
)
{
'use strict'
;
angular
.
module
(
'grafana.directives'
)
.
directive
(
'panelLoader'
,
function
(
$compile
,
$parse
)
{
var
module
=
angular
.
module
(
'grafana.directives'
);
module
.
directive
(
'panelLoader'
,
function
(
$compile
,
$parse
)
{
return
{
restrict
:
'E'
,
link
:
function
(
scope
,
elem
,
attr
)
{
...
...
@@ -22,7 +22,9 @@ function (angular, $, config) {
});
}
};
}).
directive
(
'grafanaPanel'
,
function
()
{
});
module
.
directive
(
'grafanaPanel'
,
function
()
{
return
{
restrict
:
'E'
,
templateUrl
:
'app/features/panel/partials/panel.html'
,
...
...
@@ -37,4 +39,18 @@ function (angular, $, config) {
}
};
});
module
.
directive
(
'queryEditorLoader'
,
function
(
$compile
,
$parse
,
datasourceSrv
)
{
return
{
restrict
:
'E'
,
link
:
function
(
scope
,
elem
)
{
datasourceSrv
.
get
(
scope
.
panel
.
datasource
).
then
(
function
(
ds
)
{
var
panelEl
=
angular
.
element
(
document
.
createElement
(
'metric-query-editor-'
+
ds
.
meta
.
type
));
elem
.
append
(
panelEl
);
$compile
(
panelEl
)(
scope
);
});
}
};
});
});
public/app/partials/metrics.html
View file @
ed499621
<div
ng-include
src=
"datasource.meta.partials.query"
></div
>
<div
class=
"editor-row"
>
<!-- <div ng-include src="datasource.meta.partials.query"></div> -->
<query-editor-loader
ng-repeat=
"target in panel.targets"
>
</query-editor-loader>
</div>
</div>
<div
class=
"editor-row"
style=
"margin-top: 30px"
>
<button
class=
"btn btn-inverse pull-right"
ng-click=
"addDataQuery(panel.target)"
>
...
...
public/app/plugins/datasource/graphite/partials/query.editor.html
View file @
ed499621
This diff is collapsed.
Click to expand it.
public/app/plugins/datasource/graphite/queryCtrl.js
View file @
ed499621
...
...
@@ -11,6 +11,13 @@ function (angular, _, config, gfunc, Parser) {
var
module
=
angular
.
module
(
'grafana.controllers'
);
var
targetLetters
=
'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
;
module
.
directive
(
'metricQueryEditorGraphite'
,
function
()
{
return
{
controller
:
'GraphiteQueryCtrl'
,
templateUrl
:
'app/plugins/datasource/graphite/partials/query.editor.html'
,
};
});
module
.
controller
(
'GraphiteQueryCtrl'
,
function
(
$scope
,
$sce
,
templateSrv
)
{
$scope
.
init
=
function
()
{
...
...
@@ -313,22 +320,8 @@ function (angular, _, config, gfunc, Parser) {
return
new
MetricSegment
({
value
:
'select metric'
,
fake
:
true
});
};
}
);
$scope
.
init
(
);
module
.
directive
(
'focusMe'
,
function
(
$timeout
,
$parse
)
{
return
{
//scope: true, // optionally create a child scope
link
:
function
(
scope
,
element
,
attrs
)
{
var
model
=
$parse
(
attrs
.
focusMe
);
scope
.
$watch
(
model
,
function
(
value
)
{
if
(
value
===
true
)
{
$timeout
(
function
()
{
element
[
0
].
focus
();
});
}
});
}
};
});
});
public/app/plugins/datasource/influxdb/partials/query.editor.html
View file @
ed499621
...
...
@@ -59,7 +59,7 @@
</li>
</ul>
<input
type=
"text"
class=
"tight-form-clear-input"
style=
"width: 80%"
ng-model=
"target.query"
focus-me
=
"target.rawQuery"
spellcheck=
'false'
ng-model-onblur
ng-change=
"get_data()"
ng-show=
"target.rawQuery"
/>
<input
type=
"text"
class=
"tight-form-clear-input"
style=
"width: 80%"
ng-model=
"target.query"
give-focus
=
"target.rawQuery"
spellcheck=
'false'
ng-model-onblur
ng-change=
"get_data()"
ng-show=
"target.rawQuery"
/>
<ul
class=
"tight-form-list"
role=
"menu"
ng-hide=
"target.rawQuery"
>
<li
class=
"tight-form-item query-keyword"
style=
"width: 75px;"
>
...
...
public/app/plugins/datasource/influxdb_08/partials/query.editor.html
View file @
ed499621
...
...
@@ -40,7 +40,7 @@
class=
"tight-form-input span10"
ng-model=
"target.query"
placeholder=
"select ..."
focus-me
=
"target.rawQuery"
give-focus
=
"target.rawQuery"
spellcheck=
'false'
data-min-length=
0
data-items=
100
ng-model-onblur
...
...
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