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/features/alerting/unified/Settings.tsx

49 lines
1.7 KiB

import { LinkButton, Stack, Text } from '@grafana/ui';
import { AlertingPageWrapper } from './components/AlertingPageWrapper';
import { WithReturnButton } from './components/WithReturnButton';
import { useEditConfigurationDrawer } from './components/settings/ConfigurationDrawer';
import { ExternalAlertmanagers } from './components/settings/ExternalAlertmanagers';
import InternalAlertmanager from './components/settings/InternalAlertmanager';
import { SettingsProvider, useSettings } from './components/settings/SettingsContext';
export default function SettingsPage() {
return (
<SettingsProvider>
<SettingsContent />
</SettingsProvider>
);
}
function SettingsContent() {
const [configurationDrawer, showConfiguration] = useEditConfigurationDrawer();
const { isLoading } = useSettings();
return (
<AlertingPageWrapper
navId="alerting-admin"
isLoading={isLoading}
actions={[
<WithReturnButton
key="add-alertmanager"
title="Alerting settings"
component={
<LinkButton href="/connections/datasources/alertmanager" icon="plus" variant="primary">
Add new Alertmanager
</LinkButton>
}
/>,
]}
>
<Stack direction="column" gap={2}>
{/* Grafana built-in Alertmanager */}
<Text variant="h5">Built-in Alertmanager</Text>
<InternalAlertmanager onEditConfiguration={showConfiguration} />
{/* other (external Alertmanager data sources we have added to Grafana such as vanilla, Mimir, Cortex) */}
<Text variant="h5">Other Alertmanagers</Text>
<ExternalAlertmanagers onEditConfiguration={showConfiguration} />
</Stack>
{configurationDrawer}
</AlertingPageWrapper>
);
}