diff --git a/CHANGELOG.md b/CHANGELOG.md index 621d72b4d04..c0833f60e37 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -69,11 +69,11 @@ * **OAuth**: Verify TLS during OAuth callback [#9373](https://github.com/grafana/grafana/issues/9373), thx [@mattbostock](https://github.com/mattbostock) ## Minor -* **SMTP**: Make it possible to set specific EHLO for smtp client. [#9319](https://github.com/grafana/grafana/issues/9319) -* **Dataproxy**: Allow grafan to renegotiate tls connection [#9250](https://github.com/grafana/grafana/issues/9250) +* **SMTP**: Make it possible to set specific HELO for smtp client. [#9319](https://github.com/grafana/grafana/issues/9319) +* **Dataproxy**: Allow grafana to renegotiate tls connection [#9250](https://github.com/grafana/grafana/issues/9250) * **HTTP**: set net.Dialer.DualStack to true for all http clients [#9367](https://github.com/grafana/grafana/pull/9367) * **Alerting**: Add diff and percent diff as series reducers [#9386](https://github.com/grafana/grafana/pull/9386), thx [@shanhuhai5739](https://github.com/shanhuhai5739) -* **Slack**: Allow images to be uploaded to slack when Token is precent [#7175](https://github.com/grafana/grafana/issues/7175), thx [@xginn8](https://github.com/xginn8) +* **Slack**: Allow images to be uploaded to slack when Token is present [#7175](https://github.com/grafana/grafana/issues/7175), thx [@xginn8](https://github.com/xginn8) * **Opsgenie**: Use their latest API instead of old version [#9399](https://github.com/grafana/grafana/pull/9399), thx [@cglrkn](https://github.com/cglrkn) * **Table**: Add support for displaying the timestamp with milliseconds [#9429](https://github.com/grafana/grafana/pull/9429), thx [@s1061123](https://github.com/s1061123) * **Hipchat**: Add metrics, message and image to hipchat notifications [#9110](https://github.com/grafana/grafana/issues/9110), thx [@eloo](https://github.com/eloo) diff --git a/docs/sources/alerting/rules.md b/docs/sources/alerting/rules.md index ead457066e3..bd5b95da856 100644 --- a/docs/sources/alerting/rules.md +++ b/docs/sources/alerting/rules.md @@ -27,8 +27,7 @@ and the conditions that need to be met for the alert to change state and trigger ## Execution The alert rules are evaluated in the Grafana backend in a scheduler and query execution engine that is part -of core Grafana. Only some data sources are supported right now. They include `Graphite`, `Prometheus`, -`InfluxDB` and `OpenTSDB`. +of core Grafana. Only some data sources are supported right now. They include `Graphite`, `Prometheus`, `InfluxDB`, `OpenTSDB`, `MySQL`, `Postgres` and `Cloudwatch`. ### Clustering diff --git a/docs/sources/features/datasources/cloudwatch.md b/docs/sources/features/datasources/cloudwatch.md index 1d98b2d16d1..bdf661dc4fc 100644 --- a/docs/sources/features/datasources/cloudwatch.md +++ b/docs/sources/features/datasources/cloudwatch.md @@ -169,5 +169,3 @@ Amazon provides 1 million CloudWatch API requests each month at no additional ch it costs $0.01 per 1,000 GetMetricStatistics or ListMetrics requests. For each query Grafana will issue a GetMetricStatistics request and every time you pick a dimension in the query editor Grafana will issue a ListMetrics request. - - diff --git a/public/app/core/controllers/inspect_ctrl.js b/public/app/core/controllers/inspect_ctrl.ts similarity index 65% rename from public/app/core/controllers/inspect_ctrl.js rename to public/app/core/controllers/inspect_ctrl.ts index 39d550658f1..70516986099 100644 --- a/public/app/core/controllers/inspect_ctrl.js +++ b/public/app/core/controllers/inspect_ctrl.ts @@ -1,27 +1,14 @@ -define([ - 'angular', - 'lodash', - 'jquery', - '../core_module', -], -function (angular, _, $, coreModule) { - 'use strict'; +import angular from 'angular'; +import _ from 'lodash'; +import $ from 'jquery'; +import coreModule from '../core_module'; - coreModule.default.controller('InspectCtrl', function($scope, $sanitize) { +export class InspectCtrl { + + /** @ngInject */ + constructor($scope, $sanitize) { var model = $scope.inspector; - function getParametersFromQueryString(queryString) { - var result = []; - var parameters = queryString.split("&"); - for (var i = 0; i < parameters.length; i++) { - var keyValue = parameters[i].split("="); - if (keyValue[1].length > 0) { - result.push({ key: keyValue[0], value: window.unescape(keyValue[1]) }); - } - } - return result; - } - $scope.init = function () { $scope.editor = { index: 0 }; @@ -57,7 +44,7 @@ function (angular, _, $, coreModule) { $scope.editor.index = 2; if (_.isString(model.error.config.data)) { - $scope.request_parameters = getParametersFromQueryString(model.error.config.data); + $scope.request_parameters = this.getParametersFromQueryString(model.error.config.data); } else { $scope.request_parameters = _.map(model.error.config.data, function(value, key) { return {key: key, value: angular.toJson(value, true)}; @@ -65,7 +52,18 @@ function (angular, _, $, coreModule) { } } }; + } + getParametersFromQueryString(queryString) { + var result = []; + var parameters = queryString.split("&"); + for (var i = 0; i < parameters.length; i++) { + var keyValue = parameters[i].split("="); + if (keyValue[1].length > 0) { + result.push({ key: keyValue[0], value: (window).unescape(keyValue[1]) }); + } + } + return result; + } +} - }); - -}); +coreModule.controller('InspectCtrl', InspectCtrl); diff --git a/public/app/core/routes/dashboard_loaders.js b/public/app/core/routes/dashboard_loaders.ts similarity index 69% rename from public/app/core/routes/dashboard_loaders.js rename to public/app/core/routes/dashboard_loaders.ts index 728b7e0092f..14e093d5169 100644 --- a/public/app/core/routes/dashboard_loaders.js +++ b/public/app/core/routes/dashboard_loaders.ts @@ -1,10 +1,9 @@ -define([ - '../core_module', -], -function (coreModule) { - "use strict"; +import coreModule from '../core_module'; - coreModule.default.controller('LoadDashboardCtrl', function($scope, $routeParams, dashboardLoaderSrv, backendSrv, $location) { +export class LoadDashboardCtrl { + + /** @ngInject */ + constructor($scope, $routeParams, dashboardLoaderSrv, backendSrv, $location) { $scope.appEvent("dashboard-fetch-start"); if (!$routeParams.slug) { @@ -23,10 +22,13 @@ function (coreModule) { dashboardLoaderSrv.loadDashboard($routeParams.type, $routeParams.slug).then(function(result) { $scope.initDashboard(result, $scope); }); + } +} - }); +export class NewDashboardCtrl { - coreModule.default.controller('NewDashboardCtrl', function($scope) { + /** @ngInject */ + constructor($scope) { $scope.initDashboard({ meta: { canStar: false, canShare: false, isNew: true }, dashboard: { @@ -35,12 +37,14 @@ function (coreModule) { { title: 'Dashboard Row', height: '250px', - panels:[], + panels: [], isNew: true, } ] }, }, $scope); - }); + } +} -}); +coreModule.controller('LoadDashboardCtrl', LoadDashboardCtrl); +coreModule.controller('NewDashboardCtrl', NewDashboardCtrl); diff --git a/public/app/core/services/analytics.js b/public/app/core/services/analytics.js deleted file mode 100644 index 9f71045b008..00000000000 --- a/public/app/core/services/analytics.js +++ /dev/null @@ -1,41 +0,0 @@ -define([ - 'angular', - 'jquery', - 'app/core/core_module', - 'app/core/config', -], -function(angular, $, coreModule, config) { - 'use strict'; - - config = config.default; - - coreModule.default.service('googleAnalyticsSrv', function($rootScope, $location) { - - function gaInit() { - $.getScript('https://www.google-analytics.com/analytics.js'); // jQuery shortcut - var ga = window.ga = window.ga || function () { (ga.q = ga.q || []).push(arguments); }; ga.l = +new Date; - ga('create', config.googleAnalyticsId, 'auto'); - return ga; - } - - this.init = function() { - - $rootScope.$on('$viewContentLoaded', function() { - var track = { page: $location.url() }; - - var ga = window.ga || gaInit(); - - ga('set', track); - ga('send', 'pageview'); - }); - - }; - - }).run(function(googleAnalyticsSrv) { - - if (config.googleAnalyticsId) { - googleAnalyticsSrv.init(); - } - - }); -}); diff --git a/public/app/core/services/analytics.ts b/public/app/core/services/analytics.ts new file mode 100644 index 00000000000..87e84efa706 --- /dev/null +++ b/public/app/core/services/analytics.ts @@ -0,0 +1,36 @@ +import $ from 'jquery'; +import coreModule from 'app/core/core_module'; +import config from 'app/core/config'; + +export class Analytics { + + /** @ngInject */ + constructor(private $rootScope, private $location) { + } + + gaInit() { + $.getScript('https://www.google-analytics.com/analytics.js'); // jQuery shortcut + var ga = (window).ga = (window).ga || function () { (ga.q = ga.q || []).push(arguments); }; ga.l = +new Date; + ga('create', (config).googleAnalyticsId, 'auto'); + return ga; + } + + init() { + this.$rootScope.$on('$viewContentLoaded', () => { + var track = { page: this.$location.url() }; + var ga = (window).ga || this.gaInit(); + ga('set', track); + ga('send', 'pageview'); + }); + } +} + +/** @ngInject */ +function startAnalytics(googleAnalyticsSrv) { + if ((config).googleAnalyticsId) { + googleAnalyticsSrv.init(); + } +} + +coreModule.service('googleAnalyticsSrv', Analytics).run(startAnalytics); + diff --git a/public/app/core/services/timer.ts b/public/app/core/services/timer.ts index 191ea63af83..6356e1f2910 100644 --- a/public/app/core/services/timer.ts +++ b/public/app/core/services/timer.ts @@ -6,7 +6,7 @@ import coreModule from 'app/core/core_module'; export class Timer { timers = []; - /** @ngInject */ + /** @ngInject */ constructor(private $timeout) { }