stages/identification: auto-redirect to source when no user fields are selected (#5583)

Signed-off-by: Jens Langhammer <jens@goauthentik.io>
This commit is contained in:
Jens L
2023-05-11 16:52:30 +02:00
committed by GitHub
parent 7265a56f05
commit 61434c807d
8 changed files with 81 additions and 30 deletions

View File

@ -5,7 +5,7 @@ import { t } from "@lingui/macro";
import { TemplateResult, html } from "lit";
import { EventActions } from "@goauthentik/api";
import { EventActions, SeverityEnum } from "@goauthentik/api";
export function EventGeo(event: EventWithContext): TemplateResult {
let geo: KeyUnknown | undefined = undefined;
@ -78,3 +78,16 @@ export function ActionToLabel(action?: EventActions): string {
return action;
}
}
export function SeverityToLabel(severity: SeverityEnum | null | undefined): string {
if (!severity) return t`Unknown severity`;
switch (severity) {
case SeverityEnum.Alert:
return t`Alert`;
case SeverityEnum.Notice:
return t`Notice`;
case SeverityEnum.Warning:
return t`Warning`;
}
return t`Unknown severity`;
}