web: improve UI for event actions
Signed-off-by: Jens Langhammer <jens.langhammer@beryju.org>
This commit is contained in:
@ -8,6 +8,7 @@ import { PAGE_SIZE } from "../../constants";
|
||||
import { TableColumn } from "../../elements/table/Table";
|
||||
import { TablePage } from "../../elements/table/TablePage";
|
||||
import "./EventInfo";
|
||||
import { ActionToLabel } from "./utils";
|
||||
|
||||
@customElement("ak-event-list")
|
||||
export class EventListPage extends TablePage<Event> {
|
||||
@ -51,7 +52,7 @@ export class EventListPage extends TablePage<Event> {
|
||||
|
||||
row(item: EventWithContext): TemplateResult[] {
|
||||
return [
|
||||
html`<div>${item.action}</div>
|
||||
html`<div>${ActionToLabel(item.action)}</div>
|
||||
<small>${item.app}</small>`,
|
||||
item.user?.username ?
|
||||
html`<a href="#/identity/users/${item.user.pk}">
|
||||
|
||||
60
web/src/pages/events/utils.ts
Normal file
60
web/src/pages/events/utils.ts
Normal file
@ -0,0 +1,60 @@
|
||||
import { t } from "@lingui/macro";
|
||||
import { EventActions } from "authentik-api";
|
||||
|
||||
export function ActionToLabel(action?: EventActions): string {
|
||||
if (!action) return "";
|
||||
switch (action) {
|
||||
case EventActions.Login:
|
||||
return t`Login`;
|
||||
case EventActions.LoginFailed:
|
||||
return t`Failed login`;
|
||||
case EventActions.Logout:
|
||||
return t`Logout`;
|
||||
case EventActions.UserWrite:
|
||||
return t`User was written to`;
|
||||
case EventActions.SuspiciousRequest:
|
||||
return t`Suspicious request`;
|
||||
case EventActions.PasswordSet:
|
||||
return t`Password set`;
|
||||
case EventActions.SecretView:
|
||||
return t`Secret was viewed`;
|
||||
case EventActions.SecretRotate:
|
||||
return t`Secret was rotation`;
|
||||
case EventActions.InvitationUsed:
|
||||
return t`Invitation used`;
|
||||
case EventActions.AuthorizeApplication:
|
||||
return t`Application authorized`;
|
||||
case EventActions.SourceLinked:
|
||||
return t`Source linked`;
|
||||
case EventActions.ImpersonationStarted:
|
||||
return t`Impersonation started`;
|
||||
case EventActions.ImpersonationEnded:
|
||||
return t`Impersonation ended`;
|
||||
case EventActions.PolicyExecution:
|
||||
return t`Policy execution`;
|
||||
case EventActions.PolicyException:
|
||||
return t`Policy exception`;
|
||||
case EventActions.PropertyMappingException:
|
||||
return t`Property Mapping exception`;
|
||||
case EventActions.SystemTaskExecution:
|
||||
return t`System task execution`;
|
||||
case EventActions.SystemTaskException:
|
||||
return t`System task exception`;
|
||||
case EventActions.SystemException:
|
||||
return t`General system exception`;
|
||||
case EventActions.ConfigurationError:
|
||||
return t`Configuration error`;
|
||||
case EventActions.ModelCreated:
|
||||
return t`Model created`;
|
||||
case EventActions.ModelUpdated:
|
||||
return t`Model updated`;
|
||||
case EventActions.ModelDeleted:
|
||||
return t`Model deleted`;
|
||||
case EventActions.EmailSent:
|
||||
return t`Email sent`;
|
||||
case EventActions.UpdateAvailable:
|
||||
return t`Update available`;
|
||||
default:
|
||||
return action;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user