Show group interval in Rules display (#12943)

* Show group interval in Rules display

Signed-off-by: Danny Kopping <danny.kopping@grafana.com>

* Humanise interval

Signed-off-by: Danny Kopping <danny.kopping@grafana.com>

---------

Signed-off-by: Danny Kopping <danny.kopping@grafana.com>
This commit is contained in:
Danny Kopping 2023-10-08 13:51:24 +01:00 committed by GitHub
parent a5a4eab679
commit d3554d8421
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -13,6 +13,7 @@ interface RulesContentProps {
interface RuleGroup { interface RuleGroup {
name: string; name: string;
file: string; file: string;
interval: string;
rules: Rule[]; rules: Rule[];
evaluationTime: string; evaluationTime: string;
lastEvaluation: string; lastEvaluation: string;
@ -58,13 +59,16 @@ export const RulesContent: FC<RulesContentProps> = ({ response }) => {
<Table bordered key={i}> <Table bordered key={i}>
<thead> <thead>
<tr> <tr>
<td colSpan={3}> <td>
<a href={'#' + g.name}> <a href={'#' + g.name}>
<h4 id={g.name} className="text-break"> <h4 id={g.name} className="text-break">
{g.name} {g.name}
</h4> </h4>
</a> </a>
</td> </td>
<td colSpan={2}>
<h4>Interval: {humanizeDuration(parseFloat(g.interval) * 1000)}</h4>
</td>
<td> <td>
<h4>{formatRelative(g.lastEvaluation, now())}</h4> <h4>{formatRelative(g.lastEvaluation, now())}</h4>
</td> </td>