import { t } from "@lingui/macro"; import { customElement, property } from "lit-element"; import { html, TemplateResult } from "lit-html"; import { AKResponse } from "../../api/Client"; import { TableColumn } from "../../elements/table/Table"; import { TablePage } from "../../elements/table/TablePage"; import "./OutpostHealth"; import "./OutpostForm"; import "../../elements/buttons/SpinnerButton"; import "../../elements/buttons/TokenCopyButton"; import "../../elements/forms/DeleteForm"; import "../../elements/forms/ModalForm"; import { PAGE_SIZE } from "../../constants"; import { Outpost, OutpostsApi } from "authentik-api"; import { DEFAULT_CONFIG } from "../../api/Config"; import { ifDefined } from "lit-html/directives/if-defined"; @customElement("ak-outpost-list") export class OutpostListPage extends TablePage { pageTitle(): string { return t`Outposts`; } pageDescription(): string | undefined { return t`Outposts are deployments of authentik components to support different environments and protocols, like reverse proxies.`; } pageIcon(): string { return "pf-icon pf-icon-zone"; } searchEnabled(): boolean { return true; } apiEndpoint(page: number): Promise> { return new OutpostsApi(DEFAULT_CONFIG).outpostsOutpostsList({ ordering: this.order, page: page, pageSize: PAGE_SIZE, search: this.search || "", }); } columns(): TableColumn[] { return [ new TableColumn(t`Name`, t`name`), new TableColumn("Providers"), new TableColumn("Health and Version"), new TableColumn(""), ]; } @property() order = "name"; row(item: Outpost): TemplateResult[] { return [ html`${item.name}`, html``, html``, html` ${t`Update`} ${t`Update Outpost`} { return new OutpostsApi(DEFAULT_CONFIG).outpostsOutpostsDelete({ uuid: item.pk || "" }); }}>

${t`Outpost Deployment Info`}

`, ]; } renderToolbar(): TemplateResult { return html` ${t`Create`} ${t`Create Outpost`} ${super.renderToolbar()} `; } }