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
d4c3463f
Commit
d4c3463f
authored
Jan 06, 2015
by
Torkel Ödegaard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
InfluxDB: auto escape column names with special characters, Closes #1296
parent
47e4b771
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
9 additions
and
14 deletions
+9
-14
CHANGELOG.md
+1
-0
src/app/features/influxdb/datasource.js
+8
-13
src/app/features/influxdb/queryCtrl.js
+0
-1
No files found.
CHANGELOG.md
View file @
d4c3463f
...
...
@@ -2,6 +2,7 @@
**Enhancements**
-
[
Issue #1297
](
https://github.com/grafana/grafana/issues/1297
)
. Graphite: Added cumulative and minimumBelow graphite functions
-
[
Issue #1296
](
https://github.com/grafana/grafana/issues/1296
)
. InfluxDB: Auto escape column names with special characters. Thanks @steven-aerts
# 1.9.1 (2014-12-29)
...
...
src/app/features/influxdb/datasource.js
View file @
d4c3463f
...
...
@@ -74,16 +74,19 @@ function (angular, _, kbn, InfluxSeries, InfluxQueryBuilder) {
};
InfluxDatasource
.
prototype
.
listColumns
=
function
(
seriesName
)
{
var
interpolated
=
templateSrv
.
replace
(
seriesName
);
if
(
interpolated
[
0
]
!==
'/'
)
{
interpolated
=
'/'
+
interpolated
+
'/'
;
seriesName
=
templateSrv
.
replace
(
seriesName
);
if
(
!
seriesName
.
match
(
'^/.*/'
)
&&
!
seriesName
.
match
(
/^merge
\(
.*
\)
/
))
{
seriesName
=
'"'
+
seriesName
+
'"'
;
}
return
this
.
_seriesQuery
(
'select * from '
+
interpolated
+
' limit 1'
).
then
(
function
(
data
)
{
return
this
.
_seriesQuery
(
'select * from '
+
seriesName
+
' limit 1'
).
then
(
function
(
data
)
{
if
(
!
data
)
{
return
[];
}
return
data
[
0
].
columns
;
return
data
[
0
].
columns
.
map
(
function
(
item
)
{
return
/^
\w
+$/
.
test
(
item
)
?
item
:
(
'"'
+
item
+
'"'
);
});
});
};
...
...
@@ -97,17 +100,9 @@ function (angular, _, kbn, InfluxSeries, InfluxQueryBuilder) {
if
(
!
data
||
data
.
length
===
0
)
{
return
[];
}
// influxdb >= 1.8
if
(
data
[
0
].
points
.
length
>
0
)
{
return
_
.
map
(
data
[
0
].
points
,
function
(
point
)
{
return
point
[
1
];
});
}
else
{
// influxdb <= 1.7
return
_
.
map
(
data
,
function
(
series
)
{
return
series
.
name
;
// influxdb < 1.7
});
}
});
};
...
...
src/app/features/influxdb/queryCtrl.js
View file @
d4c3463f
...
...
@@ -88,7 +88,6 @@ function (angular, _) {
seriesList
=
[];
$scope
.
datasource
.
listSeries
(
query
).
then
(
function
(
series
)
{
seriesList
=
series
;
console
.
log
(
series
);
callback
(
seriesList
);
});
}
...
...
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