From 4865f4f969d0eb17b672656752502d540bd0dbae Mon Sep 17 00:00:00 2001
From: Mauricio Siu <47042324+Siumauricio@users.noreply.github.com>
Date: Tue, 25 Jun 2024 01:58:49 -0600
Subject: [PATCH] feat(#40): add wildcards domains and traefik.me modals
---
.../application/domains/generate-domain.tsx | 122 ++++++++++--------
.../domains/generate-traefikme.tsx | 69 ++++++++++
.../application/domains/generate-wildcard.tsx | 69 ++++++++++
server/api/routers/domain.ts | 6 +
server/api/services/domain.ts | 32 +++++
5 files changed, 242 insertions(+), 56 deletions(-)
create mode 100644 components/dashboard/application/domains/generate-traefikme.tsx
create mode 100644 components/dashboard/application/domains/generate-wildcard.tsx
diff --git a/components/dashboard/application/domains/generate-domain.tsx b/components/dashboard/application/domains/generate-domain.tsx
index 483d2ec01..5b2b0e750 100644
--- a/components/dashboard/application/domains/generate-domain.tsx
+++ b/components/dashboard/application/domains/generate-domain.tsx
@@ -1,69 +1,79 @@
-import React from "react";
-import {
- AlertDialog,
- AlertDialogAction,
- AlertDialogCancel,
- AlertDialogContent,
- AlertDialogDescription,
- AlertDialogFooter,
- AlertDialogHeader,
- AlertDialogTitle,
- AlertDialogTrigger,
-} from "@/components/ui/alert-dialog";
import { Button } from "@/components/ui/button";
+import {
+ Dialog,
+ DialogContent,
+ DialogDescription,
+ DialogHeader,
+ DialogTitle,
+ DialogTrigger,
+} from "@/components/ui/dialog";
+import { RefreshCcw } from "lucide-react";
+import { GenerateTraefikMe } from "./generate-traefikme";
+import { GenerateWildCard } from "./generate-wildcard";
+import Link from "next/link";
import { api } from "@/utils/api";
-import { RefreshCcw, TrashIcon } from "lucide-react";
-import { toast } from "sonner";
interface Props {
applicationId: string;
}
+
export const GenerateDomain = ({ applicationId }: Props) => {
- const { mutateAsync, isLoading } = api.domain.generateDomain.useMutation();
- const utils = api.useUtils();
return (
-
-
-
-
-
-
- Are you sure to generate a new domain?
-
-
- This will generate a new domain and will be used to access to the
- application
-
-
-
- Cancel
- {
- await mutateAsync({
- applicationId,
- })
- .then((data) => {
- utils.domain.byApplicationId.invalidate({
- applicationId: applicationId,
- });
- utils.application.readTraefikConfig.invalidate({
- applicationId: applicationId,
- });
- toast.success("Generated Domain succesfully");
- })
- .catch(() => {
- toast.error("Error to generate Domain");
- });
- }}
- >
- Confirm
-
-
-
-
+
+
+
+ Generate Domain
+
+ Generate Domains for your applications
+
+
+
+
+
+
+
+
+ 1. Generate TraefikMe Domain
+
+
+ This option generates a free domain provided by{" "}
+
+ TraefikMe
+
+ . We recommend using this for quick domain testing or if you
+ don't have a domain yet.
+
+
+
+
+
+
+ 2. Use Wildcard Domain
+
+
+ To use this option, you need to set up an 'A' record in your
+ domain provider. For example, create a record for
+ *.yourdomain.com.
+