import { gettext } from "django"; import { customElement, property } from "lit-element"; import { html, TemplateResult } from "lit-html"; import { AKResponse } from "../../api/Client"; import { OutpostServiceConnection } from "../../api/Outposts"; import { TableColumn } from "../../elements/table/Table"; import { TablePage } from "../../elements/table/TablePage"; import "./OutpostHealth"; import "../../elements/buttons/SpinnerButton"; import "../../elements/buttons/ModalButton"; import "../../elements/buttons/Dropdown"; import { until } from "lit-html/directives/until"; @customElement("ak-outpost-service-connection-list") export class OutpostServiceConnectionListPage extends TablePage { pageTitle(): string { return "Outpost Service-Connections"; } pageDescription(): string | undefined { return "Outpost Service-Connections define how authentik connects to external platforms to manage and deploy Outposts."; } pageIcon(): string { return "pf-icon pf-icon-integration"; } searchEnabled(): boolean { return true; } apiEndpoint(page: number): Promise> { return OutpostServiceConnection.list({ ordering: this.order, page: page, search: this.search || "", }); } columns(): TableColumn[] { return [ new TableColumn("Name", "name"), new TableColumn("Type"), new TableColumn("Local", "local"), new TableColumn("State"), new TableColumn(""), ]; } @property() order = "name"; row(item: OutpostServiceConnection): TemplateResult[] { return [ html`${item.name}`, html`${item.verbose_name}`, html`${item.local ? "Yes" : "No"}`, html`${until(OutpostServiceConnection.state(item.pk).then((state) => { if (state.healthy) { return html` ${state.version}`; } return html` ${gettext("Unhealthy")}`; }), html``)}`, html` ${gettext("Edit")}
${gettext("Delete")}
`, ]; } renderToolbar(): TemplateResult { return html` ${super.renderToolbar()}`; } }