import "@goauthentik/admin/policies/BoundPoliciesList"; import "@goauthentik/admin/providers/rac/EndpointForm"; import "@goauthentik/admin/rbac/ObjectPermissionModal"; import { DEFAULT_CONFIG } from "@goauthentik/common/api/config"; import "@goauthentik/elements/buttons/SpinnerButton"; import "@goauthentik/elements/forms/DeleteBulkForm"; import "@goauthentik/elements/forms/ModalForm"; import { PaginatedResponse, Table } from "@goauthentik/elements/table/Table"; import { TableColumn } from "@goauthentik/elements/table/Table"; import "@patternfly/elements/pf-tooltip/pf-tooltip.js"; import { msg } from "@lit/localize"; import { CSSResult, TemplateResult, html } from "lit"; import { customElement, property } from "lit/decorators.js"; import PFDescriptionList from "@patternfly/patternfly/components/DescriptionList/description-list.css"; import { Endpoint, RACProvider, RacApi, RbacPermissionsAssignedByUsersListModelEnum, } from "@goauthentik/api"; @customElement("ak-rac-endpoint-list") export class EndpointListPage extends Table { expandable = true; checkbox = true; clearOnRefresh = true; searchEnabled(): boolean { return true; } @property() order = "name"; @property({ attribute: false }) provider?: RACProvider; static get styles(): CSSResult[] { return super.styles.concat(PFDescriptionList); } async apiEndpoint(): Promise> { return new RacApi(DEFAULT_CONFIG).racEndpointsList({ ...(await this.defaultEndpointConfig()), provider: this.provider?.pk, superuserFullList: true, }); } columns(): TableColumn[] { return [ new TableColumn(msg("Name"), "name"), new TableColumn(msg("Host"), "host"), new TableColumn(msg("Actions")), ]; } renderToolbarSelected(): TemplateResult { const disabled = this.selectedElements.length < 1; return html` { return [ { key: msg("Name"), value: item.name }, { key: msg("Host"), value: item.host }, ]; }} .usedBy=${(item: Endpoint) => { return new RacApi(DEFAULT_CONFIG).racEndpointsUsedByList({ pbmUuid: item.pk, }); }} .delete=${(item: Endpoint) => { return new RacApi(DEFAULT_CONFIG).racEndpointsDestroy({ pbmUuid: item.pk, }); }} > `; } row(item: Endpoint): TemplateResult[] { return [ html`${item.name}`, html`${item.host}`, html` ${msg("Update")} ${msg("Update Endpoint")} `, ]; } renderExpanded(item: Endpoint): TemplateResult { return html`

${msg( "These bindings control which users will have access to this endpoint. Users must also have access to the application.", )}

`; } renderObjectCreate(): TemplateResult { return html` ${msg("Create")} ${msg("Create Endpoint")} `; } }