2021-09-21 09:31:37 +00:00
|
|
|
import { t } from "@lingui/macro";
|
|
|
|
|
2021-09-21 09:19:26 +00:00
|
|
|
import { html, TemplateResult } from "lit";
|
|
|
|
import { customElement, property } from "lit/decorators";
|
|
|
|
import { ifDefined } from "lit/directives/if-defined";
|
2021-09-21 09:31:37 +00:00
|
|
|
|
|
|
|
import { Outpost, OutpostTypeEnum } from "@goauthentik/api";
|
|
|
|
|
2021-04-10 21:27:57 +00:00
|
|
|
import { ModalButton } from "../../elements/buttons/ModalButton";
|
2021-09-21 09:31:37 +00:00
|
|
|
import "../../elements/buttons/TokenCopyButton";
|
2021-04-10 10:19:32 +00:00
|
|
|
|
|
|
|
@customElement("ak-outpost-deployment-modal")
|
2021-04-10 21:27:57 +00:00
|
|
|
export class OutpostDeploymentModal extends ModalButton {
|
2021-08-03 15:52:21 +00:00
|
|
|
@property({ attribute: false })
|
2021-04-10 10:19:32 +00:00
|
|
|
outpost?: Outpost;
|
|
|
|
|
2021-04-10 21:27:57 +00:00
|
|
|
renderModalInner(): TemplateResult {
|
2021-04-10 10:19:32 +00:00
|
|
|
return html`<div class="pf-c-modal-box__header">
|
|
|
|
<h1 class="pf-c-title pf-m-2xl">${t`Outpost Deployment Info`}</h1>
|
|
|
|
</div>
|
|
|
|
<div class="pf-c-modal-box__body">
|
2021-08-03 15:52:21 +00:00
|
|
|
<p>
|
2021-10-20 14:31:10 +00:00
|
|
|
<a
|
|
|
|
target="_blank"
|
|
|
|
href="https://goauthentik.io/docs/outposts/outposts/?utm_source=authentik#deploy"
|
2021-08-03 15:52:21 +00:00
|
|
|
>${t`View deployment documentation`}</a
|
|
|
|
>
|
|
|
|
</p>
|
2021-04-10 10:19:32 +00:00
|
|
|
<form class="pf-c-form">
|
|
|
|
<div class="pf-c-form__group">
|
|
|
|
<label class="pf-c-form__label" for="help-text-simple-form-name">
|
|
|
|
<span class="pf-c-form__label-text">AUTHENTIK_HOST</span>
|
|
|
|
</label>
|
2021-08-03 15:52:21 +00:00
|
|
|
<input
|
|
|
|
class="pf-c-form-control"
|
|
|
|
readonly
|
|
|
|
type="text"
|
|
|
|
value="${document.location.origin}"
|
|
|
|
/>
|
2021-04-10 10:19:32 +00:00
|
|
|
</div>
|
|
|
|
<div class="pf-c-form__group">
|
|
|
|
<label class="pf-c-form__label" for="help-text-simple-form-name">
|
|
|
|
<span class="pf-c-form__label-text">AUTHENTIK_TOKEN</span>
|
|
|
|
</label>
|
|
|
|
<div>
|
2021-08-03 15:52:21 +00:00
|
|
|
<ak-token-copy-button
|
2021-09-26 12:34:28 +00:00
|
|
|
class="pf-m-primary"
|
2021-08-03 15:52:21 +00:00
|
|
|
identifier="${ifDefined(this.outpost?.tokenIdentifier)}"
|
|
|
|
>
|
2021-04-10 10:19:32 +00:00
|
|
|
${t`Click to copy token`}
|
|
|
|
</ak-token-copy-button>
|
|
|
|
</div>
|
|
|
|
</div>
|
2021-08-03 15:52:21 +00:00
|
|
|
<h3>
|
|
|
|
${t`If your authentik Instance is using a self-signed certificate, set this value.`}
|
|
|
|
</h3>
|
2021-04-10 10:19:32 +00:00
|
|
|
<div class="pf-c-form__group">
|
|
|
|
<label class="pf-c-form__label" for="help-text-simple-form-name">
|
|
|
|
<span class="pf-c-form__label-text">AUTHENTIK_INSECURE</span>
|
|
|
|
</label>
|
|
|
|
<input class="pf-c-form-control" readonly type="text" value="true" />
|
|
|
|
</div>
|
2021-09-08 18:04:56 +00:00
|
|
|
${this.outpost?.type == OutpostTypeEnum.Proxy
|
|
|
|
? html`
|
|
|
|
<h3>
|
|
|
|
${t`If your authentik_host setting does not match the URL you want to login with, add this setting.`}
|
|
|
|
</h3>
|
|
|
|
<div class="pf-c-form__group">
|
|
|
|
<label class="pf-c-form__label" for="help-text-simple-form-name">
|
|
|
|
<span class="pf-c-form__label-text"
|
|
|
|
>AUTHENTIK_HOST_BROWSER</span
|
|
|
|
>
|
|
|
|
</label>
|
|
|
|
<input
|
|
|
|
class="pf-c-form-control"
|
|
|
|
readonly
|
|
|
|
type="text"
|
|
|
|
value="${document.location.origin}"
|
|
|
|
/>
|
|
|
|
</div>
|
|
|
|
`
|
|
|
|
: html``}
|
2021-04-10 10:19:32 +00:00
|
|
|
</form>
|
|
|
|
</div>
|
|
|
|
<footer class="pf-c-modal-box__footer pf-m-align-left">
|
2021-08-03 15:52:21 +00:00
|
|
|
<button
|
|
|
|
class="pf-c-button pf-m-primary"
|
|
|
|
@click=${() => {
|
|
|
|
this.open = false;
|
|
|
|
}}
|
|
|
|
>
|
2021-04-10 21:27:57 +00:00
|
|
|
${t`Close`}
|
|
|
|
</button>
|
2021-04-10 10:19:32 +00:00
|
|
|
</footer>`;
|
|
|
|
}
|
|
|
|
}
|