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/components/Provisioning.tsx

31 lines
1.0 KiB

import { ComponentPropsWithoutRef } from 'react';
import { Alert, Badge } from '@grafana/ui';
export enum ProvisionedResource {
ContactPoint = 'contact point',
Template = 'template',
MuteTiming = 'mute timing',
AlertRule = 'alert rule',
RootNotificationPolicy = 'root notification policy',
}
// we'll omit the props we don't want consumers to overwrite and forward the others to the alert component
type ExtraAlertProps = Omit<ComponentPropsWithoutRef<typeof Alert>, 'title' | 'severity'>;
interface ProvisioningAlertProps extends ExtraAlertProps {
resource: ProvisionedResource;
}
export const ProvisioningAlert = ({ resource, ...rest }: ProvisioningAlertProps) => {
return (
<Alert title={`This ${resource} cannot be edited through the UI`} severity="info" {...rest}>
This {resource} has been provisioned, that means it was created by config. Please contact your server admin to
update this {resource}.
</Alert>
);
};
export const ProvisioningBadge = () => {
return <Badge text={'Provisioned'} color={'purple'} />;
};