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
66460ae7
Unverified
Commit
66460ae7
authored
Jul 03, 2020
by
Torkel Ödegaard
Committed by
GitHub
Jul 03, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
InfluxDB: Fixed new group by dropdown now showing (#26031)
parent
3acc2a6a
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
17 additions
and
0 deletions
+17
-0
public/app/plugins/datasource/influxdb/query_builder.ts
+6
-0
public/app/plugins/datasource/influxdb/query_ctrl.ts
+2
-0
public/app/plugins/datasource/influxdb/specs/query_builder.test.ts
+9
-0
No files found.
public/app/plugins/datasource/influxdb/query_builder.ts
View file @
66460ae7
...
@@ -90,6 +90,12 @@ export class InfluxQueryBuilder {
...
@@ -90,6 +90,12 @@ export class InfluxQueryBuilder {
if
(
tag
.
key
===
withKey
)
{
if
(
tag
.
key
===
withKey
)
{
return
memo
;
return
memo
;
}
}
// value operators not supported in these types of queries
if
(
tag
.
operator
===
'>'
||
tag
.
operator
===
'<'
)
{
return
memo
;
}
memo
.
push
(
renderTagCondition
(
tag
,
memo
.
length
));
memo
.
push
(
renderTagCondition
(
tag
,
memo
.
length
));
return
memo
;
return
memo
;
},
},
...
...
public/app/plugins/datasource/influxdb/query_ctrl.ts
View file @
66460ae7
...
@@ -167,6 +167,7 @@ export class InfluxQueryCtrl extends QueryCtrl {
...
@@ -167,6 +167,7 @@ export class InfluxQueryCtrl extends QueryCtrl {
const
plusButton
=
this
.
uiSegmentSrv
.
newPlusButton
();
const
plusButton
=
this
.
uiSegmentSrv
.
newPlusButton
();
this
.
groupBySegment
.
value
=
plusButton
.
value
;
this
.
groupBySegment
.
value
=
plusButton
.
value
;
this
.
groupBySegment
.
html
=
plusButton
.
html
;
this
.
groupBySegment
.
html
=
plusButton
.
html
;
this
.
groupBySegment
.
fake
=
true
;
this
.
panelCtrl
.
refresh
();
this
.
panelCtrl
.
refresh
();
}
}
...
@@ -308,6 +309,7 @@ export class InfluxQueryCtrl extends QueryCtrl {
...
@@ -308,6 +309,7 @@ export class InfluxQueryCtrl extends QueryCtrl {
if
(
segment
.
type
===
'condition'
)
{
if
(
segment
.
type
===
'condition'
)
{
return
Promise
.
resolve
([
this
.
uiSegmentSrv
.
newSegment
(
'AND'
),
this
.
uiSegmentSrv
.
newSegment
(
'OR'
)]);
return
Promise
.
resolve
([
this
.
uiSegmentSrv
.
newSegment
(
'AND'
),
this
.
uiSegmentSrv
.
newSegment
(
'OR'
)]);
}
}
if
(
segment
.
type
===
'operator'
)
{
if
(
segment
.
type
===
'operator'
)
{
const
nextValue
=
this
.
tagSegments
[
index
+
1
].
value
;
const
nextValue
=
this
.
tagSegments
[
index
+
1
].
value
;
if
(
/^
\/
.*
\/
$/
.
test
(
nextValue
))
{
if
(
/^
\/
.*
\/
$/
.
test
(
nextValue
))
{
...
...
public/app/plugins/datasource/influxdb/specs/query_builder.test.ts
View file @
66460ae7
...
@@ -32,6 +32,15 @@ describe('InfluxQueryBuilder', () => {
...
@@ -32,6 +32,15 @@ describe('InfluxQueryBuilder', () => {
expect
(
query
).
toBe
(
'SHOW TAG KEYS WHERE "host" =
\'
se1
\'
'
);
expect
(
query
).
toBe
(
'SHOW TAG KEYS WHERE "host" =
\'
se1
\'
'
);
});
});
it
(
'should ignore condition if operator is a value operator'
,
()
=>
{
const
builder
=
new
InfluxQueryBuilder
({
measurement
:
''
,
tags
:
[{
key
:
'value'
,
value
:
'10'
,
operator
:
'>'
}],
});
const
query
=
builder
.
buildExploreQuery
(
'TAG_KEYS'
);
expect
(
query
).
toBe
(
'SHOW TAG KEYS'
);
});
it
(
'should have no conditions in measurement query for query with no tags'
,
()
=>
{
it
(
'should have no conditions in measurement query for query with no tags'
,
()
=>
{
const
builder
=
new
InfluxQueryBuilder
({
measurement
:
''
,
tags
:
[]
});
const
builder
=
new
InfluxQueryBuilder
({
measurement
:
''
,
tags
:
[]
});
const
query
=
builder
.
buildExploreQuery
(
'MEASUREMENTS'
);
const
query
=
builder
.
buildExploreQuery
(
'MEASUREMENTS'
);
...
...
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