From 179f00b15525b024b6823088ef8fb94b7106b4f0 Mon Sep 17 00:00:00 2001 From: Mohamed Bassem Date: Mon, 30 Dec 2024 11:27:32 +0000 Subject: feat: Change the admin page to be tabbed similar to that of the settings page --- .../components/dashboard/admin/AdminActions.tsx | 137 --------------------- 1 file changed, 137 deletions(-) delete mode 100644 apps/web/components/dashboard/admin/AdminActions.tsx (limited to 'apps/web/components/dashboard/admin/AdminActions.tsx') diff --git a/apps/web/components/dashboard/admin/AdminActions.tsx b/apps/web/components/dashboard/admin/AdminActions.tsx deleted file mode 100644 index 3b95045c..00000000 --- a/apps/web/components/dashboard/admin/AdminActions.tsx +++ /dev/null @@ -1,137 +0,0 @@ -"use client"; - -import { ActionButton } from "@/components/ui/action-button"; -import { toast } from "@/components/ui/use-toast"; -import { useTranslation } from "@/lib/i18n/client"; -import { api } from "@/lib/trpc"; - -export default function AdminActions() { - const { t } = useTranslation(); - const { mutate: recrawlLinks, isPending: isRecrawlPending } = - api.admin.recrawlLinks.useMutation({ - onSuccess: () => { - toast({ - description: "Recrawl enqueued", - }); - }, - onError: (e) => { - toast({ - variant: "destructive", - description: e.message, - }); - }, - }); - - const { mutate: reindexBookmarks, isPending: isReindexPending } = - api.admin.reindexAllBookmarks.useMutation({ - onSuccess: () => { - toast({ - description: "Reindex enqueued", - }); - }, - onError: (e) => { - toast({ - variant: "destructive", - description: e.message, - }); - }, - }); - - const { - mutate: reRunInferenceOnAllBookmarks, - isPending: isInferencePending, - } = api.admin.reRunInferenceOnAllBookmarks.useMutation({ - onSuccess: () => { - toast({ - description: "Inference jobs enqueued", - }); - }, - onError: (e) => { - toast({ - variant: "destructive", - description: e.message, - }); - }, - }); - - 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 ( -
-
{t("common.actions")}
-
- - recrawlLinks({ crawlStatus: "failure", runInference: true }) - } - > - {t("admin.actions.recrawl_failed_links_only")} - - - recrawlLinks({ crawlStatus: "all", runInference: true }) - } - > - {t("admin.actions.recrawl_all_links")} - - - recrawlLinks({ crawlStatus: "all", runInference: false }) - } - > - {t("admin.actions.recrawl_all_links")} ( - {t("admin.actions.without_inference")}) - - - reRunInferenceOnAllBookmarks({ taggingStatus: "failure" }) - } - > - {t("admin.actions.regenerate_ai_tags_for_failed_bookmarks_only")} - - reRunInferenceOnAllBookmarks({ taggingStatus: "all" })} - > - {t("admin.actions.regenerate_ai_tags_for_all_bookmarks")} - - reindexBookmarks()} - > - {t("admin.actions.reindex_all_bookmarks")} - - tidyAssets()} - > - {t("admin.actions.compact_assets")} - -
-
- ); -} -- cgit v1.2.3-70-g09d2