import { gettext } from "django"; import { css, CSSResult, customElement, html, LitElement, property, TemplateResult } from "lit-element"; import "../../elements/Tabs"; import "../../elements/charts/ApplicationAuthorizeChart"; import "../../elements/buttons/ModalButton"; import "../../elements/buttons/SpinnerButton"; import "../../elements/policies/BoundPoliciesList"; import "../../elements/EmptyState"; import { Application, CoreApi } from "authentik-api"; import { DEFAULT_CONFIG } from "../../api/Config"; import PFPage from "@patternfly/patternfly/components/Page/page.css"; import PFContent from "@patternfly/patternfly/components/Content/content.css"; import PFGallery from "@patternfly/patternfly/layouts/Gallery/gallery.css"; import PFCard from "@patternfly/patternfly/components/Card/card.css"; import AKGlobal from "../../authentik.css"; import PFBase from "@patternfly/patternfly/patternfly-base.css"; @customElement("ak-application-view") export class ApplicationViewPage extends LitElement { @property() set args(value: { [key: string]: string }) { this.applicationSlug = value.slug; } @property() set applicationSlug(value: string) { new CoreApi(DEFAULT_CONFIG).coreApplicationsRead({ slug: value }).then((app) => { this.application = app; }); } @property({attribute: false}) application!: Application; static get styles(): CSSResult[] { return [PFBase, PFPage, PFContent, PFGallery, PFCard, AKGlobal].concat( css` img.pf-icon { max-height: 24px; } ak-tabs { height: 100%; } ` ); } render(): TemplateResult { if (!this.application) { return html` ${gettext("Loading...")} `; } return html` ${this.application?.name} ${this.application?.metaPublisher} ${gettext("Logins over the last 24 hours")} ${this.application ? html` `: ""} ${gettext("Related")} ${this.application.provider ? html` ${gettext("Provider")} ${this.application.provider.name} `: html``} ${gettext("These policies control which users can access this application.")} `; } }
${this.application?.metaPublisher}