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
f51d74fa
Commit
f51d74fa
authored
Dec 09, 2015
by
carl bergquist
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
change the way options are added
parent
78c6ce84
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
14 additions
and
11 deletions
+14
-11
public/app/plugins/datasource/elasticsearch/elastic_response.js
+6
-2
public/app/plugins/datasource/elasticsearch/metric_agg.js
+6
-7
public/app/plugins/datasource/elasticsearch/partials/metricAgg.html
+1
-1
public/app/plugins/datasource/elasticsearch/query_def.js
+1
-1
No files found.
public/app/plugins/datasource/elasticsearch/elastic_response.js
View file @
f51d74fa
...
...
@@ -76,8 +76,12 @@ function (_, queryDef) {
newSeries
=
{
datapoints
:
[],
metric
:
metric
.
type
,
field
:
metric
.
field
,
props
:
props
};
for
(
i
=
0
;
i
<
esAgg
.
buckets
.
length
;
i
++
)
{
bucket
=
esAgg
.
buckets
[
i
];
value
=
bucket
[
metric
.
id
].
value
;
newSeries
.
datapoints
.
push
([
value
,
bucket
.
key
]);
value
=
bucket
[
metric
.
id
];
if
(
value
!==
undefined
)
{
newSeries
.
datapoints
.
push
([
value
.
value
,
bucket
.
key
]);
}
}
seriesList
.
push
(
newSeries
);
break
;
...
...
public/app/plugins/datasource/elasticsearch/metric_agg.js
View file @
f51d74fa
...
...
@@ -13,7 +13,6 @@ function (angular, _, queryDef) {
$scope
.
metricAggTypes
=
queryDef
.
metricAggTypes
;
$scope
.
extendedStats
=
queryDef
.
extendedStats
;
$scope
.
mavgSourceOptions
=
[];
$scope
.
init
=
function
()
{
$scope
.
agg
=
metricAggs
[
$scope
.
index
];
...
...
@@ -23,7 +22,6 @@ function (angular, _, queryDef) {
$rootScope
.
onAppEvent
(
'elastic-query-updated'
,
function
()
{
$scope
.
index
=
_
.
indexOf
(
metricAggs
,
$scope
.
agg
);
$scope
.
validateModel
();
$scope
.
updateMovingAverageOptions
();
},
$scope
);
$scope
.
validateModel
=
function
()
{
...
...
@@ -38,7 +36,7 @@ function (angular, _, queryDef) {
switch
(
$scope
.
agg
.
type
)
{
case
'moving_avg'
:
{
$scope
.
agg
.
mavgSource
=
$scope
.
agg
.
mavgSource
||
''
;
$scope
.
agg
.
mavgSource
=
$scope
.
agg
.
mavgSource
||
'
Basec on metric
'
;
$scope
.
settingsLinkText
=
'Moving average options'
;
break
;
}
...
...
@@ -90,6 +88,11 @@ function (angular, _, queryDef) {
return
$scope
.
getFields
({
$fieldType
:
'number'
});
};
$scope
.
mavgSourceOptions
=
function
()
{
return
$q
.
when
(
queryDef
.
getMovingAverageSourceOptions
(
$scope
.
target
))
.
then
(
uiSegmentSrv
.
transformToSegments
(
false
));
};
$scope
.
addMetricAgg
=
function
()
{
var
addIndex
=
metricAggs
.
length
;
...
...
@@ -101,10 +104,6 @@ function (angular, _, queryDef) {
$scope
.
onChange
();
};
$scope
.
updateMovingAverageOptions
=
function
()
{
$scope
.
mvagSourceOptions
=
queryDef
.
getMovingAverageSourceOptions
(
$scope
.
target
);
};
$scope
.
removeMetricAgg
=
function
()
{
metricAggs
.
splice
(
$scope
.
index
,
1
);
$scope
.
onChange
();
...
...
public/app/plugins/datasource/elasticsearch/partials/metricAgg.html
View file @
f51d74fa
...
...
@@ -33,7 +33,7 @@
Based on
</li>
<li>
<metric-segment-model
property=
"agg.mavgSource"
options=
"mavgSourceOptions
"
on-change=
"onChangeInternal()"
css-class=
"last"
></metric-segment-model>
<metric-segment-model
property=
"agg.mavgSource"
get-options=
"mavgSourceOptions()
"
on-change=
"onChangeInternal()"
css-class=
"last"
></metric-segment-model>
</li>
</ul>
<div
class=
"clearfix"
></div>
...
...
public/app/plugins/datasource/elasticsearch/query_def.js
View file @
f51d74fa
...
...
@@ -13,7 +13,7 @@ function (_) {
{
text
:
"Min"
,
value
:
'min'
,
requiresField
:
true
},
{
text
:
"Extended Stats"
,
value
:
'extended_stats'
,
requiresField
:
true
},
{
text
:
"Percentiles"
,
value
:
'percentiles'
,
requiresField
:
true
},
{
text
:
"Moving Av
g
"
,
value
:
'moving_avg'
,
requiresField
:
false
},
{
text
:
"Moving Av
erage
"
,
value
:
'moving_avg'
,
requiresField
:
false
},
{
text
:
"Unique Count"
,
value
:
"cardinality"
,
requiresField
:
true
},
{
text
:
"Raw Document"
,
value
:
"raw_document"
,
requiresField
:
false
}
],
...
...
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