import { t } from "@lingui/macro"; import { TemplateResult, html } from "lit"; import { customElement } from "lit/decorators"; import { ifDefined } from "lit/directives/if-defined"; import { until } from "lit/directives/until"; import { CryptoApi, DockerServiceConnection, OutpostsApi } from "@goauthentik/api"; import { DEFAULT_CONFIG } from "../../api/Config"; import "../../elements/forms/HorizontalFormElement"; import { ModelForm } from "../../elements/forms/ModelForm"; import { first } from "../../utils"; @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.`}

`; } }