web/admin: link EventInfoPage on EventListPage

Signed-off-by: Jens Langhammer <jens.langhammer@beryju.org>
This commit is contained in:
Jens Langhammer 2021-04-04 16:51:43 +02:00
parent c0bdb2407a
commit 469b6b64bc
2 changed files with 9 additions and 1 deletions

View file

@ -6,6 +6,7 @@ import { EventWithContext } from "../../api/Events";
import PFBase from "@patternfly/patternfly/patternfly-base.css"; import PFBase from "@patternfly/patternfly/patternfly-base.css";
import PFPage from "@patternfly/patternfly/components/Page/page.css"; import PFPage from "@patternfly/patternfly/components/Page/page.css";
import PFCard from "@patternfly/patternfly/components/Card/card.css"; import PFCard from "@patternfly/patternfly/components/Card/card.css";
import PFContent from "@patternfly/patternfly/components/Content/content.css";
import AKGlobal from "../../authentik.css"; import AKGlobal from "../../authentik.css";
import "./EventInfo"; import "./EventInfo";
@ -25,7 +26,7 @@ export class EventInfoPage extends LitElement {
event!: EventWithContext; event!: EventWithContext;
static get styles(): CSSResult[] { static get styles(): CSSResult[] {
return [PFBase, PFPage, PFCard, AKGlobal].concat(css` return [PFBase, PFPage, PFContent, PFCard, AKGlobal].concat(css`
.pf-c-card { .pf-c-card {
color: var(--ak-dark-foreground); color: var(--ak-dark-foreground);
} }
@ -43,6 +44,9 @@ export class EventInfoPage extends LitElement {
</section> </section>
<section class="pf-c-page__main-section pf-m-no-padding-mobile"> <section 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__title">
${t`Event info`}
</div>
<div class="pf-c-card__body"> <div class="pf-c-card__body">
<ak-event-info .event=${this.event}></ak-event-info> <ak-event-info .event=${this.event}></ak-event-info>
</div> </div>

View file

@ -44,6 +44,7 @@ export class EventListPage extends TablePage<Event> {
new TableColumn(t`User`, t`user`), new TableColumn(t`User`, t`user`),
new TableColumn(t`Creation Date`, t`created`), new TableColumn(t`Creation Date`, t`created`),
new TableColumn(t`Client IP`, t`client_ip`), new TableColumn(t`Client IP`, t`client_ip`),
new TableColumn(""),
]; ];
} }
row(item: EventWithContext): TemplateResult[] { row(item: EventWithContext): TemplateResult[] {
@ -56,6 +57,9 @@ export class EventListPage extends TablePage<Event> {
</small>` : html``}`, </small>` : 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}">
<i class="fas fas fa-share-square"></i>
</a>`,
]; ];
} }