diff options
| author | MohamedBassem <me@mbassem.com> | 2024-10-12 16:47:22 +0000 |
|---|---|---|
| committer | MohamedBassem <me@mbassem.com> | 2024-10-12 17:37:42 +0000 |
| commit | c16173ea0fdbf6cc47b13756c0a77e8399669055 (patch) | |
| tree | 6b3ecd073259176059386eb16c6635e4699d26a3 /apps/web/components/dashboard/admin/AdminActions.tsx | |
| parent | 9f87207d668fbe0a2039c63803128fbe5916f993 (diff) | |
| download | karakeep-c16173ea0fdbf6cc47b13756c0a77e8399669055.tar.zst | |
feature: Introduce a mechanism to cleanup dangling assets
Diffstat (limited to 'apps/web/components/dashboard/admin/AdminActions.tsx')
| -rw-r--r-- | apps/web/components/dashboard/admin/AdminActions.tsx | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/apps/web/components/dashboard/admin/AdminActions.tsx b/apps/web/components/dashboard/admin/AdminActions.tsx index dfdf65eb..e5d6ed69 100644 --- a/apps/web/components/dashboard/admin/AdminActions.tsx +++ b/apps/web/components/dashboard/admin/AdminActions.tsx @@ -52,6 +52,21 @@ export default function AdminActions() { }, }); + const { mutateAsync: tidyAssets, isPending: isTidyAssetsPending } = + api.admin.tidyAssets.useMutation({ + onSuccess: () => { + toast({ + description: "Tidy assets request has been enqueued!", + }); + }, + onError: (e) => { + toast({ + variant: "destructive", + description: e.message, + }); + }, + }); + return ( <div> <div className="mb-2 mt-8 text-xl font-medium">Actions</div> @@ -97,6 +112,13 @@ export default function AdminActions() { > Reindex All Bookmarks </ActionButton> + <ActionButton + variant="destructive" + loading={isTidyAssetsPending} + onClick={() => tidyAssets()} + > + Compact Assets + </ActionButton> </div> </div> ); |
