MaxLinesField.tsx 999 B

12345678910111213141516171819202122232425262728293031323334353637
  1. import React from 'react';
  2. import { LegacyForms } from '@grafana/ui';
  3. const { FormField } = LegacyForms;
  4. type Props = {
  5. value: string;
  6. onChange: (value: string) => void;
  7. };
  8. export const MaxLinesField = (props: Props) => {
  9. const { value, onChange } = props;
  10. return (
  11. <FormField
  12. label="Maximum lines"
  13. labelWidth={11}
  14. inputWidth={20}
  15. inputEl={
  16. <input
  17. type="number"
  18. className="gf-form-input width-8 gf-form-input--has-help-icon"
  19. value={value}
  20. onChange={(event) => onChange(event.currentTarget.value)}
  21. spellCheck={false}
  22. placeholder="1000"
  23. />
  24. }
  25. tooltip={
  26. <>
  27. Loki queries must contain a limit of the maximum number of lines returned (default: 1000). Increase this limit
  28. to have a bigger result set for ad-hoc analysis. Decrease this limit if your browser becomes sluggish when
  29. displaying the log results.
  30. </>
  31. }
  32. />
  33. );
  34. };