mirror of
https://github.com/Dokploy/dokploy
synced 2025-06-26 18:27:59 +00:00
44 lines
1.1 KiB
TypeScript
44 lines
1.1 KiB
TypeScript
import { ShowRequests } from "@/components/dashboard/requests/show-requests";
|
|
import { DashboardLayout } from "@/components/layouts/dashboard-layout";
|
|
import { getLocale, serverSideTranslations } from "@/utils/i18n";
|
|
import { IS_CLOUD } from "@dokploy/server/constants";
|
|
import { validateRequest } from "@dokploy/server/lib/auth";
|
|
import type { GetServerSidePropsContext } from "next";
|
|
import type { ReactElement } from "react";
|
|
|
|
export default function Requests() {
|
|
return <ShowRequests />;
|
|
}
|
|
Requests.getLayout = (page: ReactElement) => {
|
|
return <DashboardLayout>{page}</DashboardLayout>;
|
|
};
|
|
export async function getServerSideProps(
|
|
ctx: GetServerSidePropsContext<{ serviceId: string }>,
|
|
) {
|
|
const { req } = ctx;
|
|
const locale = getLocale(req.cookies);
|
|
if (IS_CLOUD) {
|
|
return {
|
|
redirect: {
|
|
permanent: true,
|
|
destination: "/dashboard/projects",
|
|
},
|
|
};
|
|
}
|
|
const { user } = await validateRequest(ctx.req);
|
|
if (!user) {
|
|
return {
|
|
redirect: {
|
|
permanent: true,
|
|
destination: "/",
|
|
},
|
|
};
|
|
}
|
|
|
|
return {
|
|
props: {
|
|
...(await serverSideTranslations(locale)),
|
|
},
|
|
};
|
|
}
|