diff --git a/docs/sources/tutorials/ha_setup.md b/docs/sources/tutorials/ha_setup.md index 9ae2989f6e6..0f138b20a17 100644 --- a/docs/sources/tutorials/ha_setup.md +++ b/docs/sources/tutorials/ha_setup.md @@ -27,7 +27,7 @@ Grafana will now persist all long term data in the database. How to configure th ## User sessions The second thing to consider is how to deal with user sessions and how to configure your load balancer infront of Grafana. -Grafana support two says of storing session data locally on disk or in a database/cache-server. +Grafana supports two ways of storing session data: locally on disk or in a database/cache-server. If you want to store sessions on disk you can use `sticky sessions` in your load balanacer. If you prefer to store session data in a database/cache-server you can use any stateless routing strategy in your load balancer (ex round robin or least connections). diff --git a/public/app/app.ts b/public/app/app.ts index d9e31018af9..77f56264504 100644 --- a/public/app/app.ts +++ b/public/app/app.ts @@ -105,9 +105,9 @@ export class GrafanaApp { 'react', ]; - const module_types = ['controllers', 'directives', 'factories', 'services', 'filters', 'routes']; + const moduleTypes = ['controllers', 'directives', 'factories', 'services', 'filters', 'routes']; - _.each(module_types, type => { + _.each(moduleTypes, type => { const moduleName = 'grafana.' + type; this.useModule(angular.module(moduleName, [])); }); diff --git a/public/app/core/components/code_editor/code_editor.ts b/public/app/core/components/code_editor/code_editor.ts index 6ae1a99f245..753f7a5a330 100644 --- a/public/app/core/components/code_editor/code_editor.ts +++ b/public/app/core/components/code_editor/code_editor.ts @@ -84,7 +84,7 @@ function link(scope, elem, attrs) { // disable depreacation warning codeEditor.$blockScrolling = Infinity; // Padding hacks - (codeEditor.renderer).setScrollMargin(15, 15); + (codeEditor.renderer as any).setScrollMargin(15, 15); codeEditor.renderer.setPadding(10); setThemeMode(); @@ -152,7 +152,7 @@ function link(scope, elem, attrs) { if (scope.getCompleter()) { // make copy of array as ace seems to share completers array between instances - const anyEditor = codeEditor; + const anyEditor = codeEditor as any; anyEditor.completers = anyEditor.completers.slice(); anyEditor.completers.push(scope.getCompleter()); } diff --git a/public/app/core/config.ts b/public/app/core/config.ts index f522c6340e6..1428dbec74c 100644 --- a/public/app/core/config.ts +++ b/public/app/core/config.ts @@ -11,9 +11,9 @@ export class Settings { datasources: any; panels: any; appSubUrl: string; - window_title_prefix: string; + windowTitlePrefix: string; buildInfo: BuildInfo; - new_panel_title: string; + newPanelTitle: string; bootData: any; externalUserMngLinkUrl: string; externalUserMngLinkName: string; @@ -51,7 +51,7 @@ export class Settings { } } -const bootData = (window).grafanaBootData || { settings: {} }; +const bootData = (window as any).grafanaBootData || { settings: {} }; const options = bootData.settings; options.bootData = bootData; diff --git a/public/app/core/controllers/inspect_ctrl.ts b/public/app/core/controllers/inspect_ctrl.ts index 612b9cac42e..c55a0d50902 100644 --- a/public/app/core/controllers/inspect_ctrl.ts +++ b/public/app/core/controllers/inspect_ctrl.ts @@ -60,7 +60,7 @@ export class InspectCtrl { if (keyValue[1].length > 0) { result.push({ key: keyValue[0], - value: (window).unescape(keyValue[1]), + value: (window as any).unescape(keyValue[1]), }); } } diff --git a/public/app/core/partials.ts b/public/app/core/partials.ts index 8f8fd040b9f..64b0b11b8ca 100644 --- a/public/app/core/partials.ts +++ b/public/app/core/partials.ts @@ -1,4 +1,4 @@ -let templates = (require).context('../', true, /\.html$/); +let templates = (require as any).context('../', true, /\.html$/); templates.keys().forEach(function(key) { templates(key); }); diff --git a/public/app/core/services/analytics.ts b/public/app/core/services/analytics.ts index c3936f45451..a0faf4016fd 100644 --- a/public/app/core/services/analytics.ts +++ b/public/app/core/services/analytics.ts @@ -12,13 +12,13 @@ export class Analytics { dataType: 'script', cache: true, }); - const ga = ((window).ga = - (window).ga || + const ga = ((window as any).ga = + (window as any).ga || function() { (ga.q = ga.q || []).push(arguments); }); ga.l = +new Date(); - ga('create', (config).googleAnalyticsId, 'auto'); + ga('create', (config as any).googleAnalyticsId, 'auto'); ga('set', 'anonymizeIp', true); return ga; } @@ -26,7 +26,7 @@ export class Analytics { init() { this.$rootScope.$on('$viewContentLoaded', () => { const track = { page: this.$location.url() }; - const ga = (window).ga || this.gaInit(); + const ga = (window as any).ga || this.gaInit(); ga('set', track); ga('send', 'pageview'); }); @@ -35,7 +35,7 @@ export class Analytics { /** @ngInject */ function startAnalytics(googleAnalyticsSrv) { - if ((config).googleAnalyticsId) { + if ((config as any).googleAnalyticsId) { googleAnalyticsSrv.init(); } } diff --git a/public/app/core/specs/manage_dashboards.test.ts b/public/app/core/specs/manage_dashboards.test.ts index 4b51e6848d0..5af0ebade02 100644 --- a/public/app/core/specs/manage_dashboards.test.ts +++ b/public/app/core/specs/manage_dashboards.test.ts @@ -562,5 +562,5 @@ function createCtrlWithStubs(searchResponse: any, tags?: any) { }, }; - return new ManageDashboardsCtrl({}, { getNav: () => {} }, searchSrvStub, { isEditor: true }); + return new ManageDashboardsCtrl({}, { getNav: () => {} }, searchSrvStub as SearchSrv, { isEditor: true }); } diff --git a/public/app/core/specs/search.test.ts b/public/app/core/specs/search.test.ts index 3cc789b3cc5..fa60d373e2f 100644 --- a/public/app/core/specs/search.test.ts +++ b/public/app/core/specs/search.test.ts @@ -12,7 +12,7 @@ describe('SearchCtrl', () => { search: (options: any) => {}, getDashboardTags: () => {}, }; - const ctrl = new SearchCtrl({ $on: () => {} }, {}, {}, searchSrvStub); + const ctrl = new SearchCtrl({ $on: () => {} }, {}, {}, searchSrvStub as SearchSrv); describe('Given an empty result', () => { beforeEach(() => { diff --git a/public/app/core/utils/outline.ts b/public/app/core/utils/outline.ts index ebd4258c66b..975dc1c8b2d 100644 --- a/public/app/core/utils/outline.ts +++ b/public/app/core/utils/outline.ts @@ -2,32 +2,32 @@ function outlineFixer() { const d: any = document; - const style_element = d.createElement('STYLE'); - const dom_events = 'addEventListener' in d; + const styleElement = d.createElement('STYLE'); + const domEvents = 'addEventListener' in d; - const add_event_listener = function(type, callback) { + const addEventListener = function(type, callback) { // Basic cross-browser event handling - if (dom_events) { + if (domEvents) { d.addEventListener(type, callback); } else { d.attachEvent('on' + type, callback); } }; - const set_css = function(css_text) { + const setCss = function(cssText) { // Handle setting of