mirror of
https://github.com/Dokploy/dokploy.git
synced 2026-06-15 20:25:23 +02:00
- Introduced a new API for managing servers, including endpoints for listing, purchasing, and retrieving server plans. - Added a new page and components for displaying managed servers in the dashboard. - Updated the sidebar to include navigation for managed servers. - Created database migrations for managed server types and status. - Enhanced environment configuration with a new API key for Hostinger services. This update enables users to manage their servers directly from the Dokploy dashboard, improving the overall user experience and functionality.
40 lines
982 B
TypeScript
40 lines
982 B
TypeScript
import { IS_CLOUD } from "@dokploy/server/constants";
|
|
import { validateRequest } from "@dokploy/server/lib/auth";
|
|
import type { GetServerSidePropsContext } from "next";
|
|
import type { ReactElement } from "react";
|
|
import { ShowManagedServers } from "@/components/dashboard/settings/billing/show-managed-servers";
|
|
import { DashboardLayout } from "@/components/layouts/dashboard-layout";
|
|
|
|
const Page = () => {
|
|
return <ShowManagedServers />;
|
|
};
|
|
|
|
export default Page;
|
|
|
|
Page.getLayout = (page: ReactElement) => {
|
|
return <DashboardLayout metaName="Managed Servers">{page}</DashboardLayout>;
|
|
};
|
|
|
|
export async function getServerSideProps(
|
|
ctx: GetServerSidePropsContext,
|
|
) {
|
|
if (!IS_CLOUD) {
|
|
return {
|
|
redirect: {
|
|
permanent: false,
|
|
destination: "/dashboard/home",
|
|
},
|
|
};
|
|
}
|
|
const { user } = await validateRequest(ctx.req);
|
|
if (!user || user.role !== "owner") {
|
|
return {
|
|
redirect: {
|
|
permanent: false,
|
|
destination: "/",
|
|
},
|
|
};
|
|
}
|
|
return { props: {} };
|
|
}
|