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

52 lines
1.2 KiB

import React from 'react';
import { PluginState } from '@grafana/data';
import { Badge, BadgeProps } from '@grafana/ui';
interface Props {
state?: PluginState;
className?: string;
}
export const PluginStateInfo = (props: Props) => {
const display = getFeatureStateInfo(props.state);
if (!display) {
return null;
}
return (
<Badge
className={props.className}
color={display.color}
title={display.tooltip}
text={display.text}
icon={display.icon}
/>
);
};
function getFeatureStateInfo(state?: PluginState): BadgeProps | null {
switch (state) {
case PluginState.deprecated:
return {
text: 'Deprecated',
color: 'red',
tooltip: `This feature is deprecated and will be removed in a future release`,
};
case PluginState.alpha:
return {
text: 'Alpha',
color: 'blue',
tooltip: `This feature is experimental and future updates might not be backward compatible`,
};
case PluginState.beta:
return {
text: 'Beta',
color: 'blue',
tooltip: `This feature is close to complete but not fully tested`,
};
default:
return null;
}
}