web/admin: migrate more components

Signed-off-by: Jens Langhammer <jens.langhammer@beryju.org>
This commit is contained in:
Jens Langhammer 2021-05-16 17:51:58 +02:00
parent 9a44088d2b
commit 1f05484e3c
6 changed files with 9 additions and 9 deletions

View File

@ -11,7 +11,7 @@ export class ApplicationAuthorizeChart extends AKChart<Coordinate[]> {
applicationSlug!: string;
apiRequest(): Promise<Coordinate[]> {
return new CoreApi(DEFAULT_CONFIG).coreApplicationsMetrics({ slug: this.applicationSlug });
return new CoreApi(DEFAULT_CONFIG).coreApplicationsMetricsList({ slug: this.applicationSlug });
}
getChartData(data: Coordinate[]): ChartData {

View File

@ -11,7 +11,7 @@ export class UserChart extends AKChart<UserMetrics> {
userId?: number;
apiRequest(): Promise<UserMetrics> {
return new CoreApi(DEFAULT_CONFIG).coreUsersMetrics({
return new CoreApi(DEFAULT_CONFIG).coreUsersMetricsRetrieve({
id: this.userId || 0,
});
}

View File

@ -14,7 +14,7 @@ import PFInputGroup from "@patternfly/patternfly/components/InputGroup/input-gro
import { MessageLevel } from "../messages/Message";
import { IronFormElement } from "@polymer/iron-form/iron-form";
import { camelToSnake, convertToSlug } from "../../utils";
import { ValidationError } from "authentik-api/src";
import { ValidationError } from "authentik-api";
import { EVENT_REFRESH } from "../../constants";
export class APIError extends Error {

View File

@ -32,7 +32,7 @@ export class NotificationDrawer extends LitElement {
firstUpdated(): void {
new EventsApi(DEFAULT_CONFIG).eventsNotificationsList({
seen: "false",
seen: false,
ordering: "-created",
}).then(r => {
this.notifications = r;
@ -73,7 +73,7 @@ export class NotificationDrawer extends LitElement {
<button class="pf-c-dropdown__toggle pf-m-plain" type="button" @click=${() => {
new EventsApi(DEFAULT_CONFIG).eventsNotificationsPartialUpdate({
uuid: item.pk || "",
data: {
patchedNotificationRequest: {
seen: true,
}
}).then(() => {

View File

@ -34,7 +34,7 @@ export class GroupCountStatusChart extends AKChart<GroupMetrics> {
pageSize: 1
})).pagination.count;
const superusers = (await api.coreGroupsList({
isSuperuser: "true"
isSuperuser: true
})).pagination.count;
this.centerText = count.toString();
return {

View File

@ -32,13 +32,13 @@ export class PolicyStatusChart extends AKChart<PolicyMetrics> {
async apiRequest(): Promise<PolicyMetrics> {
const api = new PoliciesApi(DEFAULT_CONFIG);
const cached = (await api.policiesAllCacheInfo()).count || 0;
const cached = (await api.policiesAllCacheInfoRetrieve()).count || 0;
const count = (await api.policiesAllList({
pageSize: 1
})).pagination.count;
const unbound = (await api.policiesAllList({
bindingsIsnull: "true",
promptstageIsnull: "true",
bindingsIsnull: true,
promptstageIsnull: true,
})).pagination.count;
this.centerText = count.toString();
return {