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
de90ad89
Commit
de90ad89
authored
Feb 08, 2016
by
Torkel Ödegaard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat(influxdb): escape influxdb tag values, fixes #3950
parent
7f83be3d
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
4 deletions
+4
-4
public/app/plugins/datasource/influxdb/influx_query.ts
+2
-2
public/app/plugins/datasource/influxdb/specs/influx_query_specs.ts
+2
-2
No files found.
public/app/plugins/datasource/influxdb/influx_query.ts
View file @
de90ad89
...
@@ -6,8 +6,8 @@ import queryPart from './query_part';
...
@@ -6,8 +6,8 @@ import queryPart from './query_part';
export
default
class
InfluxQuery
{
export
default
class
InfluxQuery
{
target
:
any
;
target
:
any
;
selectModels
:
any
[];
selectModels
:
any
[];
groupByParts
:
any
;
queryBuilder
:
any
;
queryBuilder
:
any
;
groupByParts
:
any
;
constructor
(
target
)
{
constructor
(
target
)
{
this
.
target
=
target
;
this
.
target
=
target
;
...
@@ -144,7 +144,7 @@ export default class InfluxQuery {
...
@@ -144,7 +144,7 @@ export default class InfluxQuery {
// quote value unless regex
// quote value unless regex
if
(
operator
!==
'=~'
&&
operator
!==
'!~'
)
{
if
(
operator
!==
'=~'
&&
operator
!==
'!~'
)
{
value
=
"'"
+
value
+
"'"
;
value
=
"'"
+
value
.
replace
(
'
\
\'
, '
\\\\
')
+ "'
";
}
}
return str + '"
' + tag.key + '
" ' + operator + ' ' + value;
return str + '"
' + tag.key + '
" ' + operator + ' ' + value;
...
...
public/app/plugins/datasource/influxdb/specs/influx_query_specs.ts
View file @
de90ad89
...
@@ -51,12 +51,12 @@ describe('InfluxQuery', function() {
...
@@ -51,12 +51,12 @@ describe('InfluxQuery', function() {
var
query
=
new
InfluxQuery
({
var
query
=
new
InfluxQuery
({
measurement
:
'cpu'
,
measurement
:
'cpu'
,
groupBy
:
[{
type
:
'time'
,
params
:
[
'auto'
]}],
groupBy
:
[{
type
:
'time'
,
params
:
[
'auto'
]}],
tags
:
[{
key
:
'hostname'
,
value
:
'server1'
}]
tags
:
[{
key
:
'hostname'
,
value
:
'server
\\
1'
}]
});
});
var
queryText
=
query
.
render
();
var
queryText
=
query
.
render
();
expect
(
queryText
).
to
.
be
(
'SELECT mean("value") FROM "cpu" WHERE "hostname" =
\'
server1
\'
AND $timeFilter'
expect
(
queryText
).
to
.
be
(
'SELECT mean("value") FROM "cpu" WHERE "hostname" =
\'
server
\\\\
1
\'
AND $timeFilter'
+
' GROUP BY time($interval)'
);
+
' GROUP BY time($interval)'
);
});
});
...
...
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