diff --git a/web/src/elements/table/TablePage.ts b/web/src/elements/table/TablePage.ts index 70644f24d..143b6fca8 100644 --- a/web/src/elements/table/TablePage.ts +++ b/web/src/elements/table/TablePage.ts @@ -1,3 +1,4 @@ +import { gettext } from "django"; import { html, TemplateResult } from "lit-html"; import { ifDefined } from "lit-html/directives/if-defined"; import { Table } from "./Table"; @@ -26,9 +27,9 @@ export abstract class TablePage extends Table {

- ${this.pageTitle()} + ${gettext(this.pageTitle())}

- ${description ? html`

${description}

` : html``} + ${description ? html`

${gettext(description)}

` : html``}
diff --git a/web/src/pages/events/EventInfoPage.ts b/web/src/pages/events/EventInfoPage.ts new file mode 100644 index 000000000..a844c8807 --- /dev/null +++ b/web/src/pages/events/EventInfoPage.ts @@ -0,0 +1,47 @@ +import { gettext } from "django"; +import { css, CSSResult, customElement, html, LitElement, property, TemplateResult } from "lit-element"; +import { Event } from "../../api/Events"; +import { COMMON_STYLES } from "../../common/styles"; + +@customElement("ak-event-info-page") +export class EventInfoPage extends LitElement { + @property() + set args(value: { [key: string]: string }) { + this.eventID = value.id; + } + + @property() + set eventID(value: string) { + Event.get(value).then((e) => (this.event = e)); + } + + @property({ attribute: false }) + event?: Event; + + static get styles(): CSSResult[] { + return COMMON_STYLES.concat(css` + .pf-c-card { + color: var(--ak-dark-foreground); + } + `); + } + + render(): TemplateResult { + return html`
+
+

+ + ${gettext(`Event ${this.event?.pk || ""}`)} +

+
+
+
+
+
+ +
+
+
`; + } + +} diff --git a/web/src/routes.ts b/web/src/routes.ts index b09c81951..32c97b71b 100644 --- a/web/src/routes.ts +++ b/web/src/routes.ts @@ -1,5 +1,5 @@ import { html } from "lit-html"; -import { Route, SLUG_REGEX, ID_REGEX } from "./elements/router/Route"; +import { Route, SLUG_REGEX, ID_REGEX, UUID_REGEX } from "./elements/router/Route"; import "./pages/LibraryPage"; import "./pages/admin-overview/AdminOverviewPage"; @@ -8,6 +8,7 @@ import "./pages/applications/ApplicationViewPage"; import "./pages/sources/SourceViewPage"; import "./pages/flows/FlowViewPage"; import "./pages/events/EventListPage"; +import "./pages/events/EventInfoPage"; import "./pages/events/TransportListPage"; import "./pages/events/RuleListPage"; import "./pages/providers/ProviderListPage"; @@ -35,6 +36,9 @@ export const ROUTES: Route[] = [ return html``; }), new Route(new RegExp("^/events/log$"), html``), + new Route(new RegExp(`^/events/log/(?${UUID_REGEX})$`)).then((args) => { + return html``; + }), new Route(new RegExp("^/events/transports$"), html``), new Route(new RegExp("^/events/rules$"), html``), new Route(new RegExp("^/property-mappings$"), html``),