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
1 changed files with 5 additions and 1 deletions

View File

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