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
8526230b
Commit
8526230b
authored
Oct 22, 2015
by
Torkel Ödegaard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix(influxdb_08): fixed influxdb 08 query editor issue, fixes #3009
parent
9d04a4c4
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
36 additions
and
39 deletions
+36
-39
public/app/plugins/datasource/influxdb_08/datasource.js
+4
-4
public/app/plugins/datasource/influxdb_08/func_editor.js
+0
-0
public/app/plugins/datasource/influxdb_08/influx_series.js
+0
-0
public/app/plugins/datasource/influxdb_08/query_builder.js
+0
-0
public/app/plugins/datasource/influxdb_08/query_ctrl.js
+2
-1
public/app/plugins/datasource/influxdb_08/specs/datasource-specs.ts
+14
-18
public/app/plugins/datasource/influxdb_08/specs/influx_series_specs.ts
+9
-9
public/app/plugins/datasource/influxdb_08/specs/query_builder_specs.ts
+7
-7
No files found.
public/app/plugins/datasource/influxdb_08/datasource.js
View file @
8526230b
...
@@ -2,11 +2,11 @@ define([
...
@@ -2,11 +2,11 @@ define([
'angular'
,
'angular'
,
'lodash'
,
'lodash'
,
'app/core/utils/datemath'
,
'app/core/utils/datemath'
,
'./influx
S
eries'
,
'./influx
_s
eries'
,
'./query
B
uilder'
,
'./query
_b
uilder'
,
'./directives'
,
'./directives'
,
'./query
C
trl'
,
'./query
_c
trl'
,
'./func
E
ditor'
,
'./func
_e
ditor'
,
],
],
function
(
angular
,
_
,
dateMath
,
InfluxSeries
,
InfluxQueryBuilder
)
{
function
(
angular
,
_
,
dateMath
,
InfluxSeries
,
InfluxQueryBuilder
)
{
'use strict'
;
'use strict'
;
...
...
public/app/plugins/datasource/influxdb_08/func
E
ditor.js
→
public/app/plugins/datasource/influxdb_08/func
_e
ditor.js
View file @
8526230b
File moved
public/app/plugins/datasource/influxdb_08/influx
S
eries.js
→
public/app/plugins/datasource/influxdb_08/influx
_s
eries.js
View file @
8526230b
File moved
public/app/plugins/datasource/influxdb_08/query
B
uilder.js
→
public/app/plugins/datasource/influxdb_08/query
_b
uilder.js
View file @
8526230b
File moved
public/app/plugins/datasource/influxdb_08/query
C
trl.js
→
public/app/plugins/datasource/influxdb_08/query
_c
trl.js
View file @
8526230b
...
@@ -89,6 +89,7 @@ function (angular) {
...
@@ -89,6 +89,7 @@ function (angular) {
}
}
};
};
}
);
$scope
.
init
(
);
});
});
});
public/
test/specs/influxdb-datasource-specs.j
s
→
public/
app/plugins/datasource/influxdb_08/specs/datasource-specs.t
s
View file @
8526230b
define
([
///<amd-dependency path="app/plugins/datasource/influxdb_08/datasource"/>
'./helpers'
,
///<amd-dependency path="app/services/backendSrv"/>
'app/plugins/datasource/influxdb_08/datasource'
,
///<amd-dependency path="app/services/alertSrv"/>
'app/services/backendSrv'
,
///<amd-dependency path="test/specs/helpers" name="helpers" />
'app/services/alertSrv'
],
function
(
helpers
)
{
import
{
describe
,
beforeEach
,
it
,
sinon
,
expect
,
angularMocks
}
from
'test/lib/common'
;
'use strict'
;
declare
var
helpers
:
any
;
describe
(
'InfluxDatasource'
,
function
()
{
describe
(
'InfluxDatasource'
,
function
()
{
var
ctx
=
new
helpers
.
ServiceTestContext
();
var
ctx
=
new
helpers
.
ServiceTestContext
();
beforeEach
(
module
(
'grafana.services'
));
beforeEach
(
angularMocks
.
module
(
'grafana.services'
));
beforeEach
(
ctx
.
providePhase
([
'templateSrv'
]));
beforeEach
(
ctx
.
providePhase
([
'templateSrv'
]));
beforeEach
(
ctx
.
createService
(
'InfluxDatasource_08'
));
beforeEach
(
ctx
.
createService
(
'InfluxDatasource_08'
));
beforeEach
(
function
()
{
beforeEach
(
function
()
{
...
@@ -18,8 +19,7 @@ define([
...
@@ -18,8 +19,7 @@ define([
describe
(
'When querying influxdb with one target using query editor target spec'
,
function
()
{
describe
(
'When querying influxdb with one target using query editor target spec'
,
function
()
{
var
results
;
var
results
;
var
urlExpected
=
"/series?p=mupp&q=select+mean(value)+from+%22test%22"
+
var
urlExpected
=
"/series?p=mupp&q=select+mean(value)+from+%22test%22+where+time+%3E+now()-1h+group+by+time(1s)+order+asc"
;
"+where+time+%3E+now()-1h+group+by+time(1s)+order+asc"
;
var
query
=
{
var
query
=
{
rangeRaw
:
{
from
:
'now-1h'
,
to
:
'now'
},
rangeRaw
:
{
from
:
'now-1h'
,
to
:
'now'
},
targets
:
[{
series
:
'test'
,
column
:
'value'
,
function
:
'mean'
}],
targets
:
[{
series
:
'test'
,
column
:
'value'
,
function
:
'mean'
}],
...
@@ -51,8 +51,7 @@ define([
...
@@ -51,8 +51,7 @@ define([
describe
(
'When querying influxdb with one raw query'
,
function
()
{
describe
(
'When querying influxdb with one raw query'
,
function
()
{
var
results
;
var
results
;
var
urlExpected
=
"/series?p=mupp&q=select+value+from+series"
+
var
urlExpected
=
"/series?p=mupp&q=select+value+from+series+where+time+%3E+now()-1h"
;
"+where+time+%3E+now()-1h"
;
var
query
=
{
var
query
=
{
rangeRaw
:
{
from
:
'now-1h'
,
to
:
'now'
},
rangeRaw
:
{
from
:
'now-1h'
,
to
:
'now'
},
targets
:
[{
query
:
"select value from series where $timeFilter"
,
rawQuery
:
true
}]
targets
:
[{
query
:
"select value from series where $timeFilter"
,
rawQuery
:
true
}]
...
@@ -74,8 +73,7 @@ define([
...
@@ -74,8 +73,7 @@ define([
describe
(
'When issuing annotation query'
,
function
()
{
describe
(
'When issuing annotation query'
,
function
()
{
var
results
;
var
results
;
var
urlExpected
=
"/series?p=mupp&q=select+title+from+events.backend_01"
+
var
urlExpected
=
"/series?p=mupp&q=select+title+from+events.backend_01+where+time+%3E+now()-1h"
;
"+where+time+%3E+now()-1h"
;
var
range
=
{
from
:
'now-1h'
,
to
:
'now'
};
var
range
=
{
from
:
'now-1h'
,
to
:
'now'
};
var
annotation
=
{
query
:
'select title from events.$server where $timeFilter'
};
var
annotation
=
{
query
:
'select title from events.$server where $timeFilter'
};
...
@@ -96,6 +94,4 @@ define([
...
@@ -96,6 +94,4 @@ define([
});
});
});
});
});
public/
test/specs/influxSeries08-specs.j
s
→
public/
app/plugins/datasource/influxdb_08/specs/influx_series_specs.t
s
View file @
8526230b
define
([
///<amd-dependency path="app/plugins/datasource/influxdb_08/influx_series" name="InfluxSeries"/>
'app/plugins/datasource/influxdb_08/influxSeries'
],
function
(
InfluxSeries
)
{
'use strict'
;
describe
(
'when generating timeseries from influxdb response'
,
function
()
{
import
{
describe
,
beforeEach
,
it
,
sinon
,
expect
}
from
'test/lib/common'
;
declare
var
InfluxSeries
:
any
;
describe
(
'when generating timeseries from influxdb response'
,
function
()
{
describe
(
'given two series'
,
function
()
{
describe
(
'given two series'
,
function
()
{
var
series
=
new
InfluxSeries
({
var
series
=
new
InfluxSeries
({
...
@@ -158,9 +159,9 @@ define([
...
@@ -158,9 +159,9 @@ define([
});
});
});
});
describe
(
"when creating annotations from influxdb response"
,
function
()
{
describe
(
"when creating annotations from influxdb response"
,
function
()
{
describe
(
'given column mapping for all columns'
,
function
()
{
describe
(
'given column mapping for all columns'
,
function
()
{
var
series
=
new
InfluxSeries
({
var
series
=
new
InfluxSeries
({
seriesList
:
[
seriesList
:
[
...
@@ -215,6 +216,5 @@ define([
...
@@ -215,6 +216,5 @@ define([
});
});
});
});
});
public/
test/specs/influxQueryBuilder-specs.j
s
→
public/
app/plugins/datasource/influxdb_08/specs/query_builder_specs.t
s
View file @
8526230b
define
([
///<amd-dependency path="app/plugins/datasource/influxdb_08/query_builder" name="InfluxQueryBuilder"/>
'app/plugins/datasource/influxdb_08/queryBuilder'
],
function
(
InfluxQueryBuilder
)
{
'use strict'
;
describe
(
'InfluxQueryBuilder'
,
function
()
{
import
{
describe
,
beforeEach
,
it
,
sinon
,
expect
}
from
'test/lib/common'
;
declare
var
InfluxQueryBuilder
:
any
;
describe
(
'InfluxQueryBuilder'
,
function
()
{
describe
(
'series with conditon and group by'
,
function
()
{
describe
(
'series with conditon and group by'
,
function
()
{
var
builder
=
new
InfluxQueryBuilder
({
var
builder
=
new
InfluxQueryBuilder
({
...
@@ -73,6 +74,5 @@ define([
...
@@ -73,6 +74,5 @@ define([
});
});
});
});
});
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