chore: bump @grafana/create-plugin configuration to 5.26.4 (#2082)
Bumps [`@grafana/create-plugin`](https://github.com/grafana/plugin-tools/tree/main/packages/create-plugin) configuration from 4.2.1 to 5.26.4. **Notes for reviewer:** This is an auto-generated PR which ran `@grafana/create-plugin update`. Please consult the create-plugin [CHANGELOG.md](https://github.com/grafana/plugin-tools/blob/main/packages/create-plugin/CHANGELOG.md) to understand what may have changed. Please review the changes thoroughly before merging. --------- Co-authored-by: grafana-plugins-platform-bot[bot] <144369747+grafana-plugins-platform-bot[bot]@users.noreply.github.com> Co-authored-by: Zoltán Bedi <zoltan.bedi@gmail.com>
This commit is contained in:
committed by
GitHub
parent
e76741b453
commit
b13d567eee
@@ -1,5 +1,5 @@
|
||||
import { css } from '@emotion/css';
|
||||
import React, { useState, FormEvent } from 'react';
|
||||
import React, { useState, FormEvent, ReactNode } from 'react';
|
||||
import { GrafanaTheme2, SelectableValue } from '@grafana/data';
|
||||
import {
|
||||
HorizontalGroup,
|
||||
@@ -71,7 +71,7 @@ export const QueryOptionsEditor = ({ queryType, queryOptions, onChange }: Props)
|
||||
};
|
||||
|
||||
const renderOptions = () => {
|
||||
const elements: JSX.Element[] = [];
|
||||
const elements: ReactNode[] = [];
|
||||
for (const key in queryOptions) {
|
||||
if (queryOptions.hasOwnProperty(key)) {
|
||||
const value = queryOptions[key];
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import { DataFrame, dateTime, Field, FieldType } from '@grafana/data';
|
||||
import _ from 'lodash';
|
||||
import * as utils from './utils';
|
||||
import { DataFrame, Field, FieldType, ArrayVector, dateTime } from '@grafana/data';
|
||||
import { ProblemDTO, ZBXEvent, ZBXProblem, ZBXTrigger } from './types';
|
||||
import { ZabbixMetricsQuery } from './types/query';
|
||||
import { ZBXProblem, ZBXTrigger, ProblemDTO, ZBXEvent } from './types';
|
||||
import * as utils from './utils';
|
||||
|
||||
export function joinTriggersWithProblems(problems: ZBXProblem[], triggers: ZBXTrigger[]): ProblemDTO[] {
|
||||
const problemDTOList: ProblemDTO[] = [];
|
||||
@@ -210,7 +210,7 @@ export function toDataFrame(problems: any[], query: ZabbixMetricsQuery): DataFra
|
||||
const problemsField: Field<any> = {
|
||||
name: 'Problems',
|
||||
type: FieldType.other,
|
||||
values: new ArrayVector(problems),
|
||||
values: problems,
|
||||
config: {
|
||||
custom: {
|
||||
type: 'problems',
|
||||
|
||||
@@ -1,9 +1,4 @@
|
||||
import _ from 'lodash';
|
||||
import TableModel from 'grafana/app/core/table_model';
|
||||
import * as c from './constants';
|
||||
import * as utils from './utils';
|
||||
import {
|
||||
ArrayVector,
|
||||
DataFrame,
|
||||
dataFrameFromJSON,
|
||||
DataFrameJSON,
|
||||
@@ -16,8 +11,12 @@ import {
|
||||
TIME_SERIES_TIME_FIELD_NAME,
|
||||
TIME_SERIES_VALUE_FIELD_NAME,
|
||||
} from '@grafana/data';
|
||||
import { ZabbixMetricsQuery } from './types/query';
|
||||
import TableModel from 'grafana/app/core/table_model';
|
||||
import _ from 'lodash';
|
||||
import * as c from './constants';
|
||||
import { ZBXGroup, ZBXTrigger } from './types';
|
||||
import { ZabbixMetricsQuery } from './types/query';
|
||||
import * as utils from './utils';
|
||||
|
||||
/**
|
||||
* Convert Zabbix API history.get response to Grafana format
|
||||
@@ -113,14 +112,14 @@ export function seriesToDataFrame(
|
||||
config: {
|
||||
custom: {},
|
||||
},
|
||||
values: new ArrayVector<number>(datapoints.map((p) => p[c.DATAPOINT_TS])),
|
||||
values: datapoints.map((p) => p[c.DATAPOINT_TS]),
|
||||
};
|
||||
|
||||
let values: ArrayVector<number> | ArrayVector<string>;
|
||||
let values: number[] | string[];
|
||||
if (fieldType === FieldType.string) {
|
||||
values = new ArrayVector<string>(datapoints.map((p) => p[c.DATAPOINT_VALUE]));
|
||||
values = datapoints.map((p) => p[c.DATAPOINT_VALUE]);
|
||||
} else {
|
||||
values = new ArrayVector<number>(datapoints.map((p) => p[c.DATAPOINT_VALUE]));
|
||||
values = datapoints.map((p) => p[c.DATAPOINT_VALUE]);
|
||||
}
|
||||
|
||||
const valueFiled: Field = {
|
||||
@@ -360,8 +359,8 @@ export function alignFrames(data: MutableDataFrame[]): MutableDataFrame[] {
|
||||
|
||||
timestamps = missingTimestamps.concat(timestamps);
|
||||
values = missingValues.concat(values);
|
||||
timeField.values = new ArrayVector(timestamps);
|
||||
valueField.values = new ArrayVector(values);
|
||||
timeField.values = timestamps;
|
||||
valueField.values = values;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -509,7 +508,7 @@ export function handleSLIResponse(response: any, itservices: any[], target: Zabb
|
||||
config: {
|
||||
custom: {},
|
||||
},
|
||||
values: new ArrayVector<number>(timestamps),
|
||||
values: timestamps,
|
||||
};
|
||||
|
||||
const valueFields: Field[] = [];
|
||||
@@ -535,7 +534,7 @@ export function handleSLIResponse(response: any, itservices: any[], target: Zabb
|
||||
name: service ? service.name : serviceId,
|
||||
type: FieldType.number,
|
||||
config: {},
|
||||
values: new ArrayVector<number>(values[i]),
|
||||
values: values[i],
|
||||
});
|
||||
}
|
||||
|
||||
@@ -568,7 +567,7 @@ export function handleMultiSLIResponse(response: any[], itservices: any[], slas:
|
||||
config: {
|
||||
custom: {},
|
||||
},
|
||||
values: new ArrayVector<number>(timestamps),
|
||||
values: timestamps,
|
||||
};
|
||||
|
||||
const valueFields: Field[] = [];
|
||||
@@ -602,7 +601,7 @@ export function handleMultiSLIResponse(response: any[], itservices: any[], slas:
|
||||
name,
|
||||
type: FieldType.number,
|
||||
config: {},
|
||||
values: new ArrayVector<number>(values[i]),
|
||||
values: values[i],
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -636,7 +635,7 @@ export function handleServiceResponse(response: any, itservices: any[], target:
|
||||
name: service ? service.name : i,
|
||||
type: FieldType.number,
|
||||
config: {},
|
||||
values: new ArrayVector<number>([status]),
|
||||
values: [status],
|
||||
});
|
||||
}
|
||||
|
||||
@@ -646,7 +645,7 @@ export function handleServiceResponse(response: any, itservices: any[], target:
|
||||
config: {
|
||||
custom: {},
|
||||
},
|
||||
values: new ArrayVector<number>([Date.now()]),
|
||||
values: [Date.now()],
|
||||
};
|
||||
|
||||
return new MutableDataFrame({
|
||||
@@ -694,8 +693,8 @@ function handleTriggersResponse(triggers: ZBXTrigger[], groups: ZBXGroup[], time
|
||||
name: `Count ${target.refId}`,
|
||||
refId: target.refId,
|
||||
fields: [
|
||||
{ name: TIME_SERIES_TIME_FIELD_NAME, type: FieldType.time, values: new ArrayVector([timeRange[1] * 1000]) },
|
||||
{ name: TIME_SERIES_VALUE_FIELD_NAME, type: FieldType.number, values: new ArrayVector([triggersCount]) },
|
||||
{ name: TIME_SERIES_TIME_FIELD_NAME, type: FieldType.time, values: [timeRange[1] * 1000] },
|
||||
{ name: TIME_SERIES_VALUE_FIELD_NAME, type: FieldType.number, values: [triggersCount] },
|
||||
],
|
||||
length: 1,
|
||||
});
|
||||
@@ -706,7 +705,7 @@ function handleTriggersResponse(triggers: ZBXTrigger[], groups: ZBXGroup[], time
|
||||
const frame = new MutableDataFrame({
|
||||
name: `Triggers ${target.refId}`,
|
||||
refId: target.refId,
|
||||
fields: [{ name: 'Host group', type: FieldType.string, values: new ArrayVector() }],
|
||||
fields: [{ name: 'Host group', type: FieldType.string, values: [] }],
|
||||
});
|
||||
|
||||
for (let i = c.TRIGGER_SEVERITY.length - 1; i >= 0; i--) {
|
||||
@@ -714,7 +713,7 @@ function handleTriggersResponse(triggers: ZBXTrigger[], groups: ZBXGroup[], time
|
||||
name: c.TRIGGER_SEVERITY[i].text,
|
||||
type: FieldType.number,
|
||||
config: { unit: 'none', decimals: 0 },
|
||||
values: new ArrayVector(),
|
||||
values: [],
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
import {
|
||||
ArrayVector,
|
||||
DataFrame,
|
||||
dataFrameToJSON,
|
||||
Field,
|
||||
@@ -142,14 +141,14 @@ function handleInfluxHistoryResponse(results) {
|
||||
name: TIME_SERIES_TIME_FIELD_NAME,
|
||||
type: FieldType.time,
|
||||
config: {},
|
||||
values: new ArrayVector(tsBuffer),
|
||||
values: tsBuffer,
|
||||
};
|
||||
|
||||
const valueFiled: Field<number | null> = {
|
||||
name: influxSeries?.tags?.itemid,
|
||||
type: FieldType.number,
|
||||
config: {},
|
||||
values: new ArrayVector(valuesBuffer),
|
||||
values: valuesBuffer,
|
||||
};
|
||||
|
||||
frames.push(
|
||||
|
||||
@@ -117,8 +117,8 @@ export class SQLConnector extends DBConnector {
|
||||
},
|
||||
})
|
||||
.then((response) => {
|
||||
const results = response.data.results;
|
||||
if (results['A']) {
|
||||
const results = (response.data as { results?: any }).results;
|
||||
if (results && results['A']) {
|
||||
return results['A'].frames;
|
||||
} else {
|
||||
return null;
|
||||
|
||||
Reference in New Issue
Block a user