import { gettext } from "django"; import { customElement, html, property, TemplateResult } from "lit-element"; import { Application } from "../../api/Applications"; import { PBResponse } from "../../api/Client"; import { TablePage } from "../../elements/table/TablePage"; import "../../elements/buttons/ModalButton"; import "../../elements/buttons/SpinnerButton"; import { TableColumn } from "../../elements/table/Table"; @customElement("ak-application-list") export class ApplicationList extends TablePage { searchEnabled(): boolean { return true; } pageTitle(): string { return gettext("Applications"); } pageDescription(): string { return gettext("External Applications which use authentik as Identity-Provider, utilizing protocols like OAuth2 and SAML."); } pageIcon(): string { return gettext("pf-icon pf-icon-applications"); } @property() order = "name"; apiEndpoint(page: number): Promise> { return Application.list({ ordering: this.order, page: page, search: this.search || "", }); } columns(): TableColumn[] { return [ new TableColumn(""), new TableColumn("Name", "name"), new TableColumn("Slug", "slug"), new TableColumn("Provider"), new TableColumn("Provider Type"), new TableColumn(""), ]; } row(item: Application): TemplateResult[] { return [ html` ${item.meta_icon ? html`${gettext(` : html``}`, html`
${item.name}
${item.meta_publisher ? html`${item.meta_publisher}` : html``}
`, html`${item.slug}`, html`${item.provider?.name}`, html`${item.provider?.verbose_name}`, html` Edit
Delete
`, ]; } renderToolbar(): TemplateResult { return html` ${gettext("Create")}
${super.renderToolbar()} `; } }