From a07ce35985cdc12c57ca1ed43181ce1e1b743e98 Mon Sep 17 00:00:00 2001 From: Marc 'risson' Schmitt Date: Wed, 5 Mar 2025 20:23:10 +0100 Subject: [PATCH] web/admin: add button to clear application cache (#13399) Signed-off-by: Marc 'risson' Schmitt --- .../admin/applications/ApplicationListPage.ts | 25 ++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) diff --git a/web/src/admin/applications/ApplicationListPage.ts b/web/src/admin/applications/ApplicationListPage.ts index 72b794925f..12469ff379 100644 --- a/web/src/admin/applications/ApplicationListPage.ts +++ b/web/src/admin/applications/ApplicationListPage.ts @@ -20,7 +20,7 @@ import { ifDefined } from "lit/directives/if-defined.js"; import PFCard from "@patternfly/patternfly/components/Card/card.css"; -import { Application, CoreApi } from "@goauthentik/api"; +import { Application, CoreApi, PoliciesApi } from "@goauthentik/api"; import "./ApplicationWizardHint"; @@ -172,6 +172,29 @@ export class ApplicationListPage extends WithBrandConfig(TablePage) `; } + + renderToolbar(): TemplateResult { + return html` ${super.renderToolbar()} + { + return new PoliciesApi(DEFAULT_CONFIG).policiesAllCacheClearCreate(); + }} + > + ${msg("Clear Application cache")} +

+ ${msg( + "Are you sure you want to clear the application cache? This will cause all policies to be re-evaluated on their next usage.", + )} +

+ +
+
`; + } } declare global {