mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
noImplicitAnys: Fix InfluxDB type issues #17937)
This commit is contained in:
committed by
Torkel Ödegaard
parent
de71875e6b
commit
418dba4b21
@@ -7,14 +7,14 @@ export default class InfluxSeries {
|
||||
alias: any;
|
||||
annotation: any;
|
||||
|
||||
constructor(options) {
|
||||
constructor(options: { series: any; alias?: any; annotation?: any }) {
|
||||
this.series = options.series;
|
||||
this.alias = options.alias;
|
||||
this.annotation = options.annotation;
|
||||
}
|
||||
|
||||
getTimeSeries() {
|
||||
const output = [];
|
||||
const output: any[] = [];
|
||||
let i, j;
|
||||
|
||||
if (this.series.length === 0) {
|
||||
@@ -54,11 +54,11 @@ export default class InfluxSeries {
|
||||
return output;
|
||||
}
|
||||
|
||||
_getSeriesName(series, index) {
|
||||
_getSeriesName(series: any, index: number) {
|
||||
const regex = /\$(\w+)|\[\[([\s\S]+?)\]\]/g;
|
||||
const segments = series.name.split('.');
|
||||
|
||||
return this.alias.replace(regex, (match, g1, g2) => {
|
||||
return this.alias.replace(regex, (match: any, g1: any, g2: any) => {
|
||||
const group = g1 || g2;
|
||||
const segIndex = parseInt(group, 10);
|
||||
|
||||
@@ -84,13 +84,13 @@ export default class InfluxSeries {
|
||||
}
|
||||
|
||||
getAnnotations() {
|
||||
const list = [];
|
||||
const list: any[] = [];
|
||||
|
||||
_.each(this.series, series => {
|
||||
let titleCol = null;
|
||||
let timeCol = null;
|
||||
const tagsCol = [];
|
||||
let textCol = null;
|
||||
let titleCol: any = null;
|
||||
let timeCol: any = null;
|
||||
const tagsCol: any = [];
|
||||
let textCol: any = null;
|
||||
|
||||
_.each(series.columns, (column, index) => {
|
||||
if (column === 'time') {
|
||||
@@ -126,10 +126,10 @@ export default class InfluxSeries {
|
||||
// Remove empty values, then split in different tags for comma separated values
|
||||
tags: _.flatten(
|
||||
tagsCol
|
||||
.filter(t => {
|
||||
.filter((t: any) => {
|
||||
return value[t];
|
||||
})
|
||||
.map(t => {
|
||||
.map((t: any) => {
|
||||
return value[t].split(',');
|
||||
})
|
||||
),
|
||||
|
||||
Reference in New Issue
Block a user