mirror of
https://github.com/grafana/grafana.git
synced 2025-02-15 01:53:33 -06:00
* Loki: add additional settings section * Derived fields: add config subsection * Query settings: add config subsection * Loki config: use divider instead of hr * Derived fields: refactor legacy styles * Loki config: add divider between derived fields and query settings * Loki config: create alerting settings for Loki
32 lines
1021 B
TypeScript
32 lines
1021 B
TypeScript
import React from 'react';
|
|
|
|
import { DataSourcePluginOptionsEditorProps } from '@grafana/data';
|
|
import { ConfigSubSection } from '@grafana/experimental';
|
|
import { InlineField, InlineSwitch } from '@grafana/ui';
|
|
|
|
export function AlertingSettings({
|
|
options,
|
|
onOptionsChange,
|
|
}: Pick<DataSourcePluginOptionsEditorProps, 'options' | 'onOptionsChange'>) {
|
|
return (
|
|
<ConfigSubSection title="Alerting">
|
|
<InlineField
|
|
labelWidth={29}
|
|
label="Manage alert rules in Alerting UI"
|
|
disabled={options.readOnly}
|
|
tooltip="Manage alert rules for this data source. To manage other alerting resources, add an Alertmanager data source."
|
|
>
|
|
<InlineSwitch
|
|
value={options.jsonData.manageAlerts !== false}
|
|
onChange={(event) =>
|
|
onOptionsChange({
|
|
...options,
|
|
jsonData: { ...options.jsonData, manageAlerts: event!.currentTarget.checked },
|
|
})
|
|
}
|
|
/>
|
|
</InlineField>
|
|
</ConfigSubSection>
|
|
);
|
|
}
|