UNPKG

@grafana/ui

Version:
46 lines (41 loc) 2.1 kB
'use strict'; Object.defineProperty(exports, '__esModule', { value: true }); var jsxRuntime = require('react/jsx-runtime'); var i18n = require('@grafana/i18n'); var Switch = require('../Switch/Switch.cjs'); var InlineField = require('../Forms/InlineField.cjs'); var Box = require('../Layout/Box/Box.cjs'); var Stack = require('../Layout/Stack/Stack.cjs'); "use strict"; function AlertingSettings({ options, onOptionsChange }) { return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [ /* @__PURE__ */ jsxRuntime.jsx("h3", { className: "page-heading", children: /* @__PURE__ */ jsxRuntime.jsx(i18n.Trans, { i18nKey: "grafana-ui.data-source-settings.alerting-settings-heading", children: "Alerting" }) }), /* @__PURE__ */ jsxRuntime.jsx(Box.Box, { marginBottom: 5, children: /* @__PURE__ */ jsxRuntime.jsx(Stack.Stack, { direction: "row", alignItems: "flex-start", wrap: true, children: /* @__PURE__ */ jsxRuntime.jsx(Box.Box, { marginBottom: 0.5, position: "relative", children: /* @__PURE__ */ jsxRuntime.jsx(Stack.Stack, { direction: "row", alignItems: "flex-start", children: /* @__PURE__ */ jsxRuntime.jsx( InlineField.InlineField, { labelWidth: 29, label: i18n.t( "grafana-ui.data-source-settings.alerting-settings-label", "Manage alert rules in Alerting UI" ), disabled: options.readOnly, tooltip: i18n.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__ */ jsxRuntime.jsx( Switch.InlineSwitch, { value: options.jsonData.manageAlerts !== false, onChange: (event) => onOptionsChange({ ...options, jsonData: { ...options.jsonData, manageAlerts: event.currentTarget.checked } }) } ) } ) }) }) }) }) ] }); } exports.AlertingSettings = AlertingSettings; //# sourceMappingURL=AlertingSettings.cjs.map