* cleanup * update create plugin config and query help fix * query types file * Update docker-compose.yml Co-authored-by: Zoltán Bedi <zoltan.bedi@gmail.com> * addressed review comments --------- Co-authored-by: Zoltán Bedi <zoltan.bedi@gmail.com>
27 lines
792 B
TypeScript
27 lines
792 B
TypeScript
import React, { FormEvent } from 'react';
|
|
import { InlineField, Input } from '@grafana/ui';
|
|
import { ZabbixMetricsQuery } from '../../types/query';
|
|
import { QueryEditorRow } from './QueryEditorRow';
|
|
|
|
export interface Props {
|
|
query: ZabbixMetricsQuery;
|
|
onChange: (query: ZabbixMetricsQuery) => void;
|
|
}
|
|
|
|
export const ItemIdQueryEditor = ({ query, onChange }: Props) => {
|
|
const onItemIdsChange = (v: FormEvent<HTMLInputElement>) => {
|
|
const newValue = v?.currentTarget?.value;
|
|
if (newValue !== null) {
|
|
onChange({ ...query, itemids: newValue });
|
|
}
|
|
};
|
|
|
|
return (
|
|
<QueryEditorRow>
|
|
<InlineField label="Item Ids" labelWidth={12}>
|
|
<Input width={24} defaultValue={query.itemids} onBlur={onItemIdsChange} />
|
|
</InlineField>
|
|
</QueryEditorRow>
|
|
);
|
|
};
|