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
18c57ea2
Commit
18c57ea2
authored
Feb 28, 2016
by
utkarshcmu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Made opentsdb query_ctrl robust
parent
a883424d
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
23 additions
and
1 deletions
+23
-1
public/app/plugins/datasource/opentsdb/datasource.js
+13
-0
public/app/plugins/datasource/opentsdb/query_ctrl.ts
+9
-1
public/app/plugins/datasource/opentsdb/specs/query-ctrl-specs.ts
+1
-0
No files found.
public/app/plugins/datasource/opentsdb/datasource.js
View file @
18c57ea2
...
...
@@ -233,6 +233,19 @@ function (angular, _, dateMath) {
return
aggregatorsPromise
;
};
var
filterTypesPromise
=
null
;
this
.
getFilterTypes
=
function
()
{
if
(
filterTypesPromise
)
{
return
filterTypesPromise
;
}
filterTypesPromise
=
this
.
_get
(
'/api/config/filters'
).
then
(
function
(
result
)
{
if
(
result
.
data
)
{
return
Object
.
keys
(
result
.
data
).
sort
();
}
return
[];
});
return
filterTypesPromise
;
};
function
transformMetricData
(
md
,
groupByTags
,
target
,
options
)
{
var
metricLabel
=
createMetricLabel
(
md
,
target
,
groupByTags
,
options
);
var
dps
=
[];
...
...
public/app/plugins/datasource/opentsdb/query_ctrl.ts
View file @
18c57ea2
...
...
@@ -45,7 +45,15 @@ export class OpenTsQueryCtrl extends QueryCtrl {
}
this
.
datasource
.
getAggregators
().
then
((
aggs
)
=>
{
if
(
aggs
.
length
!==
0
)
{
this
.
aggregators
=
aggs
;
}
});
this
.
datasource
.
getFilterTypes
().
then
((
filterTypes
)
=>
{
if
(
filterTypes
.
length
!==
0
)
{
this
.
filterTypes
=
filterTypes
;
}
});
// needs to be defined here as it is called from typeahead
...
...
@@ -135,7 +143,7 @@ export class OpenTsQueryCtrl extends QueryCtrl {
}
if
(
!
this
.
target
.
currentFilterType
)
{
this
.
target
.
currentFilterType
=
'literal_or'
;
this
.
target
.
currentFilterType
=
'
i
literal_or'
;
}
if
(
!
this
.
target
.
currentFilterGroupBy
)
{
...
...
public/app/plugins/datasource/opentsdb/specs/query-ctrl-specs.ts
View file @
18c57ea2
...
...
@@ -17,6 +17,7 @@ describe('OpenTsQueryCtrl', function() {
ctx
.
panelCtrl
=
{
panel
:
{}};
ctx
.
panelCtrl
.
refresh
=
sinon
.
spy
();
ctx
.
datasource
.
getAggregators
=
sinon
.
stub
().
returns
(
ctx
.
$q
.
when
([]));
ctx
.
datasource
.
getFilterTypes
=
sinon
.
stub
().
returns
(
ctx
.
$q
.
when
([]));
ctx
.
ctrl
=
$controller
(
OpenTsQueryCtrl
,
{
$scope
:
ctx
.
scope
},
{
panelCtrl
:
ctx
.
panelCtrl
,
...
...
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