web/admin: make username in events log clickable

Signed-off-by: Jens Langhammer <jens.langhammer@beryju.org>
This commit is contained in:
Jens Langhammer 2021-04-11 17:45:37 +02:00
parent ae7959ff51
commit f3396226e8
1 changed files with 10 additions and 5 deletions

View File

@ -47,16 +47,21 @@ export class EventListPage extends TablePage<Event> {
new TableColumn(""),
];
}
row(item: EventWithContext): TemplateResult[] {
return [
html`<div>${item.action}</div>
<small>${item.app}</small>`,
html`<div>${item.user?.username}</div>
item.user?.username ?
html`<a href="#/identity/users/${item.user.pk}">
${item.user?.username}
</a>
${item.user.on_behalf_of ? html`<small>
${t`On behalf of ${item.user.on_behalf_of.username}`}
</small>` : html``}`,
</small>` : html``}` :
html`-`,
html`<span>${item.created?.toLocaleString()}</span>`,
html`<span>${item.clientIp}</span>`,
html`<span>${item.clientIp || "-"}</span>`,
html`<a href="#/events/log/${item.pk}">
<i class="fas fas fa-share-square"></i>
</a>`,