Files
grafana-zabbix/src/datasource/components/QueryEditor/ItemIdQueryEditor.tsx
Sriram c4065fb0f3 config updates (#1800)
* 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>
2024-03-13 15:20:53 +00:00

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>
);
};