import { gettext } from "django"; import { css, CSSResult, customElement, html, LitElement, property, TemplateResult } from "lit-element"; import { COMMON_STYLES } from "../../common/styles"; import "../../elements/Tabs"; import "../../elements/charts/ApplicationAuthorizeChart"; import "../../elements/buttons/ModalButton"; import "../../elements/buttons/SpinnerButton"; import "../../elements/policies/BoundPoliciesList"; import "../../elements/utils/LoadingState"; import { Application, CoreApi } from "../../api"; import { DEFAULT_CONFIG } from "../../api/Config"; @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 COMMON_STYLES.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}