This repository has been archived on 2024-05-31. You can view files and clone it, but cannot push or open issues or pull requests.
authentik/web/src/pages/events/EventInfoPage.ts

54 lines
1.8 KiB
TypeScript
Raw Normal View History

2021-02-04 20:28:01 +00:00
import { gettext } from "django";
import { css, CSSResult, customElement, html, LitElement, property, TemplateResult } from "lit-element";
import { EventsApi } from "authentik-api";
import { DEFAULT_CONFIG } from "../../api/Config";
import { EventWithContext } from "../../api/Events";
import PFBase from "@patternfly/patternfly/patternfly-base.css";
import PFPage from "@patternfly/patternfly/components/Page/page.css";
import PFCard from "@patternfly/patternfly/components/Card/card.css";
import AKGlobal from "../../authentik.css";
import "./EventInfo";
2021-02-04 20:28:01 +00:00
@customElement("ak-event-info-page")
export class EventInfoPage extends LitElement {
@property()
set eventID(value: string) {
new EventsApi(DEFAULT_CONFIG).eventsEventsRead({
eventUuid: value
}).then((ev) => {
this.event = ev as EventWithContext;
});
2021-02-04 20:28:01 +00:00
}
@property({ attribute: false })
event!: EventWithContext;
2021-02-04 20:28:01 +00:00
static get styles(): CSSResult[] {
return [PFBase, PFPage, PFCard, AKGlobal].concat(css`
2021-02-04 20:28:01 +00:00
.pf-c-card {
color: var(--ak-dark-foreground);
}
`);
}
render(): TemplateResult {
return html`<section class="pf-c-page__main-section pf-m-light">
<div class="pf-c-content">
<h1>
<i class="pf-icon pf-icon-catalog"></i>
${gettext(`Event ${this.event?.pk || ""}`)}
</h1>
</div>
</section>
<section class="pf-c-page__main-section pf-m-no-padding-mobile">
<div class="pf-c-card">
<div class="pf-c-card__body">
<ak-event-info .event=${this.event}></ak-event-info>
</div>
</div>
</section>`;
}
}