diff --git a/CHANGELOG.md b/CHANGELOG.md index 090af032f30..f785ad5a0a6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,12 @@ # 1.9.0 (unreleased) +**Fixes** +- [Issue #1087](https://github.com/grafana/grafana/issues/1087). Panel: Fixed IE9 crash due to angular drag drop +- [Issue #1093](https://github.com/grafana/grafana/issues/1093). SingleStatPanel: Fixed position for drilldown link tooltip when dashboard requires scrolling +- [Issue #1095](https://github.com/grafana/grafana/issues/1095). DrilldownLink: template variables in params property was not interpolated + +# 1.9.0-rc1 (2014-11-17) + **UI Improvements* - [Issue #770](https://github.com/grafana/grafana/issues/770). UI: Panel dropdown menu replaced with a new panel menu @@ -14,6 +21,7 @@ - [Issue #951](https://github.com/grafana/grafana/issues/951). SingleStat: New singlestat panel **Misc** +- [Issue #864](https://github.com/grafana/grafana/issues/846). Panel: Share panel feature, get a link to panel with the current time range - [Issue #938](https://github.com/grafana/grafana/issues/938). Panel: Plugin panels now reside outside of app/panels directory - [Issue #952](https://github.com/grafana/grafana/issues/952). Help: Shortcut "?" to open help modal with list of all shortcuts - [Issue #991](https://github.com/grafana/grafana/issues/991). ScriptedDashboard: datasource services are now available in scripted dashboards, you can query datasource for metric keys, generate dashboards, and even save them in a scripted dashboard (see scripted_gen_and_save.js for example) diff --git a/latest.json b/latest.json index 30dd2d3127b..3573579f26f 100644 --- a/latest.json +++ b/latest.json @@ -1,4 +1,4 @@ { - "version": "1.8.1", - "url": "http://grafanarel.s3.amazonaws.com/grafana-1.8.1.tar.gz" + "version": "1.9.0-rc1", + "url": "http://grafanarel.s3.amazonaws.com/grafana-1.9.0-rc1.tar.gz" } diff --git a/package.json b/package.json index 90983011688..a6d7f0c905f 100644 --- a/package.json +++ b/package.json @@ -4,7 +4,7 @@ "company": "Coding Instinct AB" }, "name": "grafana", - "version": "1.9.0", + "version": "1.9.0-rc1", "repository": { "type": "git", "url": "http://github.com/torkelo/grafana.git" diff --git a/src/app/app.js b/src/app/app.js index 267d0081a90..c90c63b37c0 100644 --- a/src/app/app.js +++ b/src/app/app.js @@ -61,7 +61,7 @@ function (angular, $, _, appLevelRequire, config) { var apps_deps = [ 'ngRoute', '$strap.directives', - 'ngDragDrop', + 'ang-drag-drop', 'grafana', 'pasvaz.bindonce' ]; diff --git a/src/app/components/panelmeta.js b/src/app/components/panelmeta.js index 4fd97e9d02d..9b2b2d90104 100644 --- a/src/app/components/panelmeta.js +++ b/src/app/components/panelmeta.js @@ -12,12 +12,12 @@ function () { this.extendedMenu = []; if (options.fullscreen) { - this.addMenuItem('view', 'icon-eye-open', 'toggleFullscreen(false)'); + this.addMenuItem('view', 'icon-eye-open', 'toggleFullscreen(false); dismiss();'); } - this.addMenuItem('edit', 'icon-cog', 'editPanel()'); + this.addMenuItem('edit', 'icon-cog', 'editPanel(); dismiss();'); this.addMenuItem('duplicate', 'icon-copy', 'duplicatePanel()'); - this.addMenuItem('share', 'icon-share', 'sharePanel()'); + this.addMenuItem('share', 'icon-share', 'sharePanel(); dismiss();'); this.addEditorTab('General', 'app/partials/panelgeneral.html'); @@ -25,7 +25,7 @@ function () { this.addEditorTab('Metrics', 'app/partials/metrics.html'); } - this.addExtendedMenuItem('Panel JSON', '', 'editPanelJson()'); + this.addExtendedMenuItem('Panel JSON', '', 'editPanelJson(); dismiss();'); } PanelMeta.prototype.addMenuItem = function(text, icon, click) { diff --git a/src/app/controllers/row.js b/src/app/controllers/row.js index c92155d8d7e..dfd602751fb 100644 --- a/src/app/controllers/row.js +++ b/src/app/controllers/row.js @@ -107,7 +107,7 @@ function (angular, app, _) { var _as = 12 - $scope.dashboard.rowSpan($scope.row); $scope.panel = { - title: 'no title [click here]', + title: 'no title (click here)', error : false, span : _as < defaultSpan && _as > 0 ? _as : defaultSpan, editable: true, diff --git a/src/app/dashboards/scripted.js b/src/app/dashboards/scripted.js index f4a438b7854..8fca0248496 100644 --- a/src/app/dashboards/scripted.js +++ b/src/app/dashboards/scripted.js @@ -22,9 +22,6 @@ var dashboard, timspan; // All url parameters are available via the ARGS object var ARGS; -// Set a default timespan if one isn't specified -timspan = '1d'; - // Intialize a skeleton with nothing but a rows array and service object dashboard = { rows : [], @@ -32,8 +29,12 @@ dashboard = { // Set a title dashboard.title = 'Scripted dash'; + +// set default time +// time can be overriden in the url using from/to parameteres, but this is +// handled automatically in grafana core during dashboard initialization dashboard.time = { - from: "now-" + (ARGS.from || timspan), + from: 'now-6h', to: "now" }; diff --git a/src/app/dashboards/scripted_async.js b/src/app/dashboards/scripted_async.js index 31d23f2dde2..0a50aa44d5e 100644 --- a/src/app/dashboards/scripted_async.js +++ b/src/app/dashboards/scripted_async.js @@ -25,7 +25,7 @@ return function(callback) { var dashboard, timspan; // Set a default timespan if one isn't specified - timspan = '1d'; + timspan = ARGS.from || 'now-1d'; // Intialize a skeleton with nothing but a rows array and service object dashboard = { @@ -36,7 +36,7 @@ return function(callback) { // Set a title dashboard.title = 'Scripted dash'; dashboard.time = { - from: "now-" + (ARGS.from || timspan), + from: timspan, to: "now" }; diff --git a/src/app/dashboards/scripted_templated.js b/src/app/dashboards/scripted_templated.js index 0ca4ea1fde8..9ce145f4606 100644 --- a/src/app/dashboards/scripted_templated.js +++ b/src/app/dashboards/scripted_templated.js @@ -23,7 +23,7 @@ var dashboard, timspan; var ARGS; // Set a default timespan if one isn't specified -timspan = '1d'; +timspan = ARGS.from || 'now-1d'; // Intialize a skeleton with nothing but a rows array and service object dashboard = { @@ -33,7 +33,7 @@ dashboard = { // Set a title dashboard.title = 'Scripted dash'; dashboard.time = { - from: "now-" + (ARGS.from || timspan), + from: timspan, to: "now" }; dashboard.templating = { diff --git a/src/app/directives/graphiteFuncEditor.js b/src/app/directives/graphiteFuncEditor.js index dff8003f54f..2deef5b5246 100644 --- a/src/app/directives/graphiteFuncEditor.js +++ b/src/app/directives/graphiteFuncEditor.js @@ -206,6 +206,7 @@ function (angular, _, $) { if ($target.hasClass('icon-arrow-left')) { $scope.$apply(function() { _.move($scope.functions, $scope.$index, $scope.$index - 1); + $scope.targetChanged(); }); return; } @@ -213,6 +214,7 @@ function (angular, _, $) { if ($target.hasClass('icon-arrow-right')) { $scope.$apply(function() { _.move($scope.functions, $scope.$index, $scope.$index + 1); + $scope.targetChanged(); }); return; } diff --git a/src/app/directives/panelMenu.js b/src/app/directives/panelMenu.js index a4eb3bd210d..4b3970fba39 100644 --- a/src/app/directives/panelMenu.js +++ b/src/app/directives/panelMenu.js @@ -72,7 +72,7 @@ function (angular, $, _) { $link.toggleClass('has-panel-links', showIcon); }); - function dismiss(time) { + function dismiss(time, force) { clearTimeout(timeout); timeout = null; @@ -82,9 +82,11 @@ function (angular, $, _) { } // if hovering or draging pospone close - if ($menu.is(':hover') || $scope.dashboard.$$panelDragging) { - dismiss(2500); - return; + if (force !== true) { + if ($menu.is(':hover') || $scope.dashboard.$$panelDragging) { + dismiss(2200); + return; + } } if (menuScope) { @@ -97,7 +99,12 @@ function (angular, $, _) { } } - var showMenu = function() { + var showMenu = function(e) { + // if menu item is clicked and menu was just removed from dom ignore this event + if (!$.contains(document, e.target)) { + return; + } + if ($menu) { dismiss(); return; @@ -124,6 +131,9 @@ function (angular, $, _) { menuScope = $scope.$new(); menuScope.extendedMenu = getExtendedMenu($scope); + menuScope.dismiss = function() { + dismiss(null, true); + }; $('.panel-menu').remove(); elem.append($menu); @@ -134,7 +144,7 @@ function (angular, $, _) { $(".panel-container").removeClass('panel-highlight'); $panelContainer.toggleClass('panel-highlight'); - dismiss(2500); + dismiss(2200); }; if ($scope.panelMeta.titlePos && $scope.panel.title) { diff --git a/src/app/features/panellinkeditor/linkSrv.js b/src/app/features/panellinkeditor/linkSrv.js index eacdf1d2c35..8d06b22b99d 100644 --- a/src/app/features/panellinkeditor/linkSrv.js +++ b/src/app/features/panellinkeditor/linkSrv.js @@ -29,7 +29,7 @@ function (angular, kbn) { info.href += '&to=' + range.to; if (link.params) { - info.href += "&" + link.params; + info.href += "&" + templateSrv.replace(link.params); } return info; diff --git a/src/app/panels/graph/graph.js b/src/app/panels/graph/graph.js index e0ddfc76402..837196660a6 100755 --- a/src/app/panels/graph/graph.js +++ b/src/app/panels/graph/graph.js @@ -72,10 +72,11 @@ function (angular, $, kbn, moment, _, GraphTooltip) { height = parseInt(height.replace('px', ''), 10); } + height -= 5; // padding height -= scope.panel.title ? 24 : 9; // subtract panel title bar if (scope.panel.legend.show && !scope.panel.legend.rightSide) { - height = height - 21; // subtract one line legend + height = height - 26; // subtract one line legend } elem.css('height', height + 'px'); @@ -114,7 +115,12 @@ function (angular, $, kbn, moment, _, GraphTooltip) { var series = data[i]; var axis = yaxis[series.yaxis - 1]; var formater = kbn.valueFormats[scope.panel.y_formats[series.yaxis - 1]]; - series.updateLegendValues(formater, axis.tickDecimals, axis.scaledDecimals + 2); + + // legend and tooltip gets one more decimal precision + // than graph legend ticks + var tickDecimals = (axis.tickDecimals || -1) + 1; + + series.updateLegendValues(formater, tickDecimals, axis.scaledDecimals + 2); if(!scope.$$phase) { scope.$digest(); } } } diff --git a/src/app/panels/graph/graph.tooltip.js b/src/app/panels/graph/graph.tooltip.js index e0fede2f62d..4c5f727f919 100644 --- a/src/app/panels/graph/graph.tooltip.js +++ b/src/app/panels/graph/graph.tooltip.js @@ -38,18 +38,26 @@ function ($) { }; this.getMultiSeriesPlotHoverInfo = function(seriesList, pos) { - var value, i, series, hoverIndex; + var value, i, series, hoverIndex, seriesTmp; var results = []; - var pointCount = seriesList[0].data.length; - for (i = 1; i < seriesList.length; i++) { - if (seriesList[i].data.length !== pointCount) { + var pointCount; + for (i = 0; i < seriesList.length; i++) { + seriesTmp = seriesList[i]; + if (!seriesTmp.data.length) { continue; } + + if (!pointCount) { + series = seriesTmp; + pointCount = series.data.length; + continue; + } + + if (seriesTmp.data.length !== pointCount) { results.pointCountMismatch = true; return results; } } - series = seriesList[0]; hoverIndex = this.findHoverIndexFromData(pos.x, series); var lasthoverIndex = 0; if(!scope.panel.steppedLine) { @@ -62,6 +70,7 @@ function ($) { for (i = 0; i < seriesList.length; i++) { series = seriesList[i]; + if (!series.data.length) { continue; } if (scope.panel.stack) { if (scope.panel.tooltip.value_type === 'individual') { diff --git a/src/app/panels/graph/module.html b/src/app/panels/graph/module.html index dd9459ab6f9..65fbb00b1f7 100644 --- a/src/app/panels/graph/module.html +++ b/src/app/panels/graph/module.html @@ -4,7 +4,9 @@