import { gettext } from "django"; import { css, CSSResult, customElement, html, LitElement, property, TemplateResult } from "lit-element"; import { Application } from "../../api/Applications"; import { DefaultClient } from "../../api/Client"; import { COMMON_STYLES } from "../../common/styles"; import "../../elements/Tabs"; import "../../elements/AdminLoginsChart"; import "../../elements/buttons/ModalButton"; import "../../elements/buttons/SpinnerButton"; import "../../elements/policies/BoundPoliciesList"; import "../../elements/utils/LoadingState"; @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) { Application.get(value).then((app) => (this.application = app)); } @property({attribute: false}) application?: Application; static get styles(): CSSResult[] { return COMMON_STYLES.concat( css` img.pf-icon { max-height: 24px; } ` ); } render(): TemplateResult { if (!this.application) { return html``;; } return html` ${this.application?.name} ${this.application?.meta_publisher} ${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?.meta_publisher}