import * as React from 'react';
import { ConfigDescriptionLink, ConfigSubSection } from '@grafana/plugin-ui';
import { config } from '@grafana/runtime';
import { Badge, InlineField, InlineFieldRow, Input } from '@grafana/ui';
type Props = {
maxLines: string;
onMaxLinedChange: (value: string) => void;
predefinedOperations: string;
onPredefinedOperationsChange: (value: string) => void;
};
export const QuerySettings = (props: Props) => {
const { maxLines, onMaxLinedChange, predefinedOperations, onPredefinedOperationsChange } = props;
return (
}
>
Loki queries must contain a limit of the maximum number of lines returned (default: 1000). Increase this
limit to have a bigger result set for ad-hoc analysis. Decrease this limit if your browser becomes sluggish
when displaying the log results.
>
}
>
) => onMaxLinedChange(event.currentTarget.value)}
width={16}
placeholder="1000"
spellCheck={false}
/>
{config.featureToggles.lokiPredefinedOperations && (
{
'Predefined operations are used as an initial state for your queries. They are useful, if you want to unpack, parse or format all log lines. Currently we support only log operations starting with |. For example: | unpack | line_format "{{.message}}".'
}
>
}
>
) =>
onPredefinedOperationsChange(event.currentTarget.value)
}
width={40}
placeholder="| unpack | line_format"
spellCheck={false}
/>
)}
);
};