import { css, CSSResult, customElement, html, LitElement, property, TemplateResult } from "lit-element"; import "../../elements/buttons/ModalButton"; import "../../elements/buttons/SpinnerButton"; import "../../elements/EmptyState"; import "./SAMLProviderViewPage"; import "./OAuth2ProviderViewPage"; import "./ProxyProviderViewPage"; import { Provider, ProvidersApi } from "authentik-api"; import { DEFAULT_CONFIG } from "../../api/Config"; import { ifDefined } from "lit-html/directives/if-defined"; @customElement("ak-provider-view") export class ProviderViewPage extends LitElement { @property({type: Number}) set providerID(value: number) { new ProvidersApi(DEFAULT_CONFIG).providersAllRead({ id: value, }).then((prov) => (this.provider = prov)); } @property({ attribute: false }) provider?: Provider; static get styles(): CSSResult[] { return [css` * { height: 100%; } `]; } render(): TemplateResult { if (!this.provider) { return html``; } switch (this.provider?.objectType) { case "saml": return html``; case "oauth2": return html``; case "proxy": return html``; default: return html`

Invalid provider type ${this.provider?.objectType}

`; } } }