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,12 +205,19 @@ export class LDAPSourceViewPage extends LitElement {
<div class="pf-c-card__footer">
<ak-action-button
.apiRequest=${() => {
return new SourcesApi(
DEFAULT_CONFIG,
).sourcesLdapPartialUpdate({
slug: this.source?.slug || "",
patchedLDAPSourceRequest: this.source,
});
return new SourcesApi(DEFAULT_CONFIG)
.sourcesLdapPartialUpdate({
slug: this.source?.slug || "",
patchedLDAPSourceRequest: this.source,
})
.then(() => {
this.dispatchEvent(
new CustomEvent(EVENT_REFRESH, {
bubbles: true,
composed: true,
}),
);
});
}}
>
${t`Run sync again`}

View File

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