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 b526250515
commit 078dfb30f3
1 changed files with 10 additions and 5 deletions

View File

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