web/admin: trigger refresh after syncing ldap

Signed-off-by: Jens Langhammer <jens.langhammer@beryju.org>
This commit is contained in:
Jens Langhammer 2021-09-19 15:34:02 +02:00
parent c85484fc00
commit dd290e264c
2 changed files with 26 additions and 9 deletions

View File

@ -205,11 +205,18 @@ export class LDAPSourceViewPage extends LitElement {
<div class="pf-c-card__footer"> <div class="pf-c-card__footer">
<ak-action-button <ak-action-button
.apiRequest=${() => { .apiRequest=${() => {
return new SourcesApi( return new SourcesApi(DEFAULT_CONFIG)
DEFAULT_CONFIG, .sourcesLdapPartialUpdate({
).sourcesLdapPartialUpdate({
slug: this.source?.slug || "", slug: this.source?.slug || "",
patchedLDAPSourceRequest: this.source, patchedLDAPSourceRequest: this.source,
})
.then(() => {
this.dispatchEvent(
new CustomEvent(EVENT_REFRESH, {
bubbles: true,
composed: true,
}),
);
}); });
}} }}
> >

View File

@ -10,6 +10,7 @@ import { TableColumn } from "../../elements/table/Table";
import { AdminApi, Task, StatusEnum } from "@goauthentik/api"; import { AdminApi, Task, StatusEnum } from "@goauthentik/api";
import { DEFAULT_CONFIG } from "../../api/Config"; import { DEFAULT_CONFIG } from "../../api/Config";
import { PFColor } from "../../elements/Label"; import { PFColor } from "../../elements/Label";
import { EVENT_REFRESH } from "../../constants";
@customElement("ak-system-task-list") @customElement("ak-system-task-list")
export class SystemTaskListPage extends TablePage<Task> { export class SystemTaskListPage extends TablePage<Task> {
@ -104,8 +105,17 @@ export class SystemTaskListPage extends TablePage<Task> {
this.taskStatus(item), this.taskStatus(item),
html`<ak-action-button html`<ak-action-button
.apiRequest=${() => { .apiRequest=${() => {
return new AdminApi(DEFAULT_CONFIG).adminSystemTasksRetryCreate({ return new AdminApi(DEFAULT_CONFIG)
.adminSystemTasksRetryCreate({
id: item.taskName, id: item.taskName,
})
.then(() => {
this.dispatchEvent(
new CustomEvent(EVENT_REFRESH, {
bubbles: true,
composed: true,
}),
);
}); });
}} }}
> >