diff --git a/apps/dokploy/components/dashboard/requests/show-requests.tsx b/apps/dokploy/components/dashboard/requests/show-requests.tsx index 1b066529..643d2bcb 100644 --- a/apps/dokploy/components/dashboard/requests/show-requests.tsx +++ b/apps/dokploy/components/dashboard/requests/show-requests.tsx @@ -34,7 +34,7 @@ export const ShowRequests = () => { Request Distribution -
+
Showing web and API requests over time diff --git a/apps/dokploy/components/dashboard/settings/billing/show-billing.tsx b/apps/dokploy/components/dashboard/settings/billing/show-billing.tsx index 073b4598..6590f2ba 100644 --- a/apps/dokploy/components/dashboard/settings/billing/show-billing.tsx +++ b/apps/dokploy/components/dashboard/settings/billing/show-billing.tsx @@ -1,3 +1,4 @@ +import { Badge } from "@/components/ui/badge"; import { Button } from "@/components/ui/button"; import { NumberInput } from "@/components/ui/input"; import { Progress } from "@/components/ui/progress"; @@ -148,6 +149,11 @@ export const ShowBilling = () => { : "lg:py-8", )} > + {isAnnual && ( +
+ Recommended 🚀 +
+ )} {isAnnual ? (

diff --git a/apps/dokploy/components/dashboard/settings/billing/show-welcome-dokploy.tsx b/apps/dokploy/components/dashboard/settings/billing/show-welcome-dokploy.tsx new file mode 100644 index 00000000..ca6a4dae --- /dev/null +++ b/apps/dokploy/components/dashboard/settings/billing/show-welcome-dokploy.tsx @@ -0,0 +1,62 @@ +import { ShowBilling } from "@/components/dashboard/settings/billing/show-billing"; +import { + Dialog, + DialogContent, + DialogHeader, + DialogTitle, +} from "@/components/ui/dialog"; +import { api } from "@/utils/api"; +import type React from "react"; +import { useEffect, useState } from "react"; + +export const ShowWelcomeDokploy = () => { + const { data } = api.auth.get.useQuery(); + const [open, setOpen] = useState(false); + + const { data: isCloud, isLoading } = api.settings.isCloud.useQuery(); + + if (!isCloud || data?.rol !== "admin") { + return null; + } + + useEffect(() => { + if ( + !isLoading && + isCloud && + !localStorage.getItem("hasSeenCloudWelcomeModal") && + data?.rol === "admin" + ) { + setOpen(true); + } + }, [isCloud, isLoading]); + + const handleClose = (isOpen: boolean) => { + if (data?.rol === "admin") { + setOpen(isOpen); + if (!isOpen) { + localStorage.setItem("hasSeenCloudWelcomeModal", "true"); // Establece el flag al cerrar el modal + } + } + }; + + return ( + <> +

+ + + + Welcome to Dokploy Cloud 🎉 + +

+ Unlock powerful features to streamline your deployments and manage + projects effortlessly. +

+
+
+ +
+
+
+ + ); +}; diff --git a/apps/dokploy/components/layouts/navbar.tsx b/apps/dokploy/components/layouts/navbar.tsx index 0b0e38ff..cead4683 100644 --- a/apps/dokploy/components/layouts/navbar.tsx +++ b/apps/dokploy/components/layouts/navbar.tsx @@ -19,6 +19,7 @@ import { buttonVariants } from "../ui/button"; export const Navbar = () => { const router = useRouter(); const { data } = api.auth.get.useQuery(); + const { data: isCloud } = api.settings.isCloud.useQuery(); const { data: user } = api.user.byAuthId.useQuery( { authId: data?.id || "", @@ -130,6 +131,16 @@ export const Navbar = () => { Settings + {isCloud && data?.rol === "admin" && ( + { + router.push("/dashboard/settings/billing"); + }} + > + Billing + + )} { router.push(tab?.index || ""); }} > -
+
{tabMap.map((tab, index) => { if (tab?.isShow && !tab?.isShow?.({ rol: data?.rol, user })) { diff --git a/apps/dokploy/pages/dashboard/projects.tsx b/apps/dokploy/pages/dashboard/projects.tsx index b14c9e32..283a7c6e 100644 --- a/apps/dokploy/pages/dashboard/projects.tsx +++ b/apps/dokploy/pages/dashboard/projects.tsx @@ -1,14 +1,21 @@ import { ShowProjects } from "@/components/dashboard/projects/show"; +import { ShowWelcomeDokploy } from "@/components/dashboard/settings/billing/show-welcome-dokploy"; import { DashboardLayout } from "@/components/layouts/dashboard-layout"; import { appRouter } from "@/server/api/root"; import { validateRequest } from "@dokploy/server"; import { createServerSideHelpers } from "@trpc/react-query/server"; import type { GetServerSidePropsContext } from "next"; -import React, { type ReactElement } from "react"; +import type React from "react"; +import type { ReactElement } from "react"; import superjson from "superjson"; const Dashboard = () => { - return ; + return ( + <> + + + + ); }; export default Dashboard; @@ -35,7 +42,7 @@ export async function getServerSideProps( }); await helpers.settings.isCloud.prefetch(); - + await helpers.auth.get.prefetch(); if (!user) { return { redirect: {