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
efc3def7
Commit
efc3def7
authored
Sep 07, 2015
by
Torkel Ödegaard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat(elasticsearch): small refactoring and polish
parent
6c304924
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
17 additions
and
10 deletions
+17
-10
public/app/directives/metric.segment.js
+6
-5
public/app/plugins/datasource/elasticsearch/bucketAgg.js
+1
-1
public/app/plugins/datasource/elasticsearch/partials/bucketAgg.html
+3
-3
public/app/plugins/datasource/elasticsearch/partials/metricAgg.html
+1
-1
public/app/plugins/datasource/elasticsearch/queryCtrl.js
+1
-0
public/css/less/tightform.less
+5
-0
No files found.
public/app/directives/metric.segment.js
View file @
efc3def7
...
...
@@ -173,11 +173,12 @@ function (angular, app, _, $) {
$scope
.
valueToSegment
=
function
(
value
)
{
var
option
=
_
.
findWhere
(
$scope
.
options
,
{
value
:
value
});
if
(
option
)
{
return
uiSegmentSrv
.
newSegment
({
value
:
option
.
text
,
cssClass
:
attrs
.
cssClass
,
custom
:
attrs
.
custom
});
}
else
{
return
uiSegmentSrv
.
newSegment
({
value
:
value
,
cssClass
:
attrs
.
cssClass
,
custom
:
attrs
.
custom
});
}
var
segment
=
{
cssClass
:
attrs
.
cssClass
,
custom
:
attrs
.
custom
,
value
:
option
?
option
.
text
:
value
,
};
return
uiSegmentSrv
.
newSegment
(
segment
);
};
$scope
.
getOptionsInternal
=
function
()
{
...
...
public/app/plugins/datasource/elasticsearch/bucketAgg.js
View file @
efc3def7
...
...
@@ -54,7 +54,7 @@ function (angular, _, queryDef) {
$scope
.
settingsLinkText
+=
' ('
+
$scope
.
agg
.
order
+
')'
;
}
}
else
if
(
$scope
.
agg
.
type
===
'date_histogram'
)
{
delete
$scope
.
agg
.
f
ield
;
$scope
.
agg
.
field
=
$scope
.
target
.
timeF
ield
;
}
return
true
;
...
...
public/app/plugins/datasource/elasticsearch/partials/bucketAgg.html
View file @
efc3def7
...
...
@@ -7,10 +7,10 @@
<li>
<metric-segment-model
property=
"agg.type"
options=
"bucketAggTypes"
on-change=
"onChangeInternal()"
custom=
"false"
css-class=
"tight-form-item-large"
></metric-segment-model>
</li>
<li
ng-if=
"agg.field"
>
<li>
<metric-segment-model
property=
"agg.field"
get-options=
"getFields()"
on-change=
"onChangeInternal()"
css-class=
"tight-form-item-xxlarge"
></metric-segment>
</li>
<li
class=
"tight-form-item
tight-form-align
"
ng-if=
"settingsLinkText"
>
<li
class=
"tight-form-item
last
"
ng-if=
"settingsLinkText"
>
<a
ng-click=
"toggleOptions()"
>
{{settingsLinkText}}
</a>
</li>
</ul>
...
...
@@ -27,7 +27,7 @@
</div>
<div
class=
"tight-form"
ng-if=
"showOptions"
>
<div
style=
"
margin: 20px 0 20px 148px;display: inline-block
"
>
<div
style=
"
tight-form-inner-box"
ng-if=
"agg.type === 'terms'
"
>
<div
class=
"tight-form"
>
<ul
class=
"tight-form-list"
>
<li
class=
"tight-form-item"
style=
"width: 60px"
>
...
...
public/app/plugins/datasource/elasticsearch/partials/metricAgg.html
View file @
efc3def7
...
...
@@ -9,7 +9,7 @@
<li
ng-if=
"agg.type !== 'count'"
>
<metric-segment-model
property=
"agg.field"
get-options=
"getFields()"
on-change=
"onChange()"
css-class=
"tight-form-item-xxlarge"
></metric-segment>
</li>
<li
class=
"tight-form-item
tight-form-align
"
ng-if=
"settingsLinkText"
>
<li
class=
"tight-form-item
last
"
ng-if=
"settingsLinkText"
>
<a
ng-click=
"toggleOptions()"
>
{{settingsLinkText}}
</a>
</li>
</ul>
...
...
public/app/plugins/datasource/elasticsearch/queryCtrl.js
View file @
efc3def7
...
...
@@ -15,6 +15,7 @@ function (angular, _) {
target
.
metrics
=
target
.
metrics
||
[{
type
:
'count'
,
id
:
'1'
}];
target
.
bucketAggs
=
target
.
bucketAggs
||
[{
type
:
'date_histogram'
,
id
:
'2'
}];
target
.
timeField
=
$scope
.
datasource
.
timeField
;
};
$scope
.
getFields
=
function
()
{
...
...
public/css/less/tightform.less
View file @
efc3def7
...
...
@@ -213,3 +213,8 @@ select.tight-form-input {
.tight-form-item-large { width: 115px; }
.tight-form-item-xlarge { width: 150px; }
.tight-form-item-xxlarge { width: 200px; }
.tight-form-inner-box {
margin: 20px 0 20px 148px;
display: inline-block;
}
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