import { html, LitElement, TemplateResult } from "lit"; import { customElement, property } from "lit/decorators"; import "../../elements/buttons/SpinnerButton"; import "../../elements/EmptyState"; import "../../elements/PageHeader"; import "./saml/SAMLProviderViewPage"; import "./oauth2/OAuth2ProviderViewPage"; import "./proxy/ProxyProviderViewPage"; import "./ldap/LDAPProviderViewPage"; import { Provider, ProvidersApi } from "@goauthentik/api"; import { DEFAULT_CONFIG } from "../../api/Config"; import { ifDefined } from "lit/directives/if-defined"; @customElement("ak-provider-view") export class ProviderViewPage extends LitElement { @property({ type: Number }) set providerID(value: number) { new ProvidersApi(DEFAULT_CONFIG) .providersAllRetrieve({ id: value, }) .then((prov) => (this.provider = prov)); } @property({ attribute: false }) provider?: Provider; renderProvider(): TemplateResult { if (!this.provider) { return html``; } switch (this.provider?.component) { case "ak-provider-saml-form": return html``; case "ak-provider-oauth2-form": return html``; case "ak-provider-proxy-form": return html``; case "ak-provider-ldap-form": return html``; default: return html`

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

`; } } render(): TemplateResult { return html` ${this.renderProvider()}`; } }