import { CryptoApi, DockerServiceConnection, OutpostsApi } from "authentik-api"; import { t } from "@lingui/macro"; import { customElement } from "lit-element"; import { html, TemplateResult } from "lit-html"; import { DEFAULT_CONFIG } from "../../api/Config"; import { until } from "lit-html/directives/until"; import { ifDefined } from "lit-html/directives/if-defined"; import "../../elements/forms/HorizontalFormElement"; import { first } from "../../utils"; import { ModelForm } from "../../elements/forms/ModelForm"; @customElement("ak-service-connection-docker-form") export class ServiceConnectionDockerForm extends ModelForm { loadInstance(pk: string): Promise { return new OutpostsApi(DEFAULT_CONFIG).outpostsServiceConnectionsDockerRetrieve({ uuid: pk, }); } getSuccessMessage(): string { if (this.instance) { return t`Successfully updated integration.`; } else { return t`Successfully created integration.`; } } send = (data: DockerServiceConnection): Promise => { if (this.instance) { return new OutpostsApi(DEFAULT_CONFIG).outpostsServiceConnectionsDockerUpdate({ uuid: this.instance.pk || "", dockerServiceConnectionRequest: data, }); } else { return new OutpostsApi(DEFAULT_CONFIG).outpostsServiceConnectionsDockerCreate({ dockerServiceConnectionRequest: data, }); } }; renderForm(): TemplateResult { return html`

${t`If enabled, use the local connection. Required Docker socket/Kubernetes Integration.`}

${t`Can be in the format of 'unix://' when connecting to a local docker daemon, or 'https://:2376' when connecting to a remote system.`}

${t`CA which the endpoint's Certificate is verified against. Can be left empty for no validation.`}

${t`Certificate/Key used for authentication. Can be left empty for no authentication.`}

`; } }