web/admin: add tab to show events of a user

Signed-off-by: Jens Langhammer <jens.langhammer@beryju.org>
This commit is contained in:
Jens Langhammer 2021-04-11 18:42:30 +02:00
parent c91b40fc07
commit 571772854b
5 changed files with 148 additions and 40 deletions

View File

@ -0,0 +1,77 @@
import { t } from "@lingui/macro";
import { customElement, html, property, TemplateResult } from "lit-element";
import { AKResponse } from "../../api/Client";
import { Table, TableColumn } from "../table/Table";
import { Event, EventsApi } from "authentik-api";
import "../forms/DeleteForm";
import "../Tabs";
import "../buttons/ModalButton";
import "../buttons/SpinnerButton";
import "../buttons/Dropdown";
import "../../pages/events/EventInfo";
import { PAGE_SIZE } from "../../constants";
import { DEFAULT_CONFIG } from "../../api/Config";
import { EventWithContext } from "../../api/Events";
@customElement("ak-events-user")
export class ObjectChangelog extends Table<Event> {
expandable = true;
@property()
order = "-created";
@property()
targetUser!: string;
apiEndpoint(page: number): Promise<AKResponse<Event>> {
return new EventsApi(DEFAULT_CONFIG).eventsEventsList({
page: page,
ordering: this.order,
pageSize: PAGE_SIZE / 2,
username: this.targetUser
});
}
columns(): TableColumn[] {
return [
new TableColumn(t`Action`, "action"),
new TableColumn(t`User`, "enabled"),
new TableColumn(t`Creation Date`, "created"),
new TableColumn(t`Client IP`, "client_ip"),
];
}
row(item: EventWithContext): TemplateResult[] {
return [
html`${item.action}`,
html`<div>${item.user?.username}</div>
${item.user.on_behalf_of ? html`<small>
${t`On behalf of ${item.user.on_behalf_of.username}`}
</small>` : html``}`,
html`<span>${item.created?.toLocaleString()}</span>`,
html`<span>${item.clientIp || "-"}</span>`,
];
}
renderExpanded(item: Event): TemplateResult {
return html`
<td role="cell" colspan="4">
<div class="pf-c-table__expandable-row-content">
<ak-event-info .event=${item as EventWithContext}></ak-event-info>
</div>
</td>
<td></td>
<td></td>
<td></td>`;
}
renderEmpty(): TemplateResult {
return super.renderEmpty(html`<ak-empty-state header=${t`No Events found.`}>
<div slot="body">
${t`No matching events could be found.`}
</div>
</ak-empty-state>`);
}
}

View File

@ -69,6 +69,7 @@ msgid "Access token URL"
msgstr "Access token URL" msgstr "Access token URL"
#: src/elements/events/ObjectChangelog.ts:38 #: src/elements/events/ObjectChangelog.ts:38
#: src/elements/events/UserEvents.ts:35
#: src/pages/events/EventListPage.ts:43 #: src/pages/events/EventListPage.ts:43
#: src/pages/policies/event_matcher/EventMatcherPolicyForm.ts:79 #: src/pages/policies/event_matcher/EventMatcherPolicyForm.ts:79
msgid "Action" msgid "Action"
@ -76,7 +77,7 @@ msgstr "Action"
#: src/pages/groups/MemberSelectModal.ts:45 #: src/pages/groups/MemberSelectModal.ts:45
#: src/pages/users/UserListPage.ts:51 #: src/pages/users/UserListPage.ts:51
#: src/pages/users/UserViewPage.ts:115 #: src/pages/users/UserViewPage.ts:116
msgid "Active" msgid "Active"
msgstr "Active" msgstr "Active"
@ -469,7 +470,7 @@ msgstr "Change your password"
#: src/pages/sources/ldap/LDAPSourceViewPage.ts:113 #: src/pages/sources/ldap/LDAPSourceViewPage.ts:113
#: src/pages/sources/oauth/OAuthSourceViewPage.ts:132 #: src/pages/sources/oauth/OAuthSourceViewPage.ts:132
#: src/pages/sources/saml/SAMLSourceViewPage.ts:119 #: src/pages/sources/saml/SAMLSourceViewPage.ts:119
#: src/pages/users/UserViewPage.ts:176 #: src/pages/users/UserViewPage.ts:185
msgid "Changelog" msgid "Changelog"
msgstr "Changelog" msgstr "Changelog"
@ -536,6 +537,7 @@ msgid "Client ID"
msgstr "Client ID" msgstr "Client ID"
#: src/elements/events/ObjectChangelog.ts:41 #: src/elements/events/ObjectChangelog.ts:41
#: src/elements/events/UserEvents.ts:38
#: src/pages/events/EventListPage.ts:46 #: src/pages/events/EventListPage.ts:46
#: src/pages/policies/event_matcher/EventMatcherPolicyForm.ts:93 #: src/pages/policies/event_matcher/EventMatcherPolicyForm.ts:93
msgid "Client IP" msgid "Client IP"
@ -831,6 +833,7 @@ msgid "Created {0}"
msgstr "Created {0}" msgstr "Created {0}"
#: src/elements/events/ObjectChangelog.ts:40 #: src/elements/events/ObjectChangelog.ts:40
#: src/elements/events/UserEvents.ts:37
#: src/pages/events/EventListPage.ts:45 #: src/pages/events/EventListPage.ts:45
msgid "Creation Date" msgid "Creation Date"
msgstr "Creation Date" msgstr "Creation Date"
@ -1031,7 +1034,7 @@ msgstr "Each provider has a different issuer, based on the application slug."
#: src/pages/stages/prompt/PromptListPage.ts:75 #: src/pages/stages/prompt/PromptListPage.ts:75
#: src/pages/user-settings/tokens/UserTokenList.ts:113 #: src/pages/user-settings/tokens/UserTokenList.ts:113
#: src/pages/users/UserListPage.ts:76 #: src/pages/users/UserListPage.ts:76
#: src/pages/users/UserViewPage.ts:146 #: src/pages/users/UserViewPage.ts:147
msgid "Edit" msgid "Edit"
msgstr "Edit" msgstr "Edit"
@ -1064,7 +1067,7 @@ msgstr "Either no applications are defined, or you don't have access to any."
#: src/pages/stages/identification/IdentificationStageForm.ts:82 #: src/pages/stages/identification/IdentificationStageForm.ts:82
#: src/pages/user-settings/UserDetailsPage.ts:71 #: src/pages/user-settings/UserDetailsPage.ts:71
#: src/pages/users/UserForm.ts:61 #: src/pages/users/UserForm.ts:61
#: src/pages/users/UserViewPage.ts:99 #: src/pages/users/UserViewPage.ts:100
msgid "Email" msgid "Email"
msgstr "Email" msgstr "Email"
@ -1224,7 +1227,7 @@ msgstr "Expiry"
msgid "Expiry date" msgid "Expiry date"
msgstr "Expiry date" msgstr "Expiry date"
#: src/pages/users/UserViewPage.ts:187 #: src/pages/users/UserViewPage.ts:196
msgid "Explicit Consent" msgid "Explicit Consent"
msgstr "Explicit Consent" msgstr "Explicit Consent"
@ -1624,7 +1627,7 @@ msgstr "Label shown next to/above the prompt."
#: src/pages/groups/MemberSelectModal.ts:46 #: src/pages/groups/MemberSelectModal.ts:46
#: src/pages/users/UserListPage.ts:52 #: src/pages/users/UserListPage.ts:52
#: src/pages/users/UserViewPage.ts:107 #: src/pages/users/UserViewPage.ts:108
msgid "Last login" msgid "Last login"
msgstr "Last login" msgstr "Last login"
@ -1901,7 +1904,7 @@ msgstr "Monitor"
#: src/pages/user-settings/UserDetailsPage.ts:64 #: src/pages/user-settings/UserDetailsPage.ts:64
#: src/pages/users/UserForm.ts:54 #: src/pages/users/UserForm.ts:54
#: src/pages/users/UserListPage.ts:50 #: src/pages/users/UserListPage.ts:50
#: src/pages/users/UserViewPage.ts:91 #: src/pages/users/UserViewPage.ts:92
msgid "Name" msgid "Name"
msgstr "Name" msgstr "Name"
@ -1944,6 +1947,7 @@ msgid "No Applications available."
msgstr "No Applications available." msgstr "No Applications available."
#: src/elements/events/ObjectChangelog.ts:68 #: src/elements/events/ObjectChangelog.ts:68
#: src/elements/events/UserEvents.ts:65
msgid "No Events found." msgid "No Events found."
msgstr "No Events found." msgstr "No Events found."
@ -1972,6 +1976,7 @@ msgid "No form found"
msgstr "No form found" msgstr "No form found"
#: src/elements/events/ObjectChangelog.ts:70 #: src/elements/events/ObjectChangelog.ts:70
#: src/elements/events/UserEvents.ts:67
msgid "No matching events could be found." msgid "No matching events could be found."
msgstr "No matching events could be found." msgstr "No matching events could be found."
@ -2058,11 +2063,11 @@ msgstr "Notifications Transport"
msgid "Number" msgid "Number"
msgstr "Number" msgstr "Number"
#: src/pages/users/UserViewPage.ts:195 #: src/pages/users/UserViewPage.ts:204
msgid "OAuth Authorization Codes" msgid "OAuth Authorization Codes"
msgstr "OAuth Authorization Codes" msgstr "OAuth Authorization Codes"
#: src/pages/users/UserViewPage.ts:203 #: src/pages/users/UserViewPage.ts:212
msgid "OAuth Refresh Codes" msgid "OAuth Refresh Codes"
msgstr "OAuth Refresh Codes" msgstr "OAuth Refresh Codes"
@ -2084,6 +2089,7 @@ msgid "Offset after which consent expires. (Format: hours=1;minutes=2;seconds=3)
msgstr "Offset after which consent expires. (Format: hours=1;minutes=2;seconds=3)." msgstr "Offset after which consent expires. (Format: hours=1;minutes=2;seconds=3)."
#: src/elements/events/ObjectChangelog.ts:50 #: src/elements/events/ObjectChangelog.ts:50
#: src/elements/events/UserEvents.ts:47
#: src/pages/events/EventListPage.ts:60 #: src/pages/events/EventListPage.ts:60
msgid "On behalf of {0}" msgid "On behalf of {0}"
msgstr "On behalf of {0}" msgstr "On behalf of {0}"
@ -2182,7 +2188,7 @@ msgstr "Outposts are deployments of authentik components to support different en
#: src/pages/sources/ldap/LDAPSourceViewPage.ts:56 #: src/pages/sources/ldap/LDAPSourceViewPage.ts:56
#: src/pages/sources/oauth/OAuthSourceViewPage.ts:55 #: src/pages/sources/oauth/OAuthSourceViewPage.ts:55
#: src/pages/sources/saml/SAMLSourceViewPage.ts:58 #: src/pages/sources/saml/SAMLSourceViewPage.ts:58
#: src/pages/users/UserViewPage.ts:73 #: src/pages/users/UserViewPage.ts:74
msgid "Overview" msgid "Overview"
msgstr "Overview" msgstr "Overview"
@ -2520,7 +2526,7 @@ msgid "Required. 150 characters or fewer. Letters, digits and @/./+/-/_ only."
msgstr "Required. 150 characters or fewer. Letters, digits and @/./+/-/_ only." msgstr "Required. 150 characters or fewer. Letters, digits and @/./+/-/_ only."
#: src/pages/users/UserListPage.ts:133 #: src/pages/users/UserListPage.ts:133
#: src/pages/users/UserViewPage.ts:164 #: src/pages/users/UserViewPage.ts:165
msgid "Reset Password" msgid "Reset Password"
msgstr "Reset Password" msgstr "Reset Password"
@ -3047,7 +3053,7 @@ msgid "Successfully generated certificate-key pair."
msgstr "Successfully generated certificate-key pair." msgstr "Successfully generated certificate-key pair."
#: src/pages/users/UserListPage.ts:128 #: src/pages/users/UserListPage.ts:128
#: src/pages/users/UserViewPage.ts:159 #: src/pages/users/UserViewPage.ts:160
msgid "Successfully generated recovery link" msgid "Successfully generated recovery link"
msgstr "Successfully generated recovery link" msgstr "Successfully generated recovery link"
@ -3178,7 +3184,7 @@ msgstr "Successfully updated user."
msgid "Successfully updated {0} {1}" msgid "Successfully updated {0} {1}"
msgstr "Successfully updated {0} {1}" msgstr "Successfully updated {0} {1}"
#: src/pages/users/UserViewPage.ts:125 #: src/pages/users/UserViewPage.ts:126
msgid "Superuser" msgid "Superuser"
msgstr "Superuser" msgstr "Superuser"
@ -3473,7 +3479,7 @@ msgstr "Up-to-date!"
#: src/pages/user-settings/tokens/UserTokenList.ts:105 #: src/pages/user-settings/tokens/UserTokenList.ts:105
#: src/pages/users/UserActiveForm.ts:66 #: src/pages/users/UserActiveForm.ts:66
#: src/pages/users/UserListPage.ts:68 #: src/pages/users/UserListPage.ts:68
#: src/pages/users/UserViewPage.ts:138 #: src/pages/users/UserViewPage.ts:139
msgid "Update" msgid "Update"
msgstr "Update" msgstr "Update"
@ -3549,7 +3555,7 @@ msgstr "Update Token"
#: src/pages/policies/BoundPoliciesList.ts:102 #: src/pages/policies/BoundPoliciesList.ts:102
#: src/pages/users/UserListPage.ts:71 #: src/pages/users/UserListPage.ts:71
#: src/pages/users/UserViewPage.ts:141 #: src/pages/users/UserViewPage.ts:142
msgid "Update User" msgid "Update User"
msgstr "Update User" msgstr "Update User"
@ -3590,6 +3596,7 @@ msgid "Use global settings"
msgstr "Use global settings" msgstr "Use global settings"
#: src/elements/events/ObjectChangelog.ts:39 #: src/elements/events/ObjectChangelog.ts:39
#: src/elements/events/UserEvents.ts:36
#: src/pages/events/EventInfo.ts:83 #: src/pages/events/EventInfo.ts:83
#: src/pages/events/EventListPage.ts:44 #: src/pages/events/EventListPage.ts:44
#: src/pages/policies/PolicyBindingForm.ts:140 #: src/pages/policies/PolicyBindingForm.ts:140
@ -3603,7 +3610,7 @@ msgstr "Use global settings"
msgid "User" msgid "User"
msgstr "User" msgstr "User"
#: src/pages/users/UserViewPage.ts:77 #: src/pages/users/UserViewPage.ts:78
msgid "User Info" msgid "User Info"
msgstr "User Info" msgstr "User Info"
@ -3619,6 +3626,10 @@ msgstr "User Settings"
msgid "User details" msgid "User details"
msgstr "User details" msgstr "User details"
#: src/pages/users/UserViewPage.ts:177
msgid "User events"
msgstr "User events"
#: src/pages/stages/authenticator_validate/AuthenticatorValidateStageForm.ts:99 #: src/pages/stages/authenticator_validate/AuthenticatorValidateStageForm.ts:99
#: src/pages/stages/identification/IdentificationStageForm.ts:74 #: src/pages/stages/identification/IdentificationStageForm.ts:74
msgid "User fields" msgid "User fields"
@ -3633,7 +3644,7 @@ msgid "User password writeback"
msgstr "User password writeback" msgstr "User password writeback"
#: src/pages/policies/BoundPoliciesList.ts:52 #: src/pages/policies/BoundPoliciesList.ts:52
#: src/pages/users/UserViewPage.ts:62 #: src/pages/users/UserViewPage.ts:63
msgid "User {0}" msgid "User {0}"
msgstr "User {0}" msgstr "User {0}"
@ -3661,7 +3672,7 @@ msgstr "Userinfo URL"
#: src/pages/stages/identification/IdentificationStageForm.ts:79 #: src/pages/stages/identification/IdentificationStageForm.ts:79
#: src/pages/user-settings/UserDetailsPage.ts:57 #: src/pages/user-settings/UserDetailsPage.ts:57
#: src/pages/users/UserForm.ts:47 #: src/pages/users/UserForm.ts:47
#: src/pages/users/UserViewPage.ts:83 #: src/pages/users/UserViewPage.ts:84
msgid "Username" msgid "Username"
msgstr "Username" msgstr "Username"

View File

@ -69,6 +69,7 @@ msgid "Access token URL"
msgstr "" msgstr ""
#: src/elements/events/ObjectChangelog.ts:38 #: src/elements/events/ObjectChangelog.ts:38
#: src/elements/events/UserEvents.ts:35
#: src/pages/events/EventListPage.ts:43 #: src/pages/events/EventListPage.ts:43
#: src/pages/policies/event_matcher/EventMatcherPolicyForm.ts:79 #: src/pages/policies/event_matcher/EventMatcherPolicyForm.ts:79
msgid "Action" msgid "Action"
@ -76,7 +77,7 @@ msgstr ""
#: src/pages/groups/MemberSelectModal.ts:45 #: src/pages/groups/MemberSelectModal.ts:45
#: src/pages/users/UserListPage.ts:51 #: src/pages/users/UserListPage.ts:51
#: src/pages/users/UserViewPage.ts:115 #: src/pages/users/UserViewPage.ts:116
msgid "Active" msgid "Active"
msgstr "" msgstr ""
@ -465,7 +466,7 @@ msgstr ""
#: src/pages/sources/ldap/LDAPSourceViewPage.ts:113 #: src/pages/sources/ldap/LDAPSourceViewPage.ts:113
#: src/pages/sources/oauth/OAuthSourceViewPage.ts:132 #: src/pages/sources/oauth/OAuthSourceViewPage.ts:132
#: src/pages/sources/saml/SAMLSourceViewPage.ts:119 #: src/pages/sources/saml/SAMLSourceViewPage.ts:119
#: src/pages/users/UserViewPage.ts:176 #: src/pages/users/UserViewPage.ts:185
msgid "Changelog" msgid "Changelog"
msgstr "" msgstr ""
@ -530,6 +531,7 @@ msgid "Client ID"
msgstr "" msgstr ""
#: src/elements/events/ObjectChangelog.ts:41 #: src/elements/events/ObjectChangelog.ts:41
#: src/elements/events/UserEvents.ts:38
#: src/pages/events/EventListPage.ts:46 #: src/pages/events/EventListPage.ts:46
#: src/pages/policies/event_matcher/EventMatcherPolicyForm.ts:93 #: src/pages/policies/event_matcher/EventMatcherPolicyForm.ts:93
msgid "Client IP" msgid "Client IP"
@ -825,6 +827,7 @@ msgid "Created {0}"
msgstr "" msgstr ""
#: src/elements/events/ObjectChangelog.ts:40 #: src/elements/events/ObjectChangelog.ts:40
#: src/elements/events/UserEvents.ts:37
#: src/pages/events/EventListPage.ts:45 #: src/pages/events/EventListPage.ts:45
msgid "Creation Date" msgid "Creation Date"
msgstr "" msgstr ""
@ -1023,7 +1026,7 @@ msgstr ""
#: src/pages/stages/prompt/PromptListPage.ts:75 #: src/pages/stages/prompt/PromptListPage.ts:75
#: src/pages/user-settings/tokens/UserTokenList.ts:113 #: src/pages/user-settings/tokens/UserTokenList.ts:113
#: src/pages/users/UserListPage.ts:76 #: src/pages/users/UserListPage.ts:76
#: src/pages/users/UserViewPage.ts:146 #: src/pages/users/UserViewPage.ts:147
msgid "Edit" msgid "Edit"
msgstr "" msgstr ""
@ -1056,7 +1059,7 @@ msgstr ""
#: src/pages/stages/identification/IdentificationStageForm.ts:82 #: src/pages/stages/identification/IdentificationStageForm.ts:82
#: src/pages/user-settings/UserDetailsPage.ts:71 #: src/pages/user-settings/UserDetailsPage.ts:71
#: src/pages/users/UserForm.ts:61 #: src/pages/users/UserForm.ts:61
#: src/pages/users/UserViewPage.ts:99 #: src/pages/users/UserViewPage.ts:100
msgid "Email" msgid "Email"
msgstr "" msgstr ""
@ -1216,7 +1219,7 @@ msgstr ""
msgid "Expiry date" msgid "Expiry date"
msgstr "" msgstr ""
#: src/pages/users/UserViewPage.ts:187 #: src/pages/users/UserViewPage.ts:196
msgid "Explicit Consent" msgid "Explicit Consent"
msgstr "" msgstr ""
@ -1616,7 +1619,7 @@ msgstr ""
#: src/pages/groups/MemberSelectModal.ts:46 #: src/pages/groups/MemberSelectModal.ts:46
#: src/pages/users/UserListPage.ts:52 #: src/pages/users/UserListPage.ts:52
#: src/pages/users/UserViewPage.ts:107 #: src/pages/users/UserViewPage.ts:108
msgid "Last login" msgid "Last login"
msgstr "" msgstr ""
@ -1893,7 +1896,7 @@ msgstr ""
#: src/pages/user-settings/UserDetailsPage.ts:64 #: src/pages/user-settings/UserDetailsPage.ts:64
#: src/pages/users/UserForm.ts:54 #: src/pages/users/UserForm.ts:54
#: src/pages/users/UserListPage.ts:50 #: src/pages/users/UserListPage.ts:50
#: src/pages/users/UserViewPage.ts:91 #: src/pages/users/UserViewPage.ts:92
msgid "Name" msgid "Name"
msgstr "" msgstr ""
@ -1936,6 +1939,7 @@ msgid "No Applications available."
msgstr "" msgstr ""
#: src/elements/events/ObjectChangelog.ts:68 #: src/elements/events/ObjectChangelog.ts:68
#: src/elements/events/UserEvents.ts:65
msgid "No Events found." msgid "No Events found."
msgstr "" msgstr ""
@ -1964,6 +1968,7 @@ msgid "No form found"
msgstr "" msgstr ""
#: src/elements/events/ObjectChangelog.ts:70 #: src/elements/events/ObjectChangelog.ts:70
#: src/elements/events/UserEvents.ts:67
msgid "No matching events could be found." msgid "No matching events could be found."
msgstr "" msgstr ""
@ -2050,11 +2055,11 @@ msgstr ""
msgid "Number" msgid "Number"
msgstr "" msgstr ""
#: src/pages/users/UserViewPage.ts:195 #: src/pages/users/UserViewPage.ts:204
msgid "OAuth Authorization Codes" msgid "OAuth Authorization Codes"
msgstr "" msgstr ""
#: src/pages/users/UserViewPage.ts:203 #: src/pages/users/UserViewPage.ts:212
msgid "OAuth Refresh Codes" msgid "OAuth Refresh Codes"
msgstr "" msgstr ""
@ -2076,6 +2081,7 @@ msgid "Offset after which consent expires. (Format: hours=1;minutes=2;seconds=3)
msgstr "" msgstr ""
#: src/elements/events/ObjectChangelog.ts:50 #: src/elements/events/ObjectChangelog.ts:50
#: src/elements/events/UserEvents.ts:47
#: src/pages/events/EventListPage.ts:60 #: src/pages/events/EventListPage.ts:60
msgid "On behalf of {0}" msgid "On behalf of {0}"
msgstr "" msgstr ""
@ -2174,7 +2180,7 @@ msgstr ""
#: src/pages/sources/ldap/LDAPSourceViewPage.ts:56 #: src/pages/sources/ldap/LDAPSourceViewPage.ts:56
#: src/pages/sources/oauth/OAuthSourceViewPage.ts:55 #: src/pages/sources/oauth/OAuthSourceViewPage.ts:55
#: src/pages/sources/saml/SAMLSourceViewPage.ts:58 #: src/pages/sources/saml/SAMLSourceViewPage.ts:58
#: src/pages/users/UserViewPage.ts:73 #: src/pages/users/UserViewPage.ts:74
msgid "Overview" msgid "Overview"
msgstr "" msgstr ""
@ -2512,7 +2518,7 @@ msgid "Required. 150 characters or fewer. Letters, digits and @/./+/-/_ only."
msgstr "" msgstr ""
#: src/pages/users/UserListPage.ts:133 #: src/pages/users/UserListPage.ts:133
#: src/pages/users/UserViewPage.ts:164 #: src/pages/users/UserViewPage.ts:165
msgid "Reset Password" msgid "Reset Password"
msgstr "" msgstr ""
@ -3039,7 +3045,7 @@ msgid "Successfully generated certificate-key pair."
msgstr "" msgstr ""
#: src/pages/users/UserListPage.ts:128 #: src/pages/users/UserListPage.ts:128
#: src/pages/users/UserViewPage.ts:159 #: src/pages/users/UserViewPage.ts:160
msgid "Successfully generated recovery link" msgid "Successfully generated recovery link"
msgstr "" msgstr ""
@ -3170,7 +3176,7 @@ msgstr ""
msgid "Successfully updated {0} {1}" msgid "Successfully updated {0} {1}"
msgstr "" msgstr ""
#: src/pages/users/UserViewPage.ts:125 #: src/pages/users/UserViewPage.ts:126
msgid "Superuser" msgid "Superuser"
msgstr "" msgstr ""
@ -3463,7 +3469,7 @@ msgstr ""
#: src/pages/user-settings/tokens/UserTokenList.ts:105 #: src/pages/user-settings/tokens/UserTokenList.ts:105
#: src/pages/users/UserActiveForm.ts:66 #: src/pages/users/UserActiveForm.ts:66
#: src/pages/users/UserListPage.ts:68 #: src/pages/users/UserListPage.ts:68
#: src/pages/users/UserViewPage.ts:138 #: src/pages/users/UserViewPage.ts:139
msgid "Update" msgid "Update"
msgstr "" msgstr ""
@ -3539,7 +3545,7 @@ msgstr ""
#: src/pages/policies/BoundPoliciesList.ts:102 #: src/pages/policies/BoundPoliciesList.ts:102
#: src/pages/users/UserListPage.ts:71 #: src/pages/users/UserListPage.ts:71
#: src/pages/users/UserViewPage.ts:141 #: src/pages/users/UserViewPage.ts:142
msgid "Update User" msgid "Update User"
msgstr "" msgstr ""
@ -3580,6 +3586,7 @@ msgid "Use global settings"
msgstr "" msgstr ""
#: src/elements/events/ObjectChangelog.ts:39 #: src/elements/events/ObjectChangelog.ts:39
#: src/elements/events/UserEvents.ts:36
#: src/pages/events/EventInfo.ts:83 #: src/pages/events/EventInfo.ts:83
#: src/pages/events/EventListPage.ts:44 #: src/pages/events/EventListPage.ts:44
#: src/pages/policies/PolicyBindingForm.ts:140 #: src/pages/policies/PolicyBindingForm.ts:140
@ -3593,7 +3600,7 @@ msgstr ""
msgid "User" msgid "User"
msgstr "" msgstr ""
#: src/pages/users/UserViewPage.ts:77 #: src/pages/users/UserViewPage.ts:78
msgid "User Info" msgid "User Info"
msgstr "" msgstr ""
@ -3609,6 +3616,10 @@ msgstr ""
msgid "User details" msgid "User details"
msgstr "" msgstr ""
#: src/pages/users/UserViewPage.ts:177
msgid "User events"
msgstr ""
#: src/pages/stages/authenticator_validate/AuthenticatorValidateStageForm.ts:99 #: src/pages/stages/authenticator_validate/AuthenticatorValidateStageForm.ts:99
#: src/pages/stages/identification/IdentificationStageForm.ts:74 #: src/pages/stages/identification/IdentificationStageForm.ts:74
msgid "User fields" msgid "User fields"
@ -3623,7 +3634,7 @@ msgid "User password writeback"
msgstr "" msgstr ""
#: src/pages/policies/BoundPoliciesList.ts:52 #: src/pages/policies/BoundPoliciesList.ts:52
#: src/pages/users/UserViewPage.ts:62 #: src/pages/users/UserViewPage.ts:63
msgid "User {0}" msgid "User {0}"
msgstr "" msgstr ""
@ -3651,7 +3662,7 @@ msgstr ""
#: src/pages/stages/identification/IdentificationStageForm.ts:79 #: src/pages/stages/identification/IdentificationStageForm.ts:79
#: src/pages/user-settings/UserDetailsPage.ts:57 #: src/pages/user-settings/UserDetailsPage.ts:57
#: src/pages/users/UserForm.ts:47 #: src/pages/users/UserForm.ts:47
#: src/pages/users/UserViewPage.ts:83 #: src/pages/users/UserViewPage.ts:84
msgid "Username" msgid "Username"
msgstr "" msgstr ""

View File

@ -22,7 +22,7 @@ export class LDAPSyncStatusCard extends AdminStatusCard<Task> {
} }
renderValue(): TemplateResult { renderValue(): TemplateResult {
return html`${t`Last sync: ${this.value?.taskFinishTimestamp?.toLocaleTimeString()}`}`; return html`${t`Last sync: ${this.value?.taskFinishTimestamp?.toLocaleTimeString() || "-"}`}`;
} }
getStatus(value: Task): Promise<AdminStatus> { getStatus(value: Task): Promise<AdminStatus> {

View File

@ -14,7 +14,6 @@ import PFButton from "@patternfly/patternfly/components/Button/button.css";
import AKGlobal from "../../authentik.css"; import AKGlobal from "../../authentik.css";
import "../../elements/forms/ModalForm"; import "../../elements/forms/ModalForm";
import "./UserForm";
import "../../elements/buttons/ActionButton"; import "../../elements/buttons/ActionButton";
import "../../elements/buttons/SpinnerButton"; import "../../elements/buttons/SpinnerButton";
import "../../elements/CodeMirror"; import "../../elements/CodeMirror";
@ -25,6 +24,8 @@ import "../../elements/oauth/UserCodeList";
import "../../elements/oauth/UserRefreshList"; import "../../elements/oauth/UserRefreshList";
import "../../elements/charts/UserChart"; import "../../elements/charts/UserChart";
import "../../elements/PageHeader"; import "../../elements/PageHeader";
import "../../elements/events/UserEvents";
import "./UserForm";
import { CoreApi, User } from "authentik-api"; import { CoreApi, User } from "authentik-api";
import { DEFAULT_CONFIG } from "../../api/Config"; import { DEFAULT_CONFIG } from "../../api/Config";
import { EVENT_REFRESH } from "../../constants"; import { EVENT_REFRESH } from "../../constants";
@ -75,7 +76,7 @@ export class UserViewPage extends LitElement {
return html`<ak-tabs> return html`<ak-tabs>
<section slot="page-overview" data-tab-title="${t`Overview`}" class="pf-c-page__main-section pf-m-no-padding-mobile"> <section slot="page-overview" data-tab-title="${t`Overview`}" class="pf-c-page__main-section pf-m-no-padding-mobile">
<div class="pf-l-gallery pf-m-gutter"> <div class="pf-l-gallery pf-m-gutter">
<div class="pf-c-card pf-l-gallery__item pf-m-4-col"> <div class="pf-c-card pf-l-gallery__item">
<div class="pf-c-card__title"> <div class="pf-c-card__title">
${t`User Info`} ${t`User Info`}
</div> </div>
@ -167,7 +168,7 @@ export class UserViewPage extends LitElement {
</ak-action-button> </ak-action-button>
</div> </div>
</div> </div>
<div class="pf-c-card pf-l-gallery__item pf-m-4-col" style="grid-column-end: span 4;grid-row-end: span 2;"> <div class="pf-c-card pf-l-gallery__item" style="grid-column-end: span 4;grid-row-end: span 2;">
<div class="pf-c-card__body"> <div class="pf-c-card__body">
<ak-charts-user userId=${this.user.pk || 0}> <ak-charts-user userId=${this.user.pk || 0}>
</ak-charts-user> </ak-charts-user>
@ -175,6 +176,14 @@ export class UserViewPage extends LitElement {
</div> </div>
</div> </div>
</section> </section>
<section slot="page-events" data-tab-title="${t`User events`}" class="pf-c-page__main-section pf-m-no-padding-mobile">
<div class="pf-c-card">
<div class="pf-c-card__body">
<ak-events-user targetUser=${this.user.username}>
</ak-events-user>
</div>
</div>
</section>
<section slot="page-changelog" data-tab-title="${t`Changelog`}" class="pf-c-page__main-section pf-m-no-padding-mobile"> <section slot="page-changelog" data-tab-title="${t`Changelog`}" class="pf-c-page__main-section pf-m-no-padding-mobile">
<div class="pf-c-card"> <div class="pf-c-card">
<div class="pf-c-card__body"> <div class="pf-c-card__body">