The open and composable observability and data visualization platform. Visualize metrics, logs, and traces from multiple sources like Prometheus, Loki, Elasticsearch, InfluxDB, Postgres and many more.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 
grafana/public/app/plugins/datasource/azuremonitor/components/Field.tsx

23 lines
690 B

import React from 'react';
import { EditorField } from '@grafana/experimental';
import { InlineField } from '@grafana/ui';
import { Props as InlineFieldProps } from '@grafana/ui/src/components/Forms/InlineField';
interface Props extends InlineFieldProps {
label: string;
inlineField?: boolean;
labelWidth?: number;
}
const DEFAULT_LABEL_WIDTH = 18;
export const Field = (props: Props) => {
const { labelWidth, inlineField, ...remainingProps } = props;
if (!inlineField) {
return <EditorField width={labelWidth || DEFAULT_LABEL_WIDTH} {...remainingProps} />;
} else {
return <InlineField labelWidth={labelWidth || DEFAULT_LABEL_WIDTH} {...remainingProps} />;
}
};