diff --git a/src/app/panels/timepicker/module.js b/src/app/panels/timepicker/module.js
index eca4936ad00..2f0d9bd75b8 100644
--- a/src/app/panels/timepicker/module.js
+++ b/src/app/panels/timepicker/module.js
@@ -58,10 +58,14 @@ function (angular, app, _, moment, kbn) {
$scope.init = function() {
var time = timeSrv.timeRange(true);
- if(time) {
- $scope.panel.now = timeSrv.timeRange(false).to === "now" ? true : false;
- $scope.time = getScopeTimeObj(time.from,time.to);
+ $scope.panel.now = false;
+
+ var unparsed = timeSrv.timeRange(false);
+ if (_.isString(unparsed.to) && unparsed.to.indexOf('now') === 0) {
+ $scope.panel.now = true;
}
+
+ $scope.time = getScopeTimeObj(time.from, time.to);
};
$scope.customTime = function() {
@@ -142,6 +146,10 @@ function (angular, app, _, moment, kbn) {
to: "now"
};
+ if ($scope.panel.nowDelay) {
+ _filter.to = 'now-' + $scope.panel.nowDelay;
+ }
+
timeSrv.setTime(_filter);
$scope.time = getScopeTimeObj(kbn.parseDate(_filter.from),new Date());
diff --git a/src/app/partials/dashboard.html b/src/app/partials/dashboard.html
index 5795c6e2c8f..d5118a3ee96 100644
--- a/src/app/partials/dashboard.html
+++ b/src/app/partials/dashboard.html
@@ -104,7 +104,7 @@
-
+
ADD ROW
diff --git a/src/app/partials/dasheditor.html b/src/app/partials/dasheditor.html
index f19c5701c38..fdeb3a4db24 100644
--- a/src/app/partials/dasheditor.html
+++ b/src/app/partials/dasheditor.html
@@ -54,7 +54,7 @@
|
|
-
+
|
diff --git a/src/app/partials/roweditor.html b/src/app/partials/roweditor.html
index e15f765d2af..450d8a01a3e 100644
--- a/src/app/partials/roweditor.html
+++ b/src/app/partials/roweditor.html
@@ -41,7 +41,7 @@
|
|
-
+
|
diff --git a/src/app/partials/templating_editor.html b/src/app/partials/templating_editor.html
index c17d0259b2b..1fd600a5701 100644
--- a/src/app/partials/templating_editor.html
+++ b/src/app/partials/templating_editor.html
@@ -31,7 +31,7 @@
{{variable.query}}
-
+
Edit
@@ -39,7 +39,7 @@
| |
|
-
+
|
diff --git a/src/css/less/graph.less b/src/css/less/graph.less
index 5ad38283689..46263a43988 100644
--- a/src/css/less/graph.less
+++ b/src/css/less/graph.less
@@ -141,7 +141,7 @@
vertical-align: top;
position: relative;
left: 4px;
- top: -20px;
+ top: -25px;
}
.graph-legend {
@@ -260,7 +260,6 @@
transform-origin: right top;
}
-
.axisLabel {
color: @textColor;
font-size: @fontSizeSmall;
@@ -269,3 +268,13 @@
font-size: 12px;
}
+.graph-time-info {
+ font-weight: bold;
+ float: right;
+ margin-right: 15px;
+ color: @blue;
+ font-size: 85%;
+ position: relative;
+ top: -20px;
+}
+
diff --git a/src/css/less/panel.less b/src/css/less/panel.less
index 7a9a8aba4ff..451431b9d76 100644
--- a/src/css/less/panel.less
+++ b/src/css/less/panel.less
@@ -49,8 +49,8 @@
.panel-loading {
position:absolute;
- top: 0px;
- right: 4px;
+ top: -3px;
+ right: 0px;
z-index: 800;
}
diff --git a/src/test/specs/graph-tooltip-specs.js b/src/test/specs/graph-tooltip-specs.js
index b7def74ac89..155469f18a7 100644
--- a/src/test/specs/graph-tooltip-specs.js
+++ b/src/test/specs/graph-tooltip-specs.js
@@ -19,6 +19,7 @@ define([
tooltip: {
shared: true
},
+ legend: { },
stack: false
};
diff --git a/src/test/specs/graphiteDatasource-specs.js b/src/test/specs/graphiteDatasource-specs.js
index e23f0e89d4c..58bc62be7ce 100644
--- a/src/test/specs/graphiteDatasource-specs.js
+++ b/src/test/specs/graphiteDatasource-specs.js
@@ -74,6 +74,13 @@ define([
expect(results[2]).to.be('target=asPercent(series1%2Cseries2)');
});
+ it('should replace target placeholder when nesting query references', function() {
+ var results = ctx.ds.buildGraphiteParams({
+ targets: [{target: 'series1'}, {target: 'sumSeries(#A)'}, {target: 'asPercent(#A,#B)'}]
+ });
+ expect(results[2]).to.be('target=' + encodeURIComponent("asPercent(series1,sumSeries(series1))"));
+ });
+
it('should fix wrong minute interval parameters', function() {
var results = ctx.ds.buildGraphiteParams({
targets: [{target: "summarize(prod.25m.count, '25m', 'sum')" }]
diff --git a/src/test/specs/influxdb-datasource-specs.js b/src/test/specs/influxdb-datasource-specs.js
index f8b545e7db2..028423ac1f4 100644
--- a/src/test/specs/influxdb-datasource-specs.js
+++ b/src/test/specs/influxdb-datasource-specs.js
@@ -17,7 +17,7 @@ define([
describe('When querying influxdb with one target using query editor target spec', function() {
var results;
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 = {
range: { from: 'now-1h', to: 'now' },
targets: [{ series: 'test', column: 'value', function: 'mean' }],
@@ -50,7 +50,7 @@ define([
describe('When querying influxdb with one raw query', function() {
var results;
var urlExpected = "/series?p=mupp&q=select+value+from+series"+
- "+where+time+%3E+now()+-+1h";
+ "+where+time+%3E+now()-1h";
var query = {
range: { from: 'now-1h', to: 'now' },
targets: [{ query: "select value from series where $timeFilter", rawQuery: true }]
@@ -73,7 +73,7 @@ define([
describe('When issuing annotation query', function() {
var results;
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 annotation = { query: 'select title from events.$server where $timeFilter' };
diff --git a/src/test/specs/kbn-format-specs.js b/src/test/specs/kbn-format-specs.js
index 785d9376411..7c75e7eca93 100644
--- a/src/test/specs/kbn-format-specs.js
+++ b/src/test/specs/kbn-format-specs.js
@@ -69,4 +69,15 @@ define([
});
+ describe('relative time to date parsing', function() {
+ it('should handle negative time', function() {
+ var date = kbn.parseDateMath('-2d', new Date(2014,1,5));
+ expect(date.getTime()).to.equal(new Date(2014, 1, 3).getTime());
+ });
+ it('should handle multiple math expressions', function() {
+ var date = kbn.parseDateMath('-2d-6h', new Date(2014, 1, 5));
+ expect(date.toString()).to.equal(new Date(2014, 1, 2, 18).toString());
+ });
+ });
+
});