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
4244551a
Commit
4244551a
authored
Dec 16, 2016
by
bergquist
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix(influxdb): removes quotes for field key queries
fixes #6473
parent
3a968093
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
2 deletions
+11
-2
public/app/plugins/datasource/influxdb/query_builder.js
+5
-2
public/app/plugins/datasource/influxdb/specs/query_builder_specs.ts
+6
-0
No files found.
public/app/plugins/datasource/influxdb/query_builder.js
View file @
4244551a
...
...
@@ -56,8 +56,11 @@ function (_) {
query
+=
' WITH MEASUREMENT =~ /'
+
withMeasurementFilter
+
'/'
;
}
}
else
if
(
type
===
'FIELDS'
)
{
query
=
'SHOW FIELD KEYS FROM "'
+
this
.
target
.
measurement
+
'"'
;
return
query
;
if
(
!
this
.
target
.
measurement
.
match
(
'^/.*/'
))
{
return
'SHOW FIELD KEYS FROM "'
+
this
.
target
.
measurement
+
'"'
;
}
else
{
return
'SHOW FIELD KEYS FROM '
+
this
.
target
.
measurement
;
}
}
else
if
(
type
===
'RETENTION POLICIES'
)
{
query
=
'SHOW RETENTION POLICIES on "'
+
this
.
database
+
'"'
;
return
query
;
...
...
public/app/plugins/datasource/influxdb/specs/query_builder_specs.ts
View file @
4244551a
...
...
@@ -88,6 +88,12 @@ describe('InfluxQueryBuilder', function() {
expect
(
query
).
to
.
be
(
'SHOW FIELD KEYS FROM "cpu"'
);
});
it
(
'should build show field query with regexp'
,
function
()
{
var
builder
=
new
InfluxQueryBuilder
({
measurement
:
'/$var/'
,
tags
:
[{
key
:
'app'
,
value
:
'email'
}]});
var
query
=
builder
.
buildExploreQuery
(
'FIELDS'
);
expect
(
query
).
to
.
be
(
'SHOW FIELD KEYS FROM /$var/'
);
});
it
(
'should build show retention policies query'
,
function
()
{
var
builder
=
new
InfluxQueryBuilder
({
measurement
:
'cpu'
,
tags
:
[]},
'site'
);
var
query
=
builder
.
buildExploreQuery
(
'RETENTION POLICIES'
);
...
...
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