core: fix user metrics not accepting detail
Signed-off-by: Jens Langhammer <jens.langhammer@beryju.org>
This commit is contained in:
@ -1,4 +1,4 @@
|
||||
import { customElement } from "lit-element";
|
||||
import { customElement, property } from "lit-element";
|
||||
import Chart from "chart.js";
|
||||
import { CoreApi, UserMetrics } from "authentik-api";
|
||||
import { AKChart } from "./Chart";
|
||||
@ -7,8 +7,13 @@ import { DEFAULT_CONFIG } from "../../api/Config";
|
||||
@customElement("ak-charts-user")
|
||||
export class UserChart extends AKChart<UserMetrics> {
|
||||
|
||||
@property()
|
||||
userId?: number;
|
||||
|
||||
apiRequest(): Promise<UserMetrics> {
|
||||
return new CoreApi(DEFAULT_CONFIG).coreUsersMetrics();
|
||||
return new CoreApi(DEFAULT_CONFIG).coreUsersMetrics({
|
||||
id: this.userId || 0,
|
||||
});
|
||||
}
|
||||
|
||||
getDatasets(data: UserMetrics): Chart.ChartDataSets[] {
|
||||
|
@ -167,7 +167,7 @@ export class UserViewPage extends Page {
|
||||
</div>
|
||||
<div class="pf-c-card pf-l-gallery__item pf-m-4-col" style="grid-column-end: span 4;grid-row-end: span 2;">
|
||||
<div class="pf-c-card__body">
|
||||
<ak-charts-user>
|
||||
<ak-charts-user userId=${this.user.pk}>
|
||||
</ak-charts-user>
|
||||
</div>
|
||||
</div>
|
||||
@ -177,7 +177,7 @@ export class UserViewPage extends Page {
|
||||
<div class="pf-c-card">
|
||||
<div class="pf-c-card__body">
|
||||
<ak-object-changelog
|
||||
targetModelPk=${this.user.pk || ""}
|
||||
targetModelPk=${this.user.pk || 0}
|
||||
targetModelApp="authentik_core"
|
||||
targetModelName="user">
|
||||
</ak-object-changelog>
|
||||
|
Reference in New Issue
Block a user