@grafana/ui
Version:
Grafana Components Library
42 lines (39 loc) • 1.87 kB
JavaScript
import { jsxs, Fragment, jsx } from 'react/jsx-runtime';
import { Trans, t } from '@grafana/i18n';
import { InlineSwitch } from '../Switch/Switch.mjs';
import { InlineField } from '../Forms/InlineField.mjs';
import { Box } from '../Layout/Box/Box.mjs';
import { Stack } from '../Layout/Stack/Stack.mjs';
"use strict";
function AlertingSettings({ options, onOptionsChange }) {
return /* @__PURE__ */ jsxs(Fragment, { children: [
/* @__PURE__ */ jsx("h3", { className: "page-heading", children: /* @__PURE__ */ jsx(Trans, { i18nKey: "grafana-ui.data-source-settings.alerting-settings-heading", children: "Alerting" }) }),
/* @__PURE__ */ jsx(Box, { marginBottom: 5, children: /* @__PURE__ */ jsx(Stack, { direction: "row", alignItems: "flex-start", wrap: true, children: /* @__PURE__ */ jsx(Box, { marginBottom: 0.5, position: "relative", children: /* @__PURE__ */ jsx(Stack, { direction: "row", alignItems: "flex-start", children: /* @__PURE__ */ jsx(
InlineField,
{
labelWidth: 29,
label: t(
"grafana-ui.data-source-settings.alerting-settings-label",
"Manage alert rules in Alerting UI"
),
disabled: options.readOnly,
tooltip: t(
"grafana-ui.data-source-settings.alerting-settings-tooltip",
"Manage alert rules for this data source. To manage other alerting resources, add an Alertmanager data source."
),
children: /* @__PURE__ */ jsx(
InlineSwitch,
{
value: options.jsonData.manageAlerts !== false,
onChange: (event) => onOptionsChange({
...options,
jsonData: { ...options.jsonData, manageAlerts: event.currentTarget.checked }
})
}
)
}
) }) }) }) })
] });
}
export { AlertingSettings };
//# sourceMappingURL=AlertingSettings.mjs.map