import { gettext } from "django"; import { CSSResult, customElement, html, property, TemplateResult } from "lit-element"; import { COMMON_STYLES } from "../../common/styles"; import "../../elements/buttons/ModalButton"; import "../../elements/buttons/SpinnerButton"; import "../../elements/CodeMirror"; import "../../elements/Tabs"; import { Page } from "../../elements/Page"; import { LDAPSource } from "../../api/sources/LDAP"; import { Source } from "../../api/Sources"; @customElement("ak-source-oauth-view") export class OAuthSourceViewPage extends Page { pageTitle(): string { return gettext(`LDAP Source ${this.source?.name}`); } pageDescription(): string | undefined { return; } pageIcon(): string { return "pf-icon pf-icon-middleware"; } @property() set args(value: { [key: string]: string }) { this.sourceID = value.id; } @property({ type: String }) set sourceID(value: string) { LDAPSource.get(value).then((s) => this.source = s); } @property({ attribute: false }) source?: LDAPSource; static get styles(): CSSResult[] { return COMMON_STYLES; } constructor() { super(); this.addEventListener("ak-refresh", () => { if (!this.source?.pk) return; this.sourceID = this.source?.pk; }); } renderContent(): TemplateResult { if (!this.source) { return html``; } return html`
${gettext("Name")}
${this.source.name}
${gettext("Server URI")}
${this.source.server_uri}
${gettext("Base DN")}
  • ${this.source.base_dn}
${gettext("Sync status")}
${gettext("These policies control which users can authorize using these policies.")}
`; } }