mirror of
https://github.com/grafana/grafana.git
synced 2025-07-30 16:52:54 +08:00
Alerting: Fix rule instances table (#102290)
Fix the condition for displaying alert instances table in RuleDetails component
This commit is contained in:
@ -34,6 +34,8 @@ export const RuleDetails = ({ rule }: Props) => {
|
||||
} = rule;
|
||||
|
||||
const annotations = useCleanAnnotations(rule.annotations);
|
||||
const isAlertingRule =
|
||||
rulerRuleType.any.alertingRule(rule.rulerRule) || prometheusRuleType.alertingRule(rule.promRule);
|
||||
|
||||
return (
|
||||
<div>
|
||||
@ -53,12 +55,11 @@ export const RuleDetails = ({ rule }: Props) => {
|
||||
<RuleDetailsDataSources rulesSource={rulesSource} rule={rule} />
|
||||
</div>
|
||||
</div>
|
||||
{rulerRuleType.any.alertingRule(rule.rulerRule) ||
|
||||
(prometheusRuleType.alertingRule(rule.promRule) && (
|
||||
<DetailsField label="Instances" horizontal={true}>
|
||||
<RuleDetailsMatchingInstances rule={rule} itemsDisplayLimit={INSTANCES_DISPLAY_LIMIT} />
|
||||
</DetailsField>
|
||||
))}
|
||||
{isAlertingRule && (
|
||||
<DetailsField label="Instances" horizontal={true}>
|
||||
<RuleDetailsMatchingInstances rule={rule} itemsDisplayLimit={INSTANCES_DISPLAY_LIMIT} />
|
||||
</DetailsField>
|
||||
)}
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
Reference in New Issue
Block a user