Skip to content

Commit de917df

Browse files
committed
Merge branch 'master' into postgres-query-builder
2 parents 265d5da + f8c2b23 commit de917df

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

55 files changed

+326
-315
lines changed

docs/sources/tutorials/ha_setup.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ Grafana will now persist all long term data in the database. How to configure th
2727
## User sessions
2828

2929
The second thing to consider is how to deal with user sessions and how to configure your load balancer infront of Grafana.
30-
Grafana support two says of storing session data locally on disk or in a database/cache-server.
30+
Grafana supports two ways of storing session data: locally on disk or in a database/cache-server.
3131
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
3232
you can use any stateless routing strategy in your load balancer (ex round robin or least connections).
3333

public/app/app.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -105,9 +105,9 @@ export class GrafanaApp {
105105
'react',
106106
];
107107

108-
const module_types = ['controllers', 'directives', 'factories', 'services', 'filters', 'routes'];
108+
const moduleTypes = ['controllers', 'directives', 'factories', 'services', 'filters', 'routes'];
109109

110-
_.each(module_types, type => {
110+
_.each(moduleTypes, type => {
111111
const moduleName = 'grafana.' + type;
112112
this.useModule(angular.module(moduleName, []));
113113
});

public/app/core/components/code_editor/code_editor.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ function link(scope, elem, attrs) {
8484
// disable depreacation warning
8585
codeEditor.$blockScrolling = Infinity;
8686
// Padding hacks
87-
(<any>codeEditor.renderer).setScrollMargin(15, 15);
87+
(codeEditor.renderer as any).setScrollMargin(15, 15);
8888
codeEditor.renderer.setPadding(10);
8989

9090
setThemeMode();
@@ -152,7 +152,7 @@ function link(scope, elem, attrs) {
152152

153153
if (scope.getCompleter()) {
154154
// make copy of array as ace seems to share completers array between instances
155-
const anyEditor = <any>codeEditor;
155+
const anyEditor = codeEditor as any;
156156
anyEditor.completers = anyEditor.completers.slice();
157157
anyEditor.completers.push(scope.getCompleter());
158158
}

public/app/core/config.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@ export class Settings {
1111
datasources: any;
1212
panels: any;
1313
appSubUrl: string;
14-
window_title_prefix: string;
14+
windowTitlePrefix: string;
1515
buildInfo: BuildInfo;
16-
new_panel_title: string;
16+
newPanelTitle: string;
1717
bootData: any;
1818
externalUserMngLinkUrl: string;
1919
externalUserMngLinkName: string;
@@ -51,7 +51,7 @@ export class Settings {
5151
}
5252
}
5353

54-
const bootData = (<any>window).grafanaBootData || { settings: {} };
54+
const bootData = (window as any).grafanaBootData || { settings: {} };
5555
const options = bootData.settings;
5656
options.bootData = bootData;
5757

public/app/core/controllers/inspect_ctrl.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ export class InspectCtrl {
6060
if (keyValue[1].length > 0) {
6161
result.push({
6262
key: keyValue[0],
63-
value: (<any>window).unescape(keyValue[1]),
63+
value: (window as any).unescape(keyValue[1]),
6464
});
6565
}
6666
}

public/app/core/partials.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
let templates = (<any>require).context('../', true, /\.html$/);
1+
let templates = (require as any).context('../', true, /\.html$/);
22
templates.keys().forEach(function(key) {
33
templates(key);
44
});

public/app/core/services/analytics.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,21 +12,21 @@ export class Analytics {
1212
dataType: 'script',
1313
cache: true,
1414
});
15-
const ga = ((<any>window).ga =
16-
(<any>window).ga ||
15+
const ga = ((window as any).ga =
16+
(window as any).ga ||
1717
function() {
1818
(ga.q = ga.q || []).push(arguments);
1919
});
2020
ga.l = +new Date();
21-
ga('create', (<any>config).googleAnalyticsId, 'auto');
21+
ga('create', (config as any).googleAnalyticsId, 'auto');
2222
ga('set', 'anonymizeIp', true);
2323
return ga;
2424
}
2525

2626
init() {
2727
this.$rootScope.$on('$viewContentLoaded', () => {
2828
const track = { page: this.$location.url() };
29-
const ga = (<any>window).ga || this.gaInit();
29+
const ga = (window as any).ga || this.gaInit();
3030
ga('set', track);
3131
ga('send', 'pageview');
3232
});
@@ -35,7 +35,7 @@ export class Analytics {
3535

3636
/** @ngInject */
3737
function startAnalytics(googleAnalyticsSrv) {
38-
if ((<any>config).googleAnalyticsId) {
38+
if ((config as any).googleAnalyticsId) {
3939
googleAnalyticsSrv.init();
4040
}
4141
}

public/app/core/specs/manage_dashboards.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -562,5 +562,5 @@ function createCtrlWithStubs(searchResponse: any, tags?: any) {
562562
},
563563
};
564564

565-
return new ManageDashboardsCtrl({}, { getNav: () => {} }, <SearchSrv>searchSrvStub, { isEditor: true });
565+
return new ManageDashboardsCtrl({}, { getNav: () => {} }, searchSrvStub as SearchSrv, { isEditor: true });
566566
}

public/app/core/specs/search.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ describe('SearchCtrl', () => {
1212
search: (options: any) => {},
1313
getDashboardTags: () => {},
1414
};
15-
const ctrl = new SearchCtrl({ $on: () => {} }, {}, {}, <SearchSrv>searchSrvStub);
15+
const ctrl = new SearchCtrl({ $on: () => {} }, {}, {}, searchSrvStub as SearchSrv);
1616

1717
describe('Given an empty result', () => {
1818
beforeEach(() => {

public/app/core/utils/outline.ts

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,32 +2,32 @@
22
function outlineFixer() {
33
const d: any = document;
44

5-
const style_element = d.createElement('STYLE');
6-
const dom_events = 'addEventListener' in d;
5+
const styleElement = d.createElement('STYLE');
6+
const domEvents = 'addEventListener' in d;
77

8-
const add_event_listener = function(type, callback) {
8+
const addEventListener = function(type, callback) {
99
// Basic cross-browser event handling
10-
if (dom_events) {
10+
if (domEvents) {
1111
d.addEventListener(type, callback);
1212
} else {
1313
d.attachEvent('on' + type, callback);
1414
}
1515
};
1616

17-
const set_css = function(css_text) {
17+
const setCss = function(cssText) {
1818
// Handle setting of <style> element contents in IE8
19-
!!style_element.styleSheet ? (style_element.styleSheet.cssText = css_text) : (style_element.innerHTML = css_text);
19+
!!styleElement.styleSheet ? (styleElement.styleSheet.cssText = cssText) : (styleElement.innerHTML = cssText);
2020
};
2121

22-
d.getElementsByTagName('HEAD')[0].appendChild(style_element);
22+
d.getElementsByTagName('HEAD')[0].appendChild(styleElement);
2323

2424
// Using mousedown instead of mouseover, so that previously focused elements don't lose focus ring on mouse move
25-
add_event_listener('mousedown', function() {
26-
set_css(':focus{outline:0 !important}::-moz-focus-inner{border:0;}');
25+
addEventListener('mousedown', function() {
26+
setCss(':focus{outline:0 !important}::-moz-focus-inner{border:0;}');
2727
});
2828

29-
add_event_listener('keydown', function() {
30-
set_css('');
29+
addEventListener('keydown', function() {
30+
setCss('');
3131
});
3232
}
3333

public/app/core/utils/ticks.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@ export function tickStep(start: number, stop: number, count: number): number {
2626
return stop < start ? -step1 : step1;
2727
}
2828

29-
export function getScaledDecimals(decimals, tick_size) {
30-
return decimals - Math.floor(Math.log(tick_size) / Math.LN10);
29+
export function getScaledDecimals(decimals, tickSize) {
30+
return decimals - Math.floor(Math.log(tickSize) / Math.LN10);
3131
}
3232

3333
/**
@@ -201,10 +201,10 @@ export function getPrecision(num: number): number {
201201
* Get decimal precision of number stored as a string ("3.14" => 2)
202202
*/
203203
export function getStringPrecision(num: string): number {
204-
const dot_index = num.indexOf('.');
205-
if (dot_index === -1) {
204+
const dotIndex = num.indexOf('.');
205+
if (dotIndex === -1) {
206206
return 0;
207207
} else {
208-
return num.length - dot_index - 1;
208+
return num.length - dotIndex - 1;
209209
}
210210
}

public/app/core/utils/version.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,6 @@ export class SemVersion {
2929
}
3030

3131
export function isVersionGtOrEq(a: string, b: string): boolean {
32-
const a_semver = new SemVersion(a);
33-
return a_semver.isGtOrEq(b);
32+
const aSemver = new SemVersion(a);
33+
return aSemver.isGtOrEq(b);
3434
}

public/app/features/annotations/events_processing.ts

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -14,33 +14,33 @@ export function makeRegions(annotations, options) {
1414
}
1515

1616
function getRegions(events, range) {
17-
const region_events = _.filter(events, event => {
17+
const regionEvents = _.filter(events, event => {
1818
return event.regionId;
1919
});
20-
let regions = _.groupBy(region_events, 'regionId');
20+
let regions = _.groupBy(regionEvents, 'regionId');
2121
regions = _.compact(
22-
_.map(regions, region_events => {
23-
const region_obj = _.head(region_events);
24-
if (region_events && region_events.length > 1) {
25-
region_obj.timeEnd = region_events[1].time;
26-
region_obj.isRegion = true;
27-
return region_obj;
22+
_.map(regions, regionEvents => {
23+
const regionObj = _.head(regionEvents);
24+
if (regionEvents && regionEvents.length > 1) {
25+
regionObj.timeEnd = regionEvents[1].time;
26+
regionObj.isRegion = true;
27+
return regionObj;
2828
} else {
29-
if (region_events && region_events.length) {
29+
if (regionEvents && regionEvents.length) {
3030
// Don't change proper region object
31-
if (!region_obj.time || !region_obj.timeEnd) {
31+
if (!regionObj.time || !regionObj.timeEnd) {
3232
// This is cut region
33-
if (isStartOfRegion(region_obj)) {
34-
region_obj.timeEnd = range.to.valueOf() - 1;
33+
if (isStartOfRegion(regionObj)) {
34+
regionObj.timeEnd = range.to.valueOf() - 1;
3535
} else {
3636
// Start time = null
37-
region_obj.timeEnd = region_obj.time;
38-
region_obj.time = range.from.valueOf() + 1;
37+
regionObj.timeEnd = regionObj.time;
38+
regionObj.time = range.from.valueOf() + 1;
3939
}
40-
region_obj.isRegion = true;
40+
regionObj.isRegion = true;
4141
}
4242

43-
return region_obj;
43+
return regionObj;
4444
}
4545
}
4646
})

public/app/features/dashboard/dashboard_ctrl.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ export class DashboardCtrl implements PanelContainer {
102102
}
103103

104104
setWindowTitleAndTheme() {
105-
window.document.title = config.window_title_prefix + this.dashboard.title;
105+
window.document.title = config.windowTitlePrefix + this.dashboard.title;
106106
}
107107

108108
showJsonEditor(evt, options) {

public/app/features/dashboard/dashboard_loader_srv.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ export class DashboardLoaderSrv {
106106
};
107107

108108
/*jshint -W054 */
109-
const script_func = new Function(
109+
const scriptFunc = new Function(
110110
'ARGS',
111111
'kbn',
112112
'dateMath',
@@ -119,20 +119,20 @@ export class DashboardLoaderSrv {
119119
'services',
120120
result.data
121121
);
122-
const script_result = script_func(this.$routeParams, kbn, dateMath, _, moment, window, document, $, $, services);
122+
const scriptResult = scriptFunc(this.$routeParams, kbn, dateMath, _, moment, window, document, $, $, services);
123123

124124
// Handle async dashboard scripts
125-
if (_.isFunction(script_result)) {
125+
if (_.isFunction(scriptResult)) {
126126
const deferred = this.$q.defer();
127-
script_result(dashboard => {
127+
scriptResult(dashboard => {
128128
this.$timeout(() => {
129129
deferred.resolve({ data: dashboard });
130130
});
131131
});
132132
return deferred.promise;
133133
}
134134

135-
return { data: script_result };
135+
return { data: scriptResult };
136136
}
137137
}
138138

public/app/features/dashboard/shareModalCtrl.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -94,11 +94,11 @@ export function ShareModalCtrl($scope, $rootScope, $location, $timeout, timeSrv,
9494
const utcOffset = '&tz=UTC' + encodeURIComponent(moment().format('Z'));
9595

9696
// Older browser does not the internationalization API
97-
if (!(<any>window).Intl) {
97+
if (!(window as any).Intl) {
9898
return utcOffset;
9999
}
100100

101-
const dateFormat = (<any>window).Intl.DateTimeFormat();
101+
const dateFormat = (window as any).Intl.DateTimeFormat();
102102
if (!dateFormat.resolvedOptions) {
103103
return utcOffset;
104104
}

0 commit comments

Comments
 (0)