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/PanelAlertTab.tsx

17 lines
640 B

import React, { FC } from 'react';
import { Tab, TabProps } from '@grafana/ui/src/components/Tabs/Tab';
import { DashboardModel, PanelModel } from 'app/features/dashboard/state';
import { usePanelCombinedRules } from './hooks/usePanelCombinedRules';
interface Props extends Omit<TabProps, 'counter' | 'ref'> {
panel: PanelModel;
dashboard: DashboardModel;
}
// it will load rule count from backend
export const PanelAlertTab: FC<Props> = ({ panel, dashboard, ...otherProps }) => {
const { rules, loading } = usePanelCombinedRules({ panel, dashboard });
return <Tab {...otherProps} counter={loading ? null : rules.length} />;
};