Skip to content

⚡️⚡️⚡️ Self-hosted collaborative bookmark manager to collect, read, annotate, and fully preserve what matters, all in one place.

feat(admin): implement admin layout and sidebar, add user administration and background jobs pages

daniel31x138c9cd34ec3ec
diff --git a/apps/web/components/AdminSidebar.tsx b/apps/web/components/AdminSidebar.tsx
new file mode 100644
index 00000000..b6ab5273
--- /dev/null
+++ b/apps/web/components/AdminSidebar.tsx
@@ -0,0 +1,125 @@
+import Link from "next/link";
+import { useRouter } from "next/router";
+import React, { useEffect, useState } from "react";
+import { useTranslation } from "next-i18next";
+import { useUser } from "@linkwarden/router/user";
+import Image from "next/image";
+
+export default function AdminSidebar({ className }: { className?: string }) {
+ const { t } = useTranslation();
+ const LINKWARDEN_VERSION = process.env.version;
+
+ const { data: user } = useUser();
+
+ const router = useRouter();
+ const [active, setActive] = useState("");
+
+ useEffect(() => {
+ setActive(router.asPath);
+ }, [router]);
+
+ return (
+ <div
+ className={`bg-base-200 h-screen w-80 overflow-y-auto border-solid border border-base-200 border-r-neutral-content p-2 z-20 flex flex-col gap-5 justify-between ${
+ className || ""
+ }`}
+ >
+ <div className="flex flex-col gap-1">
+ <div className="flex items-center justify-between mb-4">
+ {user?.theme === "light" ? (
+ <Image
+ src={"/linkwarden_light.png"}
+ width={640}
+ height={136}
+ alt="Linkwarden"
+ className="h-9 w-auto cursor-pointer"
+ onClick={() => router.push("/dashboard")}
+ priority
+ />
+ ) : (
+ <Image
+ src={"/linkwarden_dark.png"}
+ width={640}
+ height={136}
+ alt="Linkwarden"
+ className="h-9 w-auto cursor-pointer"
+ onClick={() => router.push("/dashboard")}
+ priority
+ />
+ )}
+ </div>
+ <Link href="/admin/user-administration">
+ <div
+ className={`${
+ active === "/admin/user-administration"
+ ? "bg-primary/20"
+ : "hover:bg-neutral/20"
+ } duration-200 cursor-pointer flex items-center gap-2 rounded-lg px-3 py-1`}
+ >
+ <i className="bi-people text-primary text-xl drop-shadow"></i>
+ <p className="truncate w-full font-semibold text-sm">
+ {t("user_administration")}
+ </p>
+ </div>
+ </Link>
+
+ <Link href="/admin/background-jobs">
+ <div
+ className={`${
+ active === "/admin/background-jobs"
+ ? "bg-primary/20"
+ : "hover:bg-neutral/20"
+ } duration-200 cursor-pointer flex items-center gap-2 rounded-lg px-3 py-1`}
+ >
+ <i className="bi-gear-wide-connected text-primary text-xl drop-shadow"></i>
+ <p className="truncate w-full font-semibold text-sm">
+ {t("background_jobs")}
+ </p>
+ </div>
+ </Link>
+ </div>
+
+ <div className="flex flex-col gap-1">
+ <Link
+ href={`https://github.com/linkwarden/linkwarden/releases`}
+ target="_blank"
+ className="text-neutral text-sm ml-2 hover:opacity-50 duration-100"
+ >
+ {t("linkwarden_version", { version: LINKWARDEN_VERSION })}
+ </Link>
+ <Link href="https://docs.linkwarden.app" target="_blank">
+ <div
+ className={`hover:bg-neutral/20 duration-200 cursor-pointer flex items-center gap-2 rounded-lg px-3 py-1`}
+ >
+ <i className="bi-question-circle text-primary text-xl drop-shadow"></i>
+ <p className="truncate w-full font-semibold text-sm">{t("help")}</p>
+ </div>
+ </Link>
+ <Link href="https://github.com/linkwarden/linkwarden" target="_blank">
+ <div
+ className={`hover:bg-neutral/20 duration-200 cursor-pointer flex items-center gap-2 rounded-lg px-3 py-1`}
+ >
+ <i className="bi-github text-primary text-xl drop-shadow"></i>
+ <p className="truncate w-full font-semibold text-sm">{t("github")}</p>
+ </div>
+ </Link>
+ <Link href="https://twitter.com/LinkwardenHQ" target="_blank">
+ <div
+ className={`hover:bg-neutral/20 duration-200 cursor-pointer flex items-center gap-2 rounded-lg px-3 py-1`}
+ >
+ <i className="bi-twitter-x text-primary text-xl drop-shadow"></i>
+ <p className="truncate w-full font-semibold text-sm">{t("twitter")}</p>
+ </div>
+ </Link>
+ <Link href="https://fosstodon.org/@linkwarden" target="_blank">
+ <div
+ className={`hover:bg-neutral/20 duration-200 cursor-pointer flex items-center gap-2 rounded-lg px-3 py-1`}
+ >
+ <i className="bi-mastodon text-primary text-xl drop-shadow"></i>
+ <p className="truncate w-full font-semibold text-sm">{t("mastodon")}</p>
+ </div>
+ </Link>
+ </div>
+ </div>
+ );
+}
diff --git a/apps/web/components/Navbar.tsx b/apps/web/components/Navbar.tsx
index b36b988d..c18896bb 100644
--- a/apps/web/components/Navbar.tsx
+++ b/apps/web/components/Navbar.tsx
@@ -27,12 +27,19 @@ import {
import { useUser } from "@linkwarden/router/user";
import Link from "next/link";
import SettingsSidebar from "@/components/SettingsSidebar";
+import AdminSidebar from "@/components/AdminSidebar";
const STRIPE_ENABLED = process.env.NEXT_PUBLIC_STRIPE === "true";
const TRIAL_PERIOD_DAYS =
Number(process.env.NEXT_PUBLIC_TRIAL_PERIOD_DAYS) || 14;
-export default function Navbar({ settings }: { settings?: boolean }) {
+export default function Navbar({
+ settings,
+ admin,
+}: {
+ settings?: boolean;
+ admin?: boolean;
+}) {
const { t } = useTranslation();
const router = useRouter();
const { data: user } = useUser();
@@ -163,7 +170,13 @@ export default function Navbar({ settings }: { settings?: boolean }) {
<div className="fixed top-0 bottom-0 right-0 left-0 bg-black bg-opacity-10 backdrop-blur-sm flex items-center fade-in z-40">
<ClickAwayHandler className="h-full" onClickOutside={toggleSidebar}>
<div className="slide-right h-full shadow-lg">
- {settings ? <SettingsSidebar /> : <Sidebar />}
+ {admin ? (
+ <AdminSidebar />
+ ) : settings ? (
+ <SettingsSidebar />
+ ) : (
+ <Sidebar />
+ )}
</div>
</ClickAwayHandler>
</div>
diff --git a/apps/web/components/ProfileDropdown.tsx b/apps/web/components/ProfileDropdown.tsx
index 44722595..9e6fcaef 100644
--- a/apps/web/components/ProfileDropdown.tsx
+++ b/apps/web/components/ProfileDropdown.tsx
@@ -65,7 +65,7 @@ export default function ProfileDropdown() {
{isAdmin && (
<DropdownMenuItem asChild>
<Link
- href="/admin"
+ href="/admin/user-administration"
onClick={() => (document?.activeElement as HTMLElement)?.blur()}
className="whitespace-nowrap"
>
diff --git a/apps/web/components/SettingsSidebar.tsx b/apps/web/components/SettingsSidebar.tsx
index 62ca6383..a22cef85 100644
--- a/apps/web/components/SettingsSidebar.tsx
+++ b/apps/web/components/SettingsSidebar.tsx
@@ -123,21 +123,6 @@ export default function SettingsSidebar({ className }: { className?: string }) {
</div>
</Link>
- <Link href="/settings/background-jobs">
- <div
- className={`${
- active === "/settings/background-jobs"
- ? "bg-primary/20"
- : "hover:bg-neutral/20"
- } duration-200 cursor-pointer flex items-center gap-2 rounded-lg px-3 py-1`}
- >
- <i className="bi-gear-wide-connected text-primary text-xl drop-shadow"></i>
- <p className="truncate w-full font-semibold text-sm">
- {t("background_jobs")}
- </p>
- </div>
- </Link>
-
{process.env.NEXT_PUBLIC_STRIPE && !user?.parentSubscriptionId && (
<Link href="/settings/billing">
<div
diff --git a/apps/web/layouts/AdminLayout.tsx b/apps/web/layouts/AdminLayout.tsx
new file mode 100644
index 00000000..e8b95e5d
--- /dev/null
+++ b/apps/web/layouts/AdminLayout.tsx
@@ -0,0 +1,38 @@
+import AdminSidebar from "@/components/AdminSidebar";
+import Navbar from "@/components/Navbar";
+import React, { ReactNode } from "react";
+import Link from "next/link";
+import { Button } from "@/components/ui/button";
+import { useTranslation } from "next-i18next";
+
+interface Props {
+ children: ReactNode;
+}
+
+export default function AdminLayout({ children }: Props) {
+ const { t } = useTranslation();
+
+ return (
+ <div className="flex" data-testid="admin-wrapper">
+ <div className="hidden lg:block">
+ <AdminSidebar />
+ </div>
+
+ <div className="lg:w-[calc(100%-320px)] w-full sm:pb-0 pb-20 flex flex-col h-screen overflow-y-auto">
+ <Navbar admin />
+ <div className="p-5 mx-auto w-full max-w-7xl">
+ <div className="gap-2 mb-3">
+ <Button asChild variant="ghost" size="sm" className="text-neutral">
+ <Link href="/dashboard">
+ <i className="bi-chevron-left text-md" />
+ <p>{t("back_to_dashboard")}</p>
+ </Link>
+ </Button>
+ </div>
+
+ {children}
+ </div>
+ </div>
+ </div>
+ );
+}
diff --git a/apps/web/pages/admin/background-jobs.tsx b/apps/web/pages/admin/background-jobs.tsx
new file mode 100644
index 00000000..558fe01c
--- /dev/null
+++ b/apps/web/pages/admin/background-jobs.tsx
@@ -0,0 +1,205 @@
+import AdminLayout from "@/layouts/AdminLayout";
+import { Trans, useTranslation } from "next-i18next";
+import getServerSideProps from "@/lib/client/getServerSideProps";
+import { ReactElement, useEffect, useState } from "react";
+import ConfirmationModal from "@/components/ConfirmationModal";
+import { DeletePreservationsSchemaType } from "@linkwarden/lib/schemaValidation";
+import toast from "react-hot-toast";
+import { useDeletePreservations, useWorker } from "@linkwarden/router/worker";
+import { Button } from "@/components/ui/button";
+import { Separator } from "@/components/ui/separator";
+import { NextPageWithLayout } from "../_app";
+import { useConfig } from "@linkwarden/router/config";
+import { useUser } from "@linkwarden/router/user";
+import { useRouter } from "next/router";
+
+const Page: NextPageWithLayout = () => {
+ const { t } = useTranslation();
+ const deletePreservations = useDeletePreservations();
+ const workerStats = useWorker();
+ const [showModal, setShowModal] = useState(false);
+ const [submitLoader, setSubmitLoader] = useState(false);
+ const [action, setAction] = useState<
+ DeletePreservationsSchemaType["action"] | undefined
+ >();
+
+ const { data: config } = useConfig();
+ const { data: user } = useUser();
+ const router = useRouter();
+
+ useEffect(() => {
+ if (config && user && user?.id !== (config?.ADMIN || 1)) {
+ console.log(config, user);
+ router.replace("/dashboard");
+ }
+ }, [config, user]);
+
+ useEffect(() => {
+ if (showModal === false) {
+ setAction(undefined);
+ }
+ }, [showModal]);
+
+ const submit = async (action: DeletePreservationsSchemaType["action"]) => {
+ if (!action || submitLoader) return;
+ setSubmitLoader(true);
+
+ const load = toast.loading(t("deleting"));
+
+ await deletePreservations.mutateAsync(
+ { action },
+ {
+ onSettled: (data, error) => {
+ setSubmitLoader(false);
+ toast.dismiss(load);
+
+ if (error) {
+ toast.error(error.message);
+ } else {
+ toast.success(t("links_are_being_represerved"));
+ }
+ },
+ }
+ );
+ };
+
+ return (
+ <>
+ <div className="flex items-center gap-2">
+ <i className="bi-gear-wide-connected text-primary text-2xl"></i>
+ <p className="capitalize text-3xl font-thin inline">
+ {t("background_jobs")}
+ </p>
+ </div>
+
+ <Separator className="my-3" />
+
+ <p>{t("background_jobs_desc")}</p>
+
+ <div className="flex items-center gap-2 my-3">
+ <p className="capitalize text-2xl font-thin inline">
+ {t("link_preservation_job")}
+ </p>
+ </div>
+
+ <Separator className="my-3" />
+
+ <div className="flex flex-col sm:flex-row gap-3 justify-between items-start">
+ <div>
+ <p>{t("link_preservation_job_desc")}</p>
+ <div className="mt-3 flex gap-3">
+ <div className="flex gap-1 border border-warning bg-warning/20 rounded-md px-2 py-1 w-max">
+ <i className="bi-hourglass-split text-warning text-xl" />
+ <p>{workerStats.data?.link.pending}</p>
+ <p>{t("pending")}</p>
+ </div>
+
+ <div className="flex gap-1 border border-success bg-success/20 rounded-md px-2 py-1 w-max">
+ <i className="bi-check2 text-success text-xl" />
+ <p>{workerStats.data?.link.done}</p>
+ <p>{t("done")}</p>
+ </div>
+ </div>
+ </div>
+ <div className="flex gap-3 flex-col">
+ <Button
+ onClick={() => {
+ setAction("allBroken");
+ setShowModal(true);
+ }}
+ variant="metal"
+ >
+ {t("regenerate_broken_links")}
+ </Button>
+ <Button
+ variant="destructive"
+ onClick={() => {
+ setAction("allAndRePreserve");
+ setShowModal(true);
+ }}
+ >
+ {t("regenerate_all_links")}
+ </Button>
+ </div>
+ </div>
+
+ <div className="flex items-center gap-2 my-3">
+ <p className="capitalize text-2xl font-thin inline">
+ {t("search_indexing_job")}
+ </p>
+ </div>
+
+ <Separator className="my-3" />
+
+ <p>{t("search_indexing_job_desc")}</p>
+
+ <p>{t("worker_pending_indexing_desc")}</p>
+
+ <div className="mt-3 flex gap-3">
+ <div className="flex gap-1 border border-warning bg-warning/20 rounded-md px-2 py-1 w-max">
+ <i className="bi-hourglass-split text-warning text-xl" />
+ <p>{workerStats.data?.search.pending}</p>
+ <p>{t("pending")}</p>
+ </div>
+
+ <div className="flex gap-1 border border-success bg-success/20 rounded-md px-2 py-1 w-max">
+ <i className="bi-check2 text-success text-xl" />
+ <p>{workerStats.data?.search.done}</p>
+ <p>{t("done")}</p>
+ </div>
+ </div>
+
+ {showModal && action === "allBroken" && (
+ <ConfirmationModal
+ title={t("regenerate_broken_links")}
+ onConfirmed={() => submit(action)}
+ toggleModal={setShowModal}
+ >
+ <ul className="px-5 list-disc">
+ <Trans
+ i18nKey="regenerate_broken_preserved_content_desc"
+ components={[<li />]}
+ values={{
+ count: workerStats.data?.link.failed,
+ }}
+ />
+ </ul>
+ <div role="alert" className="alert alert-warning mt-3">
+ <i className="bi-exclamation-triangle text-xl" />
+ <span>
+ <b>{t("warning")}:</b> {t("irreversible_action_warning")}
+ </span>
+ </div>
+ </ConfirmationModal>
+ )}
+ {showModal && action === "allAndRePreserve" && (
+ <ConfirmationModal
+ title={t("regenerate_all_links")}
+ onConfirmed={() => submit(action)}
+ toggleModal={setShowModal}
+ >
+ <ul className="px-5 list-disc">
+ <Trans
+ i18nKey="delete_all_preserved_content_and_regenerate_desc"
+ components={[<li />]}
+ />
+ </ul>
+ <div role="alert" className="alert alert-warning mt-3">
+ <i className="bi-exclamation-triangle text-xl" />
+ <span>
+ <b>{t("warning")}:</b> {t("irreversible_action_warning")}
+ </span>
+ </div>
+ </ConfirmationModal>
+ )}
+ </>
+ );
+};
+
+Page.getLayout = function getLayout(page: ReactElement) {
+ return <AdminLayout>{page}</AdminLayout>;
+};
+
+export default Page;
+
+export { getServerSideProps };
diff --git a/apps/web/pages/admin/index.tsx b/apps/web/pages/admin/index.tsx
new file mode 100644
index 00000000..84cfe8b0
--- /dev/null
+++ b/apps/web/pages/admin/index.tsx
@@ -0,0 +1,14 @@
+import type { GetServerSideProps } from "next";
+
+export const getServerSideProps: GetServerSideProps = async () => {
+ return {
+ redirect: {
+ destination: "/admin/user-administration",
+ permanent: false,
+ },
+ };
+};
+
+export default function AdminRedirect() {
+ return null;
+}
diff --git a/apps/web/pages/admin.tsx b/apps/web/pages/admin/user-administration.tsx
similarity index 91%
rename from apps/web/pages/admin.tsx
rename to apps/web/pages/admin/user-administration.tsx
index 3859821c..ef1ee9eb 100644
--- a/apps/web/pages/admin.tsx
+++ b/apps/web/pages/admin/user-administration.tsx
@@ -1,7 +1,6 @@
import NewUserModal from "@/components/ModalContent/NewUserModal";
import { User as U } from "@linkwarden/prisma/client";
-import Link from "next/link";
-import { useEffect, useState } from "react";
+import { ReactElement, useEffect, useState } from "react";
import { useTranslation } from "next-i18next";
import getServerSideProps from "@/lib/client/getServerSideProps";
import UserListing from "@/components/UserListing";
@@ -11,6 +10,8 @@ import { Separator } from "@/components/ui/separator";
import { useConfig } from "@linkwarden/router/config";
import { useRouter } from "next/router";
import { useUser } from "@linkwarden/router/user";
+import AdminLayout from "@/layouts/AdminLayout";
+import { NextPageWithLayout } from "../_app";
interface User extends U {
subscriptions: {
@@ -23,7 +24,7 @@ type UserModal = {
userId: number | null;
};
-export default function Admin() {
+const Page: NextPageWithLayout = () => {
const { t } = useTranslation();
const { data: users = [] } = useUsers();
@@ -63,14 +64,9 @@ export default function Admin() {
};
return (
- <div className="max-w-6xl mx-auto p-5">
+ <div>
<div className="flex sm:flex-row flex-col justify-between gap-2">
<div className="gap-2 inline-flex items-center">
- <Button variant="ghost" size="icon">
- <Link href="/dashboard" className="text-neutral">
- <i className="bi-chevron-left text-xl"></i>
- </Link>
- </Button>
<p className="capitalize text-3xl font-thin inline">
{t("user_administration")}
</p>
@@ -131,6 +127,12 @@ export default function Admin() {
{newUserModal && <NewUserModal onClose={() => setNewUserModal(false)} />}
</div>
);
-}
+};
+
+Page.getLayout = function getLayout(page: ReactElement) {
+ return <AdminLayout>{page}</AdminLayout>;
+};
+
+export default Page;
export { getServerSideProps };
diff --git a/apps/web/pages/settings/background-jobs.tsx b/apps/web/pages/settings/background-jobs.tsx
index 71fd0d3a..45b47bc9 100644
--- a/apps/web/pages/settings/background-jobs.tsx
+++ b/apps/web/pages/settings/background-jobs.tsx
@@ -1,205 +1,14 @@
-import SettingsLayout from "@/layouts/SettingsLayout";
-import { Trans, useTranslation } from "next-i18next";
-import getServerSideProps from "@/lib/client/getServerSideProps";
-import { ReactElement, use, useEffect, useState } from "react";
-import ConfirmationModal from "@/components/ConfirmationModal";
-import { DeletePreservationsSchemaType } from "@linkwarden/lib/schemaValidation";
-import toast from "react-hot-toast";
-import { useDeletePreservations, useWorker } from "@linkwarden/router/worker";
-import { Button } from "@/components/ui/button";
-import { Separator } from "@/components/ui/separator";
-import { NextPageWithLayout } from "../_app";
-import { useConfig } from "@linkwarden/router/config";
-import { useUser } from "@linkwarden/router/user";
-import { useRouter } from "next/router";
-
-const Page: NextPageWithLayout = () => {
- const { t } = useTranslation();
- const deletePreservations = useDeletePreservations();
- const workerStats = useWorker();
- const [showModal, setShowModal] = useState(false);
- const [submitLoader, setSubmitLoader] = useState(false);
- const [action, setAction] = useState<
- DeletePreservationsSchemaType["action"] | undefined
- >();
-
- const { data: config } = useConfig();
- const { data: user } = useUser();
- const router = useRouter();
-
- useEffect(() => {
- if (config && user && user?.id !== (config?.ADMIN || 1)) {
- console.log(config, user);
- router.replace("/dashboard");
- }
- }, [config, user]);
-
- useEffect(() => {
- if (showModal === false) {
- setAction(undefined);
- }
- }, [showModal]);
-
- const submit = async (action: DeletePreservationsSchemaType["action"]) => {
- if (!action || submitLoader) return;
- setSubmitLoader(true);
-
- const load = toast.loading(t("deleting"));
-
- await deletePreservations.mutateAsync(
- { action },
- {
- onSettled: (data, error) => {
- setSubmitLoader(false);
- toast.dismiss(load);
-
- if (error) {
- toast.error(error.message);
- } else {
- toast.success(t("links_are_being_represerved"));
- }
- },
- }
- );
+import type { GetServerSideProps } from "next";
+
+export const getServerSideProps: GetServerSideProps = async () => {
+ return {
+ redirect: {
+ destination: "/admin/background-jobs",
+ permanent: false,
+ },
};
-
- return (
- <>
- <div className="flex items-center gap-2">
- <i className="bi-gear-wide-connected text-primary text-2xl"></i>
- <p className="capitalize text-3xl font-thin inline">
- {t("background_jobs")}
- </p>
- </div>
-
- <Separator className="my-3" />
-
- <p>{t("background_jobs_desc")}</p>
-
- <div className="flex items-center gap-2 my-3">
- <p className="capitalize text-2xl font-thin inline">
- {t("link_preservation_job")}
- </p>
- </div>
-
- <Separator className="my-3" />
-
- <div className="flex flex-col sm:flex-row gap-3 justify-between items-start">
- <div>
- <p>{t("link_preservation_job_desc")}</p>
- <div className="mt-3 flex gap-3">
- <div className="flex gap-1 border border-warning bg-warning/20 rounded-md px-2 py-1 w-max">
- <i className="bi-hourglass-split text-warning text-xl" />
- <p>{workerStats.data?.link.pending}</p>
- <p>{t("pending")}</p>
- </div>
-
- <div className="flex gap-1 border border-success bg-success/20 rounded-md px-2 py-1 w-max">
- <i className="bi-check2 text-success text-xl" />
- <p>{workerStats.data?.link.done}</p>
- <p>{t("done")}</p>
- </div>
- </div>
- </div>
- <div className="flex gap-3 flex-col">
- <Button
- onClick={() => {
- setAction("allBroken");
- setShowModal(true);
- }}
- variant="metal"
- >
- {t("regenerate_broken_links")}
- </Button>
- <Button
- variant="destructive"
- onClick={() => {
- setAction("allAndRePreserve");
- setShowModal(true);
- }}
- >
- {t("regenerate_all_links")}
- </Button>
- </div>
- </div>
-
- <div className="flex items-center gap-2 my-3">
- <p className="capitalize text-2xl font-thin inline">
- {t("search_indexing_job")}
- </p>
- </div>
-
- <Separator className="my-3" />
-
- <p>{t("search_indexing_job_desc")}</p>
-
- <p>{t("worker_pending_indexing_desc")}</p>
-
- <div className="mt-3 flex gap-3">
- <div className="flex gap-1 border border-warning bg-warning/20 rounded-md px-2 py-1 w-max">
- <i className="bi-hourglass-split text-warning text-xl" />
- <p>{workerStats.data?.search.pending}</p>
- <p>{t("pending")}</p>
- </div>
-
- <div className="flex gap-1 border border-success bg-success/20 rounded-md px-2 py-1 w-max">
- <i className="bi-check2 text-success text-xl" />
- <p>{workerStats.data?.search.done}</p>
- <p>{t("done")}</p>
- </div>
- </div>
-
- {showModal && action === "allBroken" && (
- <ConfirmationModal
- title={t("regenerate_broken_links")}
- onConfirmed={() => submit(action)}
- toggleModal={setShowModal}
- >
- <ul className="px-5 list-disc">
- <Trans
- i18nKey="regenerate_broken_preserved_content_desc"
- components={[<li />]}
- values={{
- count: workerStats.data?.link.failed,
- }}
- />
- </ul>
- <div role="alert" className="alert alert-warning mt-3">
- <i className="bi-exclamation-triangle text-xl" />
- <span>
- <b>{t("warning")}:</b> {t("irreversible_action_warning")}
- </span>
- </div>
- </ConfirmationModal>
- )}
- {showModal && action === "allAndRePreserve" && (
- <ConfirmationModal
- title={t("regenerate_all_links")}
- onConfirmed={() => submit(action)}
- toggleModal={setShowModal}
- >
- <ul className="px-5 list-disc">
- <Trans
- i18nKey="delete_all_preserved_content_and_regenerate_desc"
- components={[<li />]}
- />
- </ul>
- <div role="alert" className="alert alert-warning mt-3">
- <i className="bi-exclamation-triangle text-xl" />
- <span>
- <b>{t("warning")}:</b> {t("irreversible_action_warning")}
- </span>
- </div>
- </ConfirmationModal>
- )}
- </>
- );
};
-Page.getLayout = function getLayout(page: ReactElement) {
- return <SettingsLayout>{page}</SettingsLayout>;
-};
-
-export default Page;
-
-export { getServerSideProps };
+export default function BackgroundJobsRedirect() {
+ return null;
+}
diff --git a/apps/web/pages/settings/worker.tsx b/apps/web/pages/settings/worker.tsx
index 03262a09..a2944999 100644
--- a/apps/web/pages/settings/worker.tsx
+++ b/apps/web/pages/settings/worker.tsx
@@ -3,7 +3,7 @@ import type { GetServerSideProps } from "next";
export const getServerSideProps: GetServerSideProps = async () => {
return {
redirect: {
- destination: "/settings/background-jobs",
+ destination: "/admin/background-jobs",
permanent: false,
},
};
diff --git a/apps/web/public/locales/en/common.json b/apps/web/public/locales/en/common.json
index f0013628..d70ee739 100644
--- a/apps/web/public/locales/en/common.json
+++ b/apps/web/public/locales/en/common.json
@@ -1,5 +1,5 @@
{
- "user_administration": "Users Administration",
+ "user_administration": "User Administration",
"search_users": "Search for Users",
"no_users_found": "No users found.",
"no_user_found_in_search": "No users found with the given search query.",