Commit a02effc3 by Torkel Ödegaard

Merge branch 'master' into develop

parents b79e8b81 965c1f03
# 1.7.0 (unreleased)
**Fixes**
- [Issue #655](https://github.com/grafana/grafana/issues/655). General: Auto refresh not initiated / started after dashboard loading
- [Issue #652](https://github.com/grafana/grafana/issues/652). Timepicker: Entering custom date range impossible when refresh is low (now is constantly reset)
- [Issue #450](https://github.com/grafana/grafana/issues/450). Graph: Tooltip does not disappear sometimes and would get stuck
# 1.7.0-rc1 (2014-08-05) # 1.7.0-rc1 (2014-08-05)
**New features or improvements** **New features or improvements**
......
...@@ -19,9 +19,8 @@ function ($) { ...@@ -19,9 +19,8 @@ function ($) {
$tooltip.addClass('grafana-tooltip'); $tooltip.addClass('grafana-tooltip');
if (!$.contains(document.body, $tooltip[0])) { $("#tooltip").remove();
$tooltip.appendTo(document.body); $tooltip.appendTo(document.body);
}
width = $tooltip.outerWidth(true); width = $tooltip.outerWidth(true);
height = $tooltip.outerHeight(true); height = $tooltip.outerHeight(true);
......
...@@ -42,6 +42,11 @@ function (angular, $, config, _) { ...@@ -42,6 +42,11 @@ function (angular, $, config, _) {
window.document.title = 'Grafana - ' + $scope.dashboard.title; window.document.title = 'Grafana - ' + $scope.dashboard.title;
// start auto refresh
if($scope.dashboard.refresh) {
$scope.dashboard.set_interval($scope.dashboard.refresh);
}
dashboardKeybindings.shortcuts($scope); dashboardKeybindings.shortcuts($scope);
$scope.emitAppEvent("dashboard-loaded", $scope.dashboard); $scope.emitAppEvent("dashboard-loaded", $scope.dashboard);
......
...@@ -327,7 +327,7 @@ function (angular, $, kbn, moment, _) { ...@@ -327,7 +327,7 @@ function (angular, $, kbn, moment, _) {
return "%H:%M"; return "%H:%M";
} }
var $tooltip = $('<div>'); var $tooltip = $('<div id="tooltip">');
elem.bind("plothover", function (event, pos, item) { elem.bind("plothover", function (event, pos, item) {
var group, value, timestamp, seriesInfo, format; var group, value, timestamp, seriesInfo, format;
...@@ -357,11 +357,8 @@ function (angular, $, kbn, moment, _) { ...@@ -357,11 +357,8 @@ function (angular, $, kbn, moment, _) {
timestamp = dashboard.timezone === 'browser' ? timestamp = dashboard.timezone === 'browser' ?
moment(item.datapoint[0]).format('YYYY-MM-DD HH:mm:ss') : moment(item.datapoint[0]).format('YYYY-MM-DD HH:mm:ss') :
moment.utc(item.datapoint[0]).format('YYYY-MM-DD HH:mm:ss'); moment.utc(item.datapoint[0]).format('YYYY-MM-DD HH:mm:ss');
$tooltip
.html( $tooltip.html(group + value + " @ " + timestamp).place_tt(pos.pageX, pos.pageY);
group + value + " @ " + timestamp
)
.place_tt(pos.pageX, pos.pageY);
} else { } else {
$tooltip.detach(); $tooltip.detach();
} }
......
...@@ -49,17 +49,17 @@ ...@@ -49,17 +49,17 @@
<div class="timepicker-to-column"> <div class="timepicker-to-column">
<label class="small">To (<a class="link" ng-class="{'strong':panel.now}" ng-click="setNow();panel.now=true">now</a>)</label> <label class="small">To (<a class="link" ng-class="{'strong':tempnow}" ng-click="setNow();tempnow=true">now</a>)</label>
<div class="fake-input timepicker-input"> <div class="fake-input timepicker-input">
<div ng-hide="panel.now"> <div ng-hide="tempnow">
<input class="timepicker-date" type="text" ng-change="validate(temptime)" ng-model="temptime.to.date" data-date-format="yyyy-mm-dd" required bs-datepicker />@ <input class="timepicker-date" type="text" ng-change="validate(temptime)" ng-model="temptime.to.date" data-date-format="yyyy-mm-dd" required bs-datepicker />@
<input class="timepicker-hms" type="text" maxlength="2" ng-change="validate(temptime)" ng-model="temptime.to.hour" required ng-pattern="patterns.hour" onClick="this.select();"/>: <input class="timepicker-hms" type="text" maxlength="2" ng-change="validate(temptime)" ng-model="temptime.to.hour" required ng-pattern="patterns.hour" onClick="this.select();"/>:
<input class="timepicker-hms" type="text" maxlength="2" ng-change="validate(temptime)" ng-model="temptime.to.minute" required ng-pattern="patterns.minute" onClick="this.select();"/>: <input class="timepicker-hms" type="text" maxlength="2" ng-change="validate(temptime)" ng-model="temptime.to.minute" required ng-pattern="patterns.minute" onClick="this.select();"/>:
<input class="timepicker-hms" type="text" maxlength="2" ng-change="validate(temptime)" ng-model="temptime.to.second" required ng-pattern="patterns.second" onClick="this.select();"/>. <input class="timepicker-hms" type="text" maxlength="2" ng-change="validate(temptime)" ng-model="temptime.to.second" required ng-pattern="patterns.second" onClick="this.select();"/>.
<input class="timepicker-ms" type="text" maxlength="3" ng-change="validate(temptime)" ng-model="temptime.to.millisecond" required ng-pattern="patterns.millisecond" onClick="this.select();"/> <input class="timepicker-ms" type="text" maxlength="3" ng-change="validate(temptime)" ng-model="temptime.to.millisecond" required ng-pattern="patterns.millisecond" onClick="this.select();"/>
</div> </div>
<span type="text" ng-show="panel.now" ng-disabled="panel.now">&nbsp <i class="pointer icon-remove-sign" ng-click="setNow();panel.now=false"></i> Right Now <input type="text" name="dummy" style="visibility:hidden" /></span> <span type="text" ng-show="tempnow" ng-disabled="tempnow">&nbsp <i class="pointer icon-remove-sign" ng-click="setNow();tempnow=false;"></i> Right Now <input type="text" name="dummy" style="visibility:hidden" /></span>
</div> </div>
</div> </div>
......
...@@ -78,6 +78,7 @@ function (angular, app, _, moment, kbn) { ...@@ -78,6 +78,7 @@ function (angular, app, _, moment, kbn) {
// Assume the form is valid since we're setting it to something valid // Assume the form is valid since we're setting it to something valid
$scope.input.$setValidity("dummy", true); $scope.input.$setValidity("dummy", true);
$scope.temptime = cloneTime($scope.time); $scope.temptime = cloneTime($scope.time);
$scope.tempnow = $scope.panel.now;
// Date picker needs the date to be at the start of the day // Date picker needs the date to be at the start of the day
$scope.temptime.from.date.setHours(1,0,0,0); $scope.temptime.from.date.setHours(1,0,0,0);
...@@ -129,7 +130,7 @@ function (angular, app, _, moment, kbn) { ...@@ -129,7 +130,7 @@ function (angular, app, _, moment, kbn) {
// Create filter object // Create filter object
var _filter = _.clone(time); var _filter = _.clone(time);
if($scope.panel.now) { if($scope.tempnow) {
_filter.to = "now"; _filter.to = "now";
} }
......
...@@ -61,6 +61,12 @@ function(angular, $) { ...@@ -61,6 +61,12 @@ function(angular, $) {
if (popups.length > 0) { if (popups.length > 0) {
return; return;
} }
// close modals
var modalData = $(".modal").data();
if (modalData && modalData.$scope && modalData.$scope.dismiss) {
modalData.$scope.dismiss();
}
scope.emitAppEvent('panel-fullscreen-exit'); scope.emitAppEvent('panel-fullscreen-exit');
}, { inputDisabled: true }); }, { inputDisabled: true });
}; };
......
...@@ -28,6 +28,7 @@ function (angular, $, kbn, _) { ...@@ -28,6 +28,7 @@ function (angular, $, kbn, _) {
this.nav = data.nav || []; this.nav = data.nav || [];
this.time = data.time || { from: 'now-6h', to: 'now' }; this.time = data.time || { from: 'now-6h', to: 'now' };
this.templating = data.templating || { list: [] }; this.templating = data.templating || { list: [] };
this.refresh = data.refresh;
if (this.nav.length === 0) { if (this.nav.length === 0) {
this.nav.push({ type: 'timepicker' }); this.nav.push({ type: 'timepicker' });
......
...@@ -611,4 +611,4 @@ ...@@ -611,4 +611,4 @@
if (ao.min < bo.min) return -1; if (ao.min < bo.min) return -1;
return 0; return 0;
}; };
})(jQuery); })(jQuery);
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment