web/admin: migrate more components
Signed-off-by: Jens Langhammer <jens.langhammer@beryju.org>
This commit is contained in:
parent
9a44088d2b
commit
1f05484e3c
|
@ -11,7 +11,7 @@ export class ApplicationAuthorizeChart extends AKChart<Coordinate[]> {
|
||||||
applicationSlug!: string;
|
applicationSlug!: string;
|
||||||
|
|
||||||
apiRequest(): Promise<Coordinate[]> {
|
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 {
|
getChartData(data: Coordinate[]): ChartData {
|
||||||
|
|
|
@ -11,7 +11,7 @@ export class UserChart extends AKChart<UserMetrics> {
|
||||||
userId?: number;
|
userId?: number;
|
||||||
|
|
||||||
apiRequest(): Promise<UserMetrics> {
|
apiRequest(): Promise<UserMetrics> {
|
||||||
return new CoreApi(DEFAULT_CONFIG).coreUsersMetrics({
|
return new CoreApi(DEFAULT_CONFIG).coreUsersMetricsRetrieve({
|
||||||
id: this.userId || 0,
|
id: this.userId || 0,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
@ -14,7 +14,7 @@ import PFInputGroup from "@patternfly/patternfly/components/InputGroup/input-gro
|
||||||
import { MessageLevel } from "../messages/Message";
|
import { MessageLevel } from "../messages/Message";
|
||||||
import { IronFormElement } from "@polymer/iron-form/iron-form";
|
import { IronFormElement } from "@polymer/iron-form/iron-form";
|
||||||
import { camelToSnake, convertToSlug } from "../../utils";
|
import { camelToSnake, convertToSlug } from "../../utils";
|
||||||
import { ValidationError } from "authentik-api/src";
|
import { ValidationError } from "authentik-api";
|
||||||
import { EVENT_REFRESH } from "../../constants";
|
import { EVENT_REFRESH } from "../../constants";
|
||||||
|
|
||||||
export class APIError extends Error {
|
export class APIError extends Error {
|
||||||
|
|
|
@ -32,7 +32,7 @@ export class NotificationDrawer extends LitElement {
|
||||||
|
|
||||||
firstUpdated(): void {
|
firstUpdated(): void {
|
||||||
new EventsApi(DEFAULT_CONFIG).eventsNotificationsList({
|
new EventsApi(DEFAULT_CONFIG).eventsNotificationsList({
|
||||||
seen: "false",
|
seen: false,
|
||||||
ordering: "-created",
|
ordering: "-created",
|
||||||
}).then(r => {
|
}).then(r => {
|
||||||
this.notifications = 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=${() => {
|
<button class="pf-c-dropdown__toggle pf-m-plain" type="button" @click=${() => {
|
||||||
new EventsApi(DEFAULT_CONFIG).eventsNotificationsPartialUpdate({
|
new EventsApi(DEFAULT_CONFIG).eventsNotificationsPartialUpdate({
|
||||||
uuid: item.pk || "",
|
uuid: item.pk || "",
|
||||||
data: {
|
patchedNotificationRequest: {
|
||||||
seen: true,
|
seen: true,
|
||||||
}
|
}
|
||||||
}).then(() => {
|
}).then(() => {
|
||||||
|
|
|
@ -34,7 +34,7 @@ export class GroupCountStatusChart extends AKChart<GroupMetrics> {
|
||||||
pageSize: 1
|
pageSize: 1
|
||||||
})).pagination.count;
|
})).pagination.count;
|
||||||
const superusers = (await api.coreGroupsList({
|
const superusers = (await api.coreGroupsList({
|
||||||
isSuperuser: "true"
|
isSuperuser: true
|
||||||
})).pagination.count;
|
})).pagination.count;
|
||||||
this.centerText = count.toString();
|
this.centerText = count.toString();
|
||||||
return {
|
return {
|
||||||
|
|
|
@ -32,13 +32,13 @@ export class PolicyStatusChart extends AKChart<PolicyMetrics> {
|
||||||
|
|
||||||
async apiRequest(): Promise<PolicyMetrics> {
|
async apiRequest(): Promise<PolicyMetrics> {
|
||||||
const api = new PoliciesApi(DEFAULT_CONFIG);
|
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({
|
const count = (await api.policiesAllList({
|
||||||
pageSize: 1
|
pageSize: 1
|
||||||
})).pagination.count;
|
})).pagination.count;
|
||||||
const unbound = (await api.policiesAllList({
|
const unbound = (await api.policiesAllList({
|
||||||
bindingsIsnull: "true",
|
bindingsIsnull: true,
|
||||||
promptstageIsnull: "true",
|
promptstageIsnull: true,
|
||||||
})).pagination.count;
|
})).pagination.count;
|
||||||
this.centerText = count.toString();
|
this.centerText = count.toString();
|
||||||
return {
|
return {
|
||||||
|
|
Reference in New Issue