fix(deps): update nextjs monorepo to v15 (major) (#1844)
This commit is contained in:
@@ -37,16 +37,16 @@ export async function generateMetadata() {
|
||||
};
|
||||
}
|
||||
|
||||
const getHost = () => {
|
||||
const getHostAsync = async () => {
|
||||
if (process.env.HOSTNAME) {
|
||||
return `${process.env.HOSTNAME}:3000`;
|
||||
}
|
||||
|
||||
return headers().get("host");
|
||||
return (await headers()).get("host");
|
||||
};
|
||||
|
||||
export default async function AboutPage() {
|
||||
const baseServerUrl = `http://${getHost()}`;
|
||||
const baseServerUrl = `http://${await getHostAsync()}`;
|
||||
const t = await getScopedI18n("management.page.about");
|
||||
const attributes = await getPackageAttributesAsync();
|
||||
const githubContributors = (await fetch(`${baseServerUrl}/api/about/contributors/github`).then((res) =>
|
||||
|
||||
@@ -9,10 +9,11 @@ import { DynamicBreadcrumb } from "~/components/navigation/dynamic-breadcrumb";
|
||||
import { AppEditForm } from "./_app-edit-form";
|
||||
|
||||
interface AppEditPageProps {
|
||||
params: { id: string };
|
||||
params: Promise<{ id: string }>;
|
||||
}
|
||||
|
||||
export default async function AppEditPage({ params }: AppEditPageProps) {
|
||||
export default async function AppEditPage(props: AppEditPageProps) {
|
||||
const params = await props.params;
|
||||
const session = await auth();
|
||||
|
||||
if (!session?.user.permissions.includes("app-modify-all")) {
|
||||
|
||||
@@ -11,10 +11,11 @@ import { IntegrationAccessSettings } from "../../_components/integration-access-
|
||||
import { EditIntegrationForm } from "./_integration-edit-form";
|
||||
|
||||
interface EditIntegrationPageProps {
|
||||
params: { id: string };
|
||||
params: Promise<{ id: string }>;
|
||||
}
|
||||
|
||||
export default async function EditIntegrationPage({ params }: EditIntegrationPageProps) {
|
||||
export default async function EditIntegrationPage(props: EditIntegrationPageProps) {
|
||||
const params = await props.params;
|
||||
const editT = await getScopedI18n("integration.page.edit");
|
||||
const t = await getI18n();
|
||||
const integration = await api.integration.byId({ id: params.id }).catch(catchTrpcNotFound);
|
||||
|
||||
@@ -13,12 +13,15 @@ import { DynamicBreadcrumb } from "~/components/navigation/dynamic-breadcrumb";
|
||||
import { NewIntegrationForm } from "./_integration-new-form";
|
||||
|
||||
interface NewIntegrationPageProps {
|
||||
searchParams: Partial<z.infer<typeof validation.integration.create>> & {
|
||||
kind: IntegrationKind;
|
||||
};
|
||||
searchParams: Promise<
|
||||
Partial<z.infer<typeof validation.integration.create>> & {
|
||||
kind: IntegrationKind;
|
||||
}
|
||||
>;
|
||||
}
|
||||
|
||||
export default async function IntegrationsNewPage({ searchParams }: NewIntegrationPageProps) {
|
||||
export default async function IntegrationsNewPage(props: NewIntegrationPageProps) {
|
||||
const searchParams = await props.searchParams;
|
||||
const session = await auth();
|
||||
if (!session?.user.permissions.includes("integration-create")) {
|
||||
notFound();
|
||||
|
||||
@@ -46,12 +46,13 @@ import { DeleteIntegrationActionButton } from "./_integration-buttons";
|
||||
import { IntegrationCreateDropdownContent } from "./new/_integration-new-dropdown";
|
||||
|
||||
interface IntegrationsPageProps {
|
||||
searchParams: {
|
||||
searchParams: Promise<{
|
||||
tab?: IntegrationKind;
|
||||
};
|
||||
}>;
|
||||
}
|
||||
|
||||
export default async function IntegrationsPage({ searchParams }: IntegrationsPageProps) {
|
||||
export default async function IntegrationsPage(props: IntegrationsPageProps) {
|
||||
const searchParams = await props.searchParams;
|
||||
const session = await auth();
|
||||
|
||||
if (!session) {
|
||||
|
||||
@@ -34,7 +34,7 @@ type SearchParamsSchemaInputFromSchema<TSchema extends Record<string, unknown>>
|
||||
}>;
|
||||
|
||||
interface MediaListPageProps {
|
||||
searchParams: SearchParamsSchemaInputFromSchema<z.infer<typeof searchParamsSchema>>;
|
||||
searchParams: Promise<SearchParamsSchemaInputFromSchema<z.infer<typeof searchParamsSchema>>>;
|
||||
}
|
||||
|
||||
export default async function GroupsListPage(props: MediaListPageProps) {
|
||||
@@ -45,7 +45,7 @@ export default async function GroupsListPage(props: MediaListPageProps) {
|
||||
}
|
||||
|
||||
const t = await getI18n();
|
||||
const searchParams = searchParamsSchema.parse(props.searchParams);
|
||||
const searchParams = searchParamsSchema.parse(await props.searchParams);
|
||||
const { items: medias, totalCount } = await api.media.getPaginated(searchParams);
|
||||
|
||||
return (
|
||||
|
||||
@@ -10,10 +10,11 @@ import { DynamicBreadcrumb } from "~/components/navigation/dynamic-breadcrumb";
|
||||
import { SearchEngineEditForm } from "./_search-engine-edit-form";
|
||||
|
||||
interface SearchEngineEditPageProps {
|
||||
params: { id: string };
|
||||
params: Promise<{ id: string }>;
|
||||
}
|
||||
|
||||
export default async function SearchEngineEditPage({ params }: SearchEngineEditPageProps) {
|
||||
export default async function SearchEngineEditPage(props: SearchEngineEditPageProps) {
|
||||
const params = await props.params;
|
||||
const session = await auth();
|
||||
|
||||
if (!session?.user.permissions.includes("search-engine-modify-all")) {
|
||||
|
||||
@@ -27,7 +27,7 @@ type SearchParamsSchemaInputFromSchema<TSchema extends Record<string, unknown>>
|
||||
}>;
|
||||
|
||||
interface SearchEnginesPageProps {
|
||||
searchParams: SearchParamsSchemaInputFromSchema<z.infer<typeof searchParamsSchema>>;
|
||||
searchParams: Promise<SearchParamsSchemaInputFromSchema<z.infer<typeof searchParamsSchema>>>;
|
||||
}
|
||||
|
||||
export default async function SearchEnginesPage(props: SearchEnginesPageProps) {
|
||||
@@ -37,7 +37,7 @@ export default async function SearchEnginesPage(props: SearchEnginesPageProps) {
|
||||
redirect("/auth/login");
|
||||
}
|
||||
|
||||
const searchParams = searchParamsSchema.parse(props.searchParams);
|
||||
const searchParams = searchParamsSchema.parse(await props.searchParams);
|
||||
const { items: searchEngines, totalCount } = await api.searchEngine.getPaginated(searchParams);
|
||||
|
||||
const tEngine = await getScopedI18n("search.engine");
|
||||
|
||||
@@ -30,7 +30,7 @@ export default async function ApiPage() {
|
||||
if (!session?.user || !session.user.permissions.includes("admin")) {
|
||||
notFound();
|
||||
}
|
||||
const document = openApiDocument(extractBaseUrlFromHeaders(headers()));
|
||||
const document = openApiDocument(extractBaseUrlFromHeaders(await headers()));
|
||||
const apiKeys = await api.apiKeys.getAll();
|
||||
const t = await getScopedI18n("management.page.tool.api.tab");
|
||||
|
||||
|
||||
@@ -19,12 +19,13 @@ import { UserProfileAvatarForm } from "./_components/_profile-avatar-form";
|
||||
import { UserProfileForm } from "./_components/_profile-form";
|
||||
|
||||
interface Props {
|
||||
params: {
|
||||
params: Promise<{
|
||||
userId: string;
|
||||
};
|
||||
}>;
|
||||
}
|
||||
|
||||
export async function generateMetadata({ params }: Props) {
|
||||
export async function generateMetadata(props: Props) {
|
||||
const params = await props.params;
|
||||
const session = await auth();
|
||||
const user = await api.user
|
||||
.getById({
|
||||
@@ -43,7 +44,8 @@ export async function generateMetadata({ params }: Props) {
|
||||
};
|
||||
}
|
||||
|
||||
export default async function EditUserPage({ params }: Props) {
|
||||
export default async function EditUserPage(props: Props) {
|
||||
const params = await props.params;
|
||||
const t = await getI18n();
|
||||
const tGeneral = await getScopedI18n("management.page.user.setting.general");
|
||||
const session = await auth();
|
||||
|
||||
@@ -15,10 +15,14 @@ import { NavigationLink } from "../groups/[id]/_navigation";
|
||||
import { canAccessUserEditPage } from "./access";
|
||||
|
||||
interface LayoutProps {
|
||||
params: { userId: string };
|
||||
params: Promise<{ userId: string }>;
|
||||
}
|
||||
|
||||
export default async function Layout({ children, params }: PropsWithChildren<LayoutProps>) {
|
||||
export default async function Layout(props: PropsWithChildren<LayoutProps>) {
|
||||
const params = await props.params;
|
||||
|
||||
const { children } = props;
|
||||
|
||||
const session = await auth();
|
||||
const t = await getI18n();
|
||||
const tUser = await getScopedI18n("management.page.user");
|
||||
|
||||
@@ -10,12 +10,13 @@ import { canAccessUserEditPage } from "../access";
|
||||
import { ChangePasswordForm } from "./_components/_change-password-form";
|
||||
|
||||
interface Props {
|
||||
params: {
|
||||
params: Promise<{
|
||||
userId: string;
|
||||
};
|
||||
}>;
|
||||
}
|
||||
|
||||
export default async function UserSecurityPage({ params }: Props) {
|
||||
export default async function UserSecurityPage(props: Props) {
|
||||
const params = await props.params;
|
||||
const session = await auth();
|
||||
const tSecurity = await getScopedI18n("management.page.user.setting.security");
|
||||
const user = await api.user
|
||||
|
||||
@@ -10,10 +10,14 @@ import { ManageContainer } from "~/components/manage/manage-container";
|
||||
import { NavigationLink } from "./_navigation";
|
||||
|
||||
interface LayoutProps {
|
||||
params: { id: string };
|
||||
params: Promise<{ id: string }>;
|
||||
}
|
||||
|
||||
export default async function Layout({ children, params }: PropsWithChildren<LayoutProps>) {
|
||||
export default async function Layout(props: PropsWithChildren<LayoutProps>) {
|
||||
const params = await props.params;
|
||||
|
||||
const { children } = props;
|
||||
|
||||
const t = await getI18n();
|
||||
const tGroup = await getScopedI18n("management.page.group");
|
||||
const group = await api.group.getById({ id: params.id });
|
||||
|
||||
@@ -17,15 +17,17 @@ import { AddGroupMember } from "./_add-group-member";
|
||||
import { RemoveGroupMember } from "./_remove-group-member";
|
||||
|
||||
interface GroupsDetailPageProps {
|
||||
params: {
|
||||
params: Promise<{
|
||||
id: string;
|
||||
};
|
||||
searchParams: {
|
||||
}>;
|
||||
searchParams: Promise<{
|
||||
search: string | undefined;
|
||||
};
|
||||
}>;
|
||||
}
|
||||
|
||||
export default async function GroupsDetailPage({ params, searchParams }: GroupsDetailPageProps) {
|
||||
export default async function GroupsDetailPage(props: GroupsDetailPageProps) {
|
||||
const searchParams = await props.searchParams;
|
||||
const params = await props.params;
|
||||
const session = await auth();
|
||||
|
||||
if (!session?.user.permissions.includes("admin")) {
|
||||
|
||||
@@ -14,12 +14,13 @@ import { ReservedGroupAlert } from "./_reserved-group-alert";
|
||||
import { TransferGroupOwnership } from "./_transfer-group-ownership";
|
||||
|
||||
interface GroupsDetailPageProps {
|
||||
params: {
|
||||
params: Promise<{
|
||||
id: string;
|
||||
};
|
||||
}>;
|
||||
}
|
||||
|
||||
export default async function GroupsDetailPage({ params }: GroupsDetailPageProps) {
|
||||
export default async function GroupsDetailPage(props: GroupsDetailPageProps) {
|
||||
const params = await props.params;
|
||||
const session = await auth();
|
||||
|
||||
if (!session?.user.permissions.includes("admin")) {
|
||||
|
||||
@@ -12,12 +12,13 @@ import { getI18n, getScopedI18n } from "@homarr/translation/server";
|
||||
import { PermissionForm, PermissionSwitch, SaveAffix } from "./_group-permission-form";
|
||||
|
||||
interface GroupPermissionsPageProps {
|
||||
params: {
|
||||
params: Promise<{
|
||||
id: string;
|
||||
};
|
||||
}>;
|
||||
}
|
||||
|
||||
export default async function GroupPermissionsPage({ params }: GroupPermissionsPageProps) {
|
||||
export default async function GroupPermissionsPage(props: GroupPermissionsPageProps) {
|
||||
const params = await props.params;
|
||||
const session = await auth();
|
||||
|
||||
if (!session?.user.permissions.includes("admin")) {
|
||||
|
||||
@@ -24,7 +24,7 @@ type SearchParamsSchemaInputFromSchema<TSchema extends Record<string, unknown>>
|
||||
}>;
|
||||
|
||||
interface GroupsListPageProps {
|
||||
searchParams: SearchParamsSchemaInputFromSchema<z.infer<typeof searchParamsSchema>>;
|
||||
searchParams: Promise<SearchParamsSchemaInputFromSchema<z.infer<typeof searchParamsSchema>>>;
|
||||
}
|
||||
|
||||
export default async function GroupsListPage(props: GroupsListPageProps) {
|
||||
@@ -35,7 +35,7 @@ export default async function GroupsListPage(props: GroupsListPageProps) {
|
||||
}
|
||||
|
||||
const t = await getI18n();
|
||||
const searchParams = searchParamsSchema.parse(props.searchParams);
|
||||
const searchParams = searchParamsSchema.parse(await props.searchParams);
|
||||
const { items: groups, totalCount } = await api.group.getPaginated(searchParams);
|
||||
|
||||
return (
|
||||
|
||||
Reference in New Issue
Block a user