This repository has been archived on 2024-05-31. You can view files and clone it, but cannot push or open issues or pull requests.
authentik/web/src/pages/applications/ApplicationListPage.ts

53 lines
1.7 KiB
TypeScript
Raw Normal View History

import { gettext } from "django";
2020-11-30 22:49:33 +00:00
import { customElement } from "lit-element";
import { Application } from "../../api/application";
import { PBResponse } from "../../api/client";
import { TablePage } from "../../elements/table/TablePage";
2020-12-05 21:08:42 +00:00
@customElement("ak-application-list")
2020-11-30 22:49:33 +00:00
export class ApplicationList extends TablePage<Application> {
pageTitle(): string {
return gettext("Applications");
2020-11-30 22:49:33 +00:00
}
pageDescription(): string {
2020-12-05 21:08:42 +00:00
return gettext("External Applications which use authentik as Identity-Provider, utilizing protocols like OAuth2 and SAML.");
2020-11-30 22:49:33 +00:00
}
pageIcon(): string {
return gettext("pf-icon pf-icon-applications");
2020-11-30 22:49:33 +00:00
}
apiEndpoint(page: number): Promise<PBResponse<Application>> {
return Application.list({
ordering: "order",
page: page,
});
}
columns(): string[] {
return ["Name", "Slug", "Provider", "Provider Type", ""];
}
row(item: Application): string[] {
return [
item.name,
item.slug,
item.provider.toString(),
item.provider.toString(),
2020-11-30 22:49:33 +00:00
`
2020-12-05 21:08:42 +00:00
<ak-modal-button href="administration/policies/bindings/${item.pk}/update/">
<ak-spinner-button slot="trigger" class="pf-m-secondary">
2020-11-30 22:49:33 +00:00
Edit
2020-12-05 21:08:42 +00:00
</ak-spinner-button>
2020-11-30 22:49:33 +00:00
<div slot="modal"></div>
2020-12-05 21:08:42 +00:00
</ak-modal-button>
<ak-modal-button href="administration/policies/bindings/${item.pk}/delete/">
<ak-spinner-button slot="trigger" class="pf-m-danger">
2020-11-30 22:49:33 +00:00
Delete
2020-12-05 21:08:42 +00:00
</ak-spinner-button>
2020-11-30 22:49:33 +00:00
<div slot="modal"></div>
2020-12-05 21:08:42 +00:00
</ak-modal-button>
2020-11-30 22:49:33 +00:00
`,
];
}
}