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)
**New features or improvements**
......
......@@ -19,9 +19,8 @@ function ($) {
$tooltip.addClass('grafana-tooltip');
if (!$.contains(document.body, $tooltip[0])) {
$("#tooltip").remove();
$tooltip.appendTo(document.body);
}
width = $tooltip.outerWidth(true);
height = $tooltip.outerHeight(true);
......
......@@ -42,6 +42,11 @@ function (angular, $, config, _) {
window.document.title = 'Grafana - ' + $scope.dashboard.title;
// start auto refresh
if($scope.dashboard.refresh) {
$scope.dashboard.set_interval($scope.dashboard.refresh);
}
dashboardKeybindings.shortcuts($scope);
$scope.emitAppEvent("dashboard-loaded", $scope.dashboard);
......
......@@ -327,7 +327,7 @@ function (angular, $, kbn, moment, _) {
return "%H:%M";
}
var $tooltip = $('<div>');
var $tooltip = $('<div id="tooltip">');
elem.bind("plothover", function (event, pos, item) {
var group, value, timestamp, seriesInfo, format;
......@@ -357,11 +357,8 @@ function (angular, $, kbn, moment, _) {
timestamp = dashboard.timezone === 'browser' ?
moment(item.datapoint[0]).format('YYYY-MM-DD HH:mm:ss') :
moment.utc(item.datapoint[0]).format('YYYY-MM-DD HH:mm:ss');
$tooltip
.html(
group + value + " @ " + timestamp
)
.place_tt(pos.pageX, pos.pageY);
$tooltip.html(group + value + " @ " + timestamp).place_tt(pos.pageX, pos.pageY);
} else {
$tooltip.detach();
}
......
......@@ -49,17 +49,17 @@
<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 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-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.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();"/>
</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>
......
......@@ -78,6 +78,7 @@ function (angular, app, _, moment, kbn) {
// Assume the form is valid since we're setting it to something valid
$scope.input.$setValidity("dummy", true);
$scope.temptime = cloneTime($scope.time);
$scope.tempnow = $scope.panel.now;
// Date picker needs the date to be at the start of the day
$scope.temptime.from.date.setHours(1,0,0,0);
......@@ -129,7 +130,7 @@ function (angular, app, _, moment, kbn) {
// Create filter object
var _filter = _.clone(time);
if($scope.panel.now) {
if($scope.tempnow) {
_filter.to = "now";
}
......
......@@ -61,6 +61,12 @@ function(angular, $) {
if (popups.length > 0) {
return;
}
// close modals
var modalData = $(".modal").data();
if (modalData && modalData.$scope && modalData.$scope.dismiss) {
modalData.$scope.dismiss();
}
scope.emitAppEvent('panel-fullscreen-exit');
}, { inputDisabled: true });
};
......
......@@ -28,6 +28,7 @@ function (angular, $, kbn, _) {
this.nav = data.nav || [];
this.time = data.time || { from: 'now-6h', to: 'now' };
this.templating = data.templating || { list: [] };
this.refresh = data.refresh;
if (this.nav.length === 0) {
this.nav.push({ type: 'timepicker' });
......
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