35 lines
939 B
TypeScript
35 lines
939 B
TypeScript
import { notFound } from "next/navigation";
|
|
|
|
import { api } from "@homarr/api/server";
|
|
import { auth } from "@homarr/auth/next";
|
|
import { getScopedI18n } from "@homarr/translation/server";
|
|
|
|
import { ManagePageLayout } from "~/components/manage/manage-page-layout";
|
|
import { SettingsForm } from "./_components/settings-form";
|
|
|
|
export async function generateMetadata() {
|
|
const t = await getScopedI18n("management");
|
|
const metaTitle = `${t("metaTitle")} • Homarr`;
|
|
|
|
return {
|
|
title: metaTitle,
|
|
};
|
|
}
|
|
|
|
export default async function SettingsPage() {
|
|
const session = await auth();
|
|
|
|
if (!session?.user.permissions.includes("admin")) {
|
|
notFound();
|
|
}
|
|
|
|
const serverSettings = await api.serverSettings.getAll();
|
|
const tSettings = await getScopedI18n("management.page.settings");
|
|
|
|
return (
|
|
<ManagePageLayout title={tSettings("title")}>
|
|
<SettingsForm initialData={serverSettings} />
|
|
</ManagePageLayout>
|
|
);
|
|
}
|