mirror of
https://github.com/andwati/dokploy.git
synced 2026-10-18 03:02:56 +00:00
chore: update zod and react-hook-form integration to use standard-schema resolver; update dependencies in pnpm-lock.yaml
This commit is contained in:
+1
-1
@@ -1,4 +1,4 @@
|
|||||||
import { zodResolver } from "@hookform/resolvers/zod";
|
import { standardSchemaResolver as zodResolver } from "@hookform/resolvers/standard-schema";
|
||||||
import { Server } from "lucide-react";
|
import { Server } from "lucide-react";
|
||||||
import Link from "next/link";
|
import Link from "next/link";
|
||||||
import { useEffect } from "react";
|
import { useEffect } from "react";
|
||||||
|
|||||||
+1
-1
@@ -1,4 +1,4 @@
|
|||||||
import { zodResolver } from "@hookform/resolvers/zod";
|
import { standardSchemaResolver as zodResolver } from "@hookform/resolvers/standard-schema";
|
||||||
import { useEffect, useState } from "react";
|
import { useEffect, useState } from "react";
|
||||||
import { useForm } from "react-hook-form";
|
import { useForm } from "react-hook-form";
|
||||||
import { toast } from "sonner";
|
import { toast } from "sonner";
|
||||||
|
|||||||
+1
-1
@@ -1,4 +1,4 @@
|
|||||||
import { zodResolver } from "@hookform/resolvers/zod";
|
import { standardSchemaResolver as zodResolver } from "@hookform/resolvers/standard-schema";
|
||||||
import { useEffect, useState } from "react";
|
import { useEffect, useState } from "react";
|
||||||
import { useForm } from "react-hook-form";
|
import { useForm } from "react-hook-form";
|
||||||
import { toast } from "sonner";
|
import { toast } from "sonner";
|
||||||
|
|||||||
+1
-1
@@ -1,4 +1,4 @@
|
|||||||
import { zodResolver } from "@hookform/resolvers/zod";
|
import { standardSchemaResolver as zodResolver } from "@hookform/resolvers/standard-schema";
|
||||||
import { useEffect, useState } from "react";
|
import { useEffect, useState } from "react";
|
||||||
import { useFieldArray, useForm } from "react-hook-form";
|
import { useFieldArray, useForm } from "react-hook-form";
|
||||||
import { toast } from "sonner";
|
import { toast } from "sonner";
|
||||||
|
|||||||
+1
-1
@@ -1,4 +1,4 @@
|
|||||||
import { zodResolver } from "@hookform/resolvers/zod";
|
import { standardSchemaResolver as zodResolver } from "@hookform/resolvers/standard-schema";
|
||||||
import { useEffect, useState } from "react";
|
import { useEffect, useState } from "react";
|
||||||
import { useFieldArray, useForm } from "react-hook-form";
|
import { useFieldArray, useForm } from "react-hook-form";
|
||||||
import { toast } from "sonner";
|
import { toast } from "sonner";
|
||||||
|
|||||||
+1
-1
@@ -1,4 +1,4 @@
|
|||||||
import { zodResolver } from "@hookform/resolvers/zod";
|
import { standardSchemaResolver as zodResolver } from "@hookform/resolvers/standard-schema";
|
||||||
import { useEffect, useState } from "react";
|
import { useEffect, useState } from "react";
|
||||||
import { useForm } from "react-hook-form";
|
import { useForm } from "react-hook-form";
|
||||||
import { toast } from "sonner";
|
import { toast } from "sonner";
|
||||||
|
|||||||
+1
-1
@@ -1,4 +1,4 @@
|
|||||||
import { zodResolver } from "@hookform/resolvers/zod";
|
import { standardSchemaResolver as zodResolver } from "@hookform/resolvers/standard-schema";
|
||||||
import { useEffect, useState } from "react";
|
import { useEffect, useState } from "react";
|
||||||
import { useForm } from "react-hook-form";
|
import { useForm } from "react-hook-form";
|
||||||
import { toast } from "sonner";
|
import { toast } from "sonner";
|
||||||
|
|||||||
+1
-1
@@ -1,4 +1,4 @@
|
|||||||
import { zodResolver } from "@hookform/resolvers/zod";
|
import { standardSchemaResolver as zodResolver } from "@hookform/resolvers/standard-schema";
|
||||||
import { useEffect, useState } from "react";
|
import { useEffect, useState } from "react";
|
||||||
import { useForm } from "react-hook-form";
|
import { useForm } from "react-hook-form";
|
||||||
import { toast } from "sonner";
|
import { toast } from "sonner";
|
||||||
|
|||||||
+1
-1
@@ -1,4 +1,4 @@
|
|||||||
import { zodResolver } from "@hookform/resolvers/zod";
|
import { standardSchemaResolver as zodResolver } from "@hookform/resolvers/standard-schema";
|
||||||
import { useEffect, useState } from "react";
|
import { useEffect, useState } from "react";
|
||||||
import { useForm } from "react-hook-form";
|
import { useForm } from "react-hook-form";
|
||||||
import { toast } from "sonner";
|
import { toast } from "sonner";
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import { zodResolver } from "@hookform/resolvers/zod";
|
import { standardSchemaResolver as zodResolver } from "@hookform/resolvers/standard-schema";
|
||||||
import { Plus, Trash2 } from "lucide-react";
|
import { Plus, Trash2 } from "lucide-react";
|
||||||
import { useEffect } from "react";
|
import { useEffect } from "react";
|
||||||
import { useFieldArray, useForm } from "react-hook-form";
|
import { useFieldArray, useForm } from "react-hook-form";
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import { zodResolver } from "@hookform/resolvers/zod";
|
import { standardSchemaResolver as zodResolver } from "@hookform/resolvers/standard-schema";
|
||||||
import { Code2, Globe2, HardDrive } from "lucide-react";
|
import { Code2, Globe2, HardDrive } from "lucide-react";
|
||||||
import { useEffect, useState } from "react";
|
import { useEffect, useState } from "react";
|
||||||
import { useForm } from "react-hook-form";
|
import { useForm } from "react-hook-form";
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import { zodResolver } from "@hookform/resolvers/zod";
|
import { standardSchemaResolver as zodResolver } from "@hookform/resolvers/standard-schema";
|
||||||
import { PenBoxIcon, PlusIcon } from "lucide-react";
|
import { PenBoxIcon, PlusIcon } from "lucide-react";
|
||||||
import { useEffect, useState } from "react";
|
import { useEffect, useState } from "react";
|
||||||
import { useForm, useWatch } from "react-hook-form";
|
import { useForm, useWatch } from "react-hook-form";
|
||||||
@@ -35,13 +35,9 @@ import { api } from "@/utils/api";
|
|||||||
|
|
||||||
const AddPortSchema = z.object({
|
const AddPortSchema = z.object({
|
||||||
publishedPort: z.number().int().min(1).max(65535),
|
publishedPort: z.number().int().min(1).max(65535),
|
||||||
publishMode: z.enum(["ingress", "host"], {
|
publishMode: z.enum(["ingress", "host"]),
|
||||||
required_error: "Publish mode is required",
|
|
||||||
}),
|
|
||||||
targetPort: z.number().int().min(1).max(65535),
|
targetPort: z.number().int().min(1).max(65535),
|
||||||
protocol: z.enum(["tcp", "udp"], {
|
protocol: z.enum(["tcp", "udp"]),
|
||||||
required_error: "Protocol is required",
|
|
||||||
}),
|
|
||||||
});
|
});
|
||||||
|
|
||||||
type AddPort = z.infer<typeof AddPortSchema>;
|
type AddPort = z.infer<typeof AddPortSchema>;
|
||||||
|
|||||||
+2
-2
@@ -1,4 +1,4 @@
|
|||||||
import { zodResolver } from "@hookform/resolvers/zod";
|
import { standardSchemaResolver as zodResolver } from "@hookform/resolvers/standard-schema";
|
||||||
import { PenBoxIcon, PlusIcon } from "lucide-react";
|
import { PenBoxIcon, PlusIcon } from "lucide-react";
|
||||||
import { useEffect, useState } from "react";
|
import { useEffect, useState } from "react";
|
||||||
import { useForm } from "react-hook-form";
|
import { useForm } from "react-hook-form";
|
||||||
@@ -104,7 +104,7 @@ export const HandleRedirect = ({
|
|||||||
? api.redirects.update.useMutation()
|
? api.redirects.update.useMutation()
|
||||||
: api.redirects.create.useMutation();
|
: api.redirects.create.useMutation();
|
||||||
|
|
||||||
const form = useForm<AddRedirect>({
|
const form = useForm({
|
||||||
defaultValues: {
|
defaultValues: {
|
||||||
permanent: false,
|
permanent: false,
|
||||||
regex: "",
|
regex: "",
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import { zodResolver } from "@hookform/resolvers/zod";
|
import { standardSchemaResolver as zodResolver } from "@hookform/resolvers/standard-schema";
|
||||||
import { PenBoxIcon, PlusIcon } from "lucide-react";
|
import { PenBoxIcon, PlusIcon } from "lucide-react";
|
||||||
import { useEffect, useState } from "react";
|
import { useEffect, useState } from "react";
|
||||||
import { useForm } from "react-hook-form";
|
import { useForm } from "react-hook-form";
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import { zodResolver } from "@hookform/resolvers/zod";
|
import { standardSchemaResolver as zodResolver } from "@hookform/resolvers/standard-schema";
|
||||||
import { Server } from "lucide-react";
|
import { Server } from "lucide-react";
|
||||||
import Link from "next/link";
|
import Link from "next/link";
|
||||||
import { useEffect } from "react";
|
import { useEffect } from "react";
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import { zodResolver } from "@hookform/resolvers/zod";
|
import { standardSchemaResolver as zodResolver } from "@hookform/resolvers/standard-schema";
|
||||||
import { InfoIcon, Plus, Trash2 } from "lucide-react";
|
import { InfoIcon, Plus, Trash2 } from "lucide-react";
|
||||||
import { useEffect } from "react";
|
import { useEffect } from "react";
|
||||||
import { useFieldArray, useForm } from "react-hook-form";
|
import { useFieldArray, useForm } from "react-hook-form";
|
||||||
@@ -132,7 +132,7 @@ export const ShowResources = ({ id, type }: Props) => {
|
|||||||
? mutationMap[type]()
|
? mutationMap[type]()
|
||||||
: api.mongo.update.useMutation();
|
: api.mongo.update.useMutation();
|
||||||
|
|
||||||
const form = useForm<AddResources>({
|
const form = useForm({
|
||||||
defaultValues: {
|
defaultValues: {
|
||||||
cpuLimit: "",
|
cpuLimit: "",
|
||||||
cpuReservation: "",
|
cpuReservation: "",
|
||||||
@@ -452,6 +452,11 @@ export const ShowResources = ({ id, type }: Props) => {
|
|||||||
min={-1}
|
min={-1}
|
||||||
placeholder="65535"
|
placeholder="65535"
|
||||||
{...field}
|
{...field}
|
||||||
|
value={
|
||||||
|
typeof field.value === "number"
|
||||||
|
? field.value
|
||||||
|
: ""
|
||||||
|
}
|
||||||
onChange={(e) =>
|
onChange={(e) =>
|
||||||
field.onChange(Number(e.target.value))
|
field.onChange(Number(e.target.value))
|
||||||
}
|
}
|
||||||
@@ -475,6 +480,11 @@ export const ShowResources = ({ id, type }: Props) => {
|
|||||||
min={-1}
|
min={-1}
|
||||||
placeholder="65535"
|
placeholder="65535"
|
||||||
{...field}
|
{...field}
|
||||||
|
value={
|
||||||
|
typeof field.value === "number"
|
||||||
|
? field.value
|
||||||
|
: ""
|
||||||
|
}
|
||||||
onChange={(e) =>
|
onChange={(e) =>
|
||||||
field.onChange(Number(e.target.value))
|
field.onChange(Number(e.target.value))
|
||||||
}
|
}
|
||||||
|
|||||||
+2
-2
@@ -1,4 +1,4 @@
|
|||||||
import { zodResolver } from "@hookform/resolvers/zod";
|
import { standardSchemaResolver as zodResolver } from "@hookform/resolvers/standard-schema";
|
||||||
import { useEffect, useState } from "react";
|
import { useEffect, useState } from "react";
|
||||||
import { useForm } from "react-hook-form";
|
import { useForm } from "react-hook-form";
|
||||||
import { toast } from "sonner";
|
import { toast } from "sonner";
|
||||||
@@ -7,6 +7,7 @@ import { z } from "zod";
|
|||||||
import { AlertBlock } from "@/components/shared/alert-block";
|
import { AlertBlock } from "@/components/shared/alert-block";
|
||||||
import { CodeEditor } from "@/components/shared/code-editor";
|
import { CodeEditor } from "@/components/shared/code-editor";
|
||||||
import { Button } from "@/components/ui/button";
|
import { Button } from "@/components/ui/button";
|
||||||
|
import { Checkbox } from "@/components/ui/checkbox";
|
||||||
import {
|
import {
|
||||||
Dialog,
|
Dialog,
|
||||||
DialogContent,
|
DialogContent,
|
||||||
@@ -24,7 +25,6 @@ import {
|
|||||||
FormLabel,
|
FormLabel,
|
||||||
FormMessage,
|
FormMessage,
|
||||||
} from "@/components/ui/form";
|
} from "@/components/ui/form";
|
||||||
import { Checkbox } from "@/components/ui/checkbox";
|
|
||||||
import { Label } from "@/components/ui/label";
|
import { Label } from "@/components/ui/label";
|
||||||
import { api } from "@/utils/api";
|
import { api } from "@/utils/api";
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import { zodResolver } from "@hookform/resolvers/zod";
|
import { standardSchemaResolver as zodResolver } from "@hookform/resolvers/standard-schema";
|
||||||
import { PlusIcon } from "lucide-react";
|
import { PlusIcon } from "lucide-react";
|
||||||
import type React from "react";
|
import type React from "react";
|
||||||
import { useEffect, useState } from "react";
|
import { useEffect, useState } from "react";
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import { zodResolver } from "@hookform/resolvers/zod";
|
import { standardSchemaResolver as zodResolver } from "@hookform/resolvers/standard-schema";
|
||||||
import { PenBoxIcon } from "lucide-react";
|
import { PenBoxIcon } from "lucide-react";
|
||||||
import { useEffect, useState } from "react";
|
import { useEffect, useState } from "react";
|
||||||
import { useForm } from "react-hook-form";
|
import { useForm } from "react-hook-form";
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import { zodResolver } from "@hookform/resolvers/zod";
|
import { standardSchemaResolver as zodResolver } from "@hookform/resolvers/standard-schema";
|
||||||
import { Cog } from "lucide-react";
|
import { Cog } from "lucide-react";
|
||||||
import { useEffect, useState } from "react";
|
import { useEffect, useState } from "react";
|
||||||
import { useForm } from "react-hook-form";
|
import { useForm } from "react-hook-form";
|
||||||
@@ -170,7 +170,7 @@ export const ShowBuildChooseForm = ({ applicationId }: Props) => {
|
|||||||
{ enabled: !!applicationId },
|
{ enabled: !!applicationId },
|
||||||
);
|
);
|
||||||
|
|
||||||
const form = useForm<AddTemplate>({
|
const form = useForm({
|
||||||
defaultValues: {
|
defaultValues: {
|
||||||
buildType: BuildType.nixpacks,
|
buildType: BuildType.nixpacks,
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import { zodResolver } from "@hookform/resolvers/zod";
|
import { standardSchemaResolver as zodResolver } from "@hookform/resolvers/standard-schema";
|
||||||
import { DatabaseZap, Dices, RefreshCw } from "lucide-react";
|
import { DatabaseZap, Dices, RefreshCw } from "lucide-react";
|
||||||
import Link from "next/link";
|
import Link from "next/link";
|
||||||
import { useEffect, useState } from "react";
|
import { useEffect, useState } from "react";
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import { zodResolver } from "@hookform/resolvers/zod";
|
import { standardSchemaResolver as zodResolver } from "@hookform/resolvers/standard-schema";
|
||||||
import { EyeIcon, EyeOffIcon } from "lucide-react";
|
import { EyeIcon, EyeOffIcon } from "lucide-react";
|
||||||
import { type CSSProperties, useEffect, useState } from "react";
|
import { type CSSProperties, useEffect, useState } from "react";
|
||||||
import { useForm } from "react-hook-form";
|
import { useForm } from "react-hook-form";
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import { zodResolver } from "@hookform/resolvers/zod";
|
import { standardSchemaResolver as zodResolver } from "@hookform/resolvers/standard-schema";
|
||||||
import { useEffect } from "react";
|
import { useEffect } from "react";
|
||||||
import { useForm } from "react-hook-form";
|
import { useForm } from "react-hook-form";
|
||||||
import { toast } from "sonner";
|
import { toast } from "sonner";
|
||||||
|
|||||||
+2
-2
@@ -1,4 +1,4 @@
|
|||||||
import { zodResolver } from "@hookform/resolvers/zod";
|
import { standardSchemaResolver as zodResolver } from "@hookform/resolvers/standard-schema";
|
||||||
import { CheckIcon, ChevronsUpDown, X } from "lucide-react";
|
import { CheckIcon, ChevronsUpDown, X } from "lucide-react";
|
||||||
import Link from "next/link";
|
import Link from "next/link";
|
||||||
import { useEffect } from "react";
|
import { useEffect } from "react";
|
||||||
@@ -77,7 +77,7 @@ export const SaveBitbucketProvider = ({ applicationId }: Props) => {
|
|||||||
const { mutateAsync, isLoading: isSavingBitbucketProvider } =
|
const { mutateAsync, isLoading: isSavingBitbucketProvider } =
|
||||||
api.application.saveBitbucketProvider.useMutation();
|
api.application.saveBitbucketProvider.useMutation();
|
||||||
|
|
||||||
const form = useForm<BitbucketProvider>({
|
const form = useForm({
|
||||||
defaultValues: {
|
defaultValues: {
|
||||||
buildPath: "/",
|
buildPath: "/",
|
||||||
repository: {
|
repository: {
|
||||||
|
|||||||
+1
-1
@@ -1,4 +1,4 @@
|
|||||||
import { zodResolver } from "@hookform/resolvers/zod";
|
import { standardSchemaResolver as zodResolver } from "@hookform/resolvers/standard-schema";
|
||||||
import { useEffect } from "react";
|
import { useEffect } from "react";
|
||||||
import { useForm } from "react-hook-form";
|
import { useForm } from "react-hook-form";
|
||||||
import { toast } from "sonner";
|
import { toast } from "sonner";
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import { zodResolver } from "@hookform/resolvers/zod";
|
import { standardSchemaResolver as zodResolver } from "@hookform/resolvers/standard-schema";
|
||||||
import { TrashIcon } from "lucide-react";
|
import { TrashIcon } from "lucide-react";
|
||||||
import { useEffect } from "react";
|
import { useEffect } from "react";
|
||||||
import { useForm } from "react-hook-form";
|
import { useForm } from "react-hook-form";
|
||||||
@@ -27,7 +27,7 @@ export const SaveDragNDrop = ({ applicationId }: Props) => {
|
|||||||
const { mutateAsync, isLoading } =
|
const { mutateAsync, isLoading } =
|
||||||
api.application.dropDeployment.useMutation();
|
api.application.dropDeployment.useMutation();
|
||||||
|
|
||||||
const form = useForm<UploadFile>({
|
const form = useForm({
|
||||||
defaultValues: {},
|
defaultValues: {},
|
||||||
resolver: zodResolver(uploadFileSchema),
|
resolver: zodResolver(uploadFileSchema),
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import { zodResolver } from "@hookform/resolvers/zod";
|
import { standardSchemaResolver as zodResolver } from "@hookform/resolvers/standard-schema";
|
||||||
import { KeyRoundIcon, LockIcon, X } from "lucide-react";
|
import { KeyRoundIcon, LockIcon, X } from "lucide-react";
|
||||||
import Link from "next/link";
|
import Link from "next/link";
|
||||||
import { useRouter } from "next/router";
|
import { useRouter } from "next/router";
|
||||||
@@ -61,7 +61,7 @@ export const SaveGitProvider = ({ applicationId }: Props) => {
|
|||||||
const { mutateAsync, isLoading } =
|
const { mutateAsync, isLoading } =
|
||||||
api.application.saveGitProvider.useMutation();
|
api.application.saveGitProvider.useMutation();
|
||||||
|
|
||||||
const form = useForm<GitProvider>({
|
const form = useForm({
|
||||||
defaultValues: {
|
defaultValues: {
|
||||||
branch: "",
|
branch: "",
|
||||||
buildPath: "/",
|
buildPath: "/",
|
||||||
|
|||||||
+5
-5
@@ -1,4 +1,4 @@
|
|||||||
import { zodResolver } from "@hookform/resolvers/zod";
|
import { standardSchemaResolver as zodResolver } from "@hookform/resolvers/standard-schema";
|
||||||
import { CheckIcon, ChevronsUpDown, HelpCircle, Plus, X } from "lucide-react";
|
import { CheckIcon, ChevronsUpDown, HelpCircle, Plus, X } from "lucide-react";
|
||||||
import Link from "next/link";
|
import Link from "next/link";
|
||||||
import { useEffect } from "react";
|
import { useEffect } from "react";
|
||||||
@@ -91,7 +91,7 @@ export const SaveGiteaProvider = ({ applicationId }: Props) => {
|
|||||||
const { mutateAsync, isLoading: isSavingGiteaProvider } =
|
const { mutateAsync, isLoading: isSavingGiteaProvider } =
|
||||||
api.application.saveGiteaProvider.useMutation();
|
api.application.saveGiteaProvider.useMutation();
|
||||||
|
|
||||||
const form = useForm<GiteaProvider>({
|
const form = useForm({
|
||||||
defaultValues: {
|
defaultValues: {
|
||||||
buildPath: "/",
|
buildPath: "/",
|
||||||
repository: {
|
repository: {
|
||||||
@@ -463,7 +463,7 @@ export const SaveGiteaProvider = ({ applicationId }: Props) => {
|
|||||||
<X
|
<X
|
||||||
className="size-3 cursor-pointer hover:text-destructive"
|
className="size-3 cursor-pointer hover:text-destructive"
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
const newPaths = [...field.value];
|
const newPaths = [...(field.value || [])];
|
||||||
newPaths.splice(index, 1);
|
newPaths.splice(index, 1);
|
||||||
field.onChange(newPaths);
|
field.onChange(newPaths);
|
||||||
}}
|
}}
|
||||||
@@ -481,7 +481,7 @@ export const SaveGiteaProvider = ({ applicationId }: Props) => {
|
|||||||
const input = e.currentTarget;
|
const input = e.currentTarget;
|
||||||
const path = input.value.trim();
|
const path = input.value.trim();
|
||||||
if (path) {
|
if (path) {
|
||||||
field.onChange([...field.value, path]);
|
field.onChange([...(field.value || []), path]);
|
||||||
input.value = "";
|
input.value = "";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -498,7 +498,7 @@ export const SaveGiteaProvider = ({ applicationId }: Props) => {
|
|||||||
) as HTMLInputElement;
|
) as HTMLInputElement;
|
||||||
const path = input.value.trim();
|
const path = input.value.trim();
|
||||||
if (path) {
|
if (path) {
|
||||||
field.onChange([...field.value, path]);
|
field.onChange([...(field.value || []), path]);
|
||||||
input.value = "";
|
input.value = "";
|
||||||
}
|
}
|
||||||
}}
|
}}
|
||||||
|
|||||||
+2
-2
@@ -1,4 +1,4 @@
|
|||||||
import { zodResolver } from "@hookform/resolvers/zod";
|
import { standardSchemaResolver as zodResolver } from "@hookform/resolvers/standard-schema";
|
||||||
import { CheckIcon, ChevronsUpDown, HelpCircle, Plus, X } from "lucide-react";
|
import { CheckIcon, ChevronsUpDown, HelpCircle, Plus, X } from "lucide-react";
|
||||||
import Link from "next/link";
|
import Link from "next/link";
|
||||||
import { useEffect } from "react";
|
import { useEffect } from "react";
|
||||||
@@ -75,7 +75,7 @@ export const SaveGithubProvider = ({ applicationId }: Props) => {
|
|||||||
const { mutateAsync, isLoading: isSavingGithubProvider } =
|
const { mutateAsync, isLoading: isSavingGithubProvider } =
|
||||||
api.application.saveGithubProvider.useMutation();
|
api.application.saveGithubProvider.useMutation();
|
||||||
|
|
||||||
const form = useForm<GithubProvider>({
|
const form = useForm({
|
||||||
defaultValues: {
|
defaultValues: {
|
||||||
buildPath: "/",
|
buildPath: "/",
|
||||||
repository: {
|
repository: {
|
||||||
|
|||||||
+2
-2
@@ -1,4 +1,4 @@
|
|||||||
import { zodResolver } from "@hookform/resolvers/zod";
|
import { standardSchemaResolver as zodResolver } from "@hookform/resolvers/standard-schema";
|
||||||
import { CheckIcon, ChevronsUpDown, HelpCircle, Plus, X } from "lucide-react";
|
import { CheckIcon, ChevronsUpDown, HelpCircle, Plus, X } from "lucide-react";
|
||||||
import Link from "next/link";
|
import Link from "next/link";
|
||||||
import { useEffect, useMemo } from "react";
|
import { useEffect, useMemo } from "react";
|
||||||
@@ -77,7 +77,7 @@ export const SaveGitlabProvider = ({ applicationId }: Props) => {
|
|||||||
const { mutateAsync, isLoading: isSavingGitlabProvider } =
|
const { mutateAsync, isLoading: isSavingGitlabProvider } =
|
||||||
api.application.saveGitlabProvider.useMutation();
|
api.application.saveGitlabProvider.useMutation();
|
||||||
|
|
||||||
const form = useForm<GitlabProvider>({
|
const form = useForm({
|
||||||
defaultValues: {
|
defaultValues: {
|
||||||
buildPath: "/",
|
buildPath: "/",
|
||||||
repository: {
|
repository: {
|
||||||
|
|||||||
+1
-1
@@ -1,4 +1,4 @@
|
|||||||
import { zodResolver } from "@hookform/resolvers/zod";
|
import { standardSchemaResolver as zodResolver } from "@hookform/resolvers/standard-schema";
|
||||||
import { Dices } from "lucide-react";
|
import { Dices } from "lucide-react";
|
||||||
import { useEffect, useState } from "react";
|
import { useEffect, useState } from "react";
|
||||||
import { useForm } from "react-hook-form";
|
import { useForm } from "react-hook-form";
|
||||||
|
|||||||
+1
-1
@@ -1,4 +1,4 @@
|
|||||||
import { zodResolver } from "@hookform/resolvers/zod";
|
import { standardSchemaResolver as zodResolver } from "@hookform/resolvers/standard-schema";
|
||||||
import { HelpCircle, Plus, Settings2, X } from "lucide-react";
|
import { HelpCircle, Plus, Settings2, X } from "lucide-react";
|
||||||
import { useEffect, useState } from "react";
|
import { useEffect, useState } from "react";
|
||||||
import { useForm } from "react-hook-form";
|
import { useForm } from "react-hook-form";
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import { zodResolver } from "@hookform/resolvers/zod";
|
import { standardSchemaResolver as zodResolver } from "@hookform/resolvers/standard-schema";
|
||||||
import Link from "next/link";
|
import Link from "next/link";
|
||||||
import { useEffect, useState } from "react";
|
import { useEffect, useState } from "react";
|
||||||
import { useForm } from "react-hook-form";
|
import { useForm } from "react-hook-form";
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import { zodResolver } from "@hookform/resolvers/zod";
|
import { standardSchemaResolver } from "@hookform/resolvers/standard-schema";
|
||||||
import {
|
import {
|
||||||
CheckIcon,
|
CheckIcon,
|
||||||
ChevronsUpDown,
|
ChevronsUpDown,
|
||||||
@@ -220,8 +220,8 @@ export const HandleSchedules = ({ id, scheduleId, scheduleType }: Props) => {
|
|||||||
const [isOpen, setIsOpen] = useState(false);
|
const [isOpen, setIsOpen] = useState(false);
|
||||||
const [cacheType, setCacheType] = useState<CacheType>("cache");
|
const [cacheType, setCacheType] = useState<CacheType>("cache");
|
||||||
const utils = api.useUtils();
|
const utils = api.useUtils();
|
||||||
const form = useForm<z.infer<typeof formSchema>>({
|
const form = useForm({
|
||||||
resolver: zodResolver(formSchema),
|
resolver: standardSchemaResolver(formSchema),
|
||||||
defaultValues: {
|
defaultValues: {
|
||||||
name: "",
|
name: "",
|
||||||
cronExpression: "",
|
cronExpression: "",
|
||||||
@@ -279,7 +279,7 @@ export const HandleSchedules = ({ id, scheduleId, scheduleType }: Props) => {
|
|||||||
? api.schedule.update.useMutation()
|
? api.schedule.update.useMutation()
|
||||||
: api.schedule.create.useMutation();
|
: api.schedule.create.useMutation();
|
||||||
|
|
||||||
const onSubmit = async (values: z.infer<typeof formSchema>) => {
|
const onSubmit = async (values: z.output<typeof formSchema>) => {
|
||||||
if (!id && !scheduleId) return;
|
if (!id && !scheduleId) return;
|
||||||
|
|
||||||
await mutateAsync({
|
await mutateAsync({
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import { zodResolver } from "@hookform/resolvers/zod";
|
import { standardSchemaResolver as zodResolver } from "@hookform/resolvers/standard-schema";
|
||||||
import { PenBoxIcon } from "lucide-react";
|
import { PenBoxIcon } from "lucide-react";
|
||||||
import { useEffect, useState } from "react";
|
import { useEffect, useState } from "react";
|
||||||
import { useForm } from "react-hook-form";
|
import { useForm } from "react-hook-form";
|
||||||
|
|||||||
+2
-2
@@ -1,4 +1,4 @@
|
|||||||
import { zodResolver } from "@hookform/resolvers/zod";
|
import { standardSchemaResolver as zodResolver } from "@hookform/resolvers/standard-schema";
|
||||||
import { DatabaseZap, PenBoxIcon, PlusCircle, RefreshCw } from "lucide-react";
|
import { DatabaseZap, PenBoxIcon, PlusCircle, RefreshCw } from "lucide-react";
|
||||||
import { useEffect, useState } from "react";
|
import { useEffect, useState } from "react";
|
||||||
import { useForm } from "react-hook-form";
|
import { useForm } from "react-hook-form";
|
||||||
@@ -116,7 +116,7 @@ export const HandleVolumeBackups = ({
|
|||||||
const [keepLatestCountInput, setKeepLatestCountInput] = useState("");
|
const [keepLatestCountInput, setKeepLatestCountInput] = useState("");
|
||||||
|
|
||||||
const utils = api.useUtils();
|
const utils = api.useUtils();
|
||||||
const form = useForm<z.infer<typeof formSchema>>({
|
const form = useForm({
|
||||||
resolver: zodResolver(formSchema),
|
resolver: zodResolver(formSchema),
|
||||||
defaultValues: {
|
defaultValues: {
|
||||||
name: "",
|
name: "",
|
||||||
|
|||||||
+11
-23
@@ -1,4 +1,4 @@
|
|||||||
import { zodResolver } from "@hookform/resolvers/zod";
|
import { standardSchemaResolver as zodResolver } from "@hookform/resolvers/standard-schema";
|
||||||
import copy from "copy-to-clipboard";
|
import copy from "copy-to-clipboard";
|
||||||
import { debounce } from "lodash";
|
import { debounce } from "lodash";
|
||||||
import { CheckIcon, ChevronsUpDown, Copy, RotateCcw } from "lucide-react";
|
import { CheckIcon, ChevronsUpDown, Copy, RotateCcw } from "lucide-react";
|
||||||
@@ -53,27 +53,15 @@ interface Props {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const RestoreBackupSchema = z.object({
|
const RestoreBackupSchema = z.object({
|
||||||
destinationId: z
|
destinationId: z.string().min(1, {
|
||||||
.string({
|
message: "Destination is required",
|
||||||
required_error: "Please select a destination",
|
}),
|
||||||
})
|
backupFile: z.string().min(1, {
|
||||||
.min(1, {
|
message: "Backup file is required",
|
||||||
message: "Destination is required",
|
}),
|
||||||
}),
|
volumeName: z.string().min(1, {
|
||||||
backupFile: z
|
message: "Volume name is required",
|
||||||
.string({
|
}),
|
||||||
required_error: "Please select a backup file",
|
|
||||||
})
|
|
||||||
.min(1, {
|
|
||||||
message: "Backup file is required",
|
|
||||||
}),
|
|
||||||
volumeName: z
|
|
||||||
.string({
|
|
||||||
required_error: "Please enter a volume name",
|
|
||||||
})
|
|
||||||
.min(1, {
|
|
||||||
message: "Volume name is required",
|
|
||||||
}),
|
|
||||||
});
|
});
|
||||||
|
|
||||||
export const RestoreVolumeBackups = ({ id, type, serverId }: Props) => {
|
export const RestoreVolumeBackups = ({ id, type, serverId }: Props) => {
|
||||||
@@ -83,7 +71,7 @@ export const RestoreVolumeBackups = ({ id, type, serverId }: Props) => {
|
|||||||
|
|
||||||
const { data: destinations = [] } = api.destination.all.useQuery();
|
const { data: destinations = [] } = api.destination.all.useQuery();
|
||||||
|
|
||||||
const form = useForm<z.infer<typeof RestoreBackupSchema>>({
|
const form = useForm({
|
||||||
defaultValues: {
|
defaultValues: {
|
||||||
destinationId: "",
|
destinationId: "",
|
||||||
backupFile: "",
|
backupFile: "",
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import { zodResolver } from "@hookform/resolvers/zod";
|
import { standardSchemaResolver as zodResolver } from "@hookform/resolvers/standard-schema";
|
||||||
import { useEffect } from "react";
|
import { useEffect } from "react";
|
||||||
import { useForm } from "react-hook-form";
|
import { useForm } from "react-hook-form";
|
||||||
import { toast } from "sonner";
|
import { toast } from "sonner";
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import { zodResolver } from "@hookform/resolvers/zod";
|
import { standardSchemaResolver as zodResolver } from "@hookform/resolvers/standard-schema";
|
||||||
import { AlertTriangle, Loader2 } from "lucide-react";
|
import { AlertTriangle, Loader2 } from "lucide-react";
|
||||||
import { useEffect, useState } from "react";
|
import { useEffect, useState } from "react";
|
||||||
import { useForm } from "react-hook-form";
|
import { useForm } from "react-hook-form";
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import type { ServiceType } from "@dokploy/server/db/schema";
|
import type { ServiceType } from "@dokploy/server/db/schema";
|
||||||
import { zodResolver } from "@hookform/resolvers/zod";
|
import { standardSchemaResolver as zodResolver } from "@hookform/resolvers/standard-schema";
|
||||||
import copy from "copy-to-clipboard";
|
import copy from "copy-to-clipboard";
|
||||||
import { Copy, Trash2 } from "lucide-react";
|
import { Copy, Trash2 } from "lucide-react";
|
||||||
import { useRouter } from "next/router";
|
import { useRouter } from "next/router";
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import { zodResolver } from "@hookform/resolvers/zod";
|
import { standardSchemaResolver as zodResolver } from "@hookform/resolvers/standard-schema";
|
||||||
import { useEffect, useState } from "react";
|
import { useEffect, useState } from "react";
|
||||||
import { useForm } from "react-hook-form";
|
import { useForm } from "react-hook-form";
|
||||||
import { toast } from "sonner";
|
import { toast } from "sonner";
|
||||||
|
|||||||
+2
-2
@@ -1,4 +1,4 @@
|
|||||||
import { zodResolver } from "@hookform/resolvers/zod";
|
import { standardSchemaResolver as zodResolver } from "@hookform/resolvers/standard-schema";
|
||||||
import { CheckIcon, ChevronsUpDown, X } from "lucide-react";
|
import { CheckIcon, ChevronsUpDown, X } from "lucide-react";
|
||||||
import Link from "next/link";
|
import Link from "next/link";
|
||||||
import { useEffect } from "react";
|
import { useEffect } from "react";
|
||||||
@@ -77,7 +77,7 @@ export const SaveBitbucketProviderCompose = ({ composeId }: Props) => {
|
|||||||
const { mutateAsync, isLoading: isSavingBitbucketProvider } =
|
const { mutateAsync, isLoading: isSavingBitbucketProvider } =
|
||||||
api.compose.update.useMutation();
|
api.compose.update.useMutation();
|
||||||
|
|
||||||
const form = useForm<BitbucketProvider>({
|
const form = useForm({
|
||||||
defaultValues: {
|
defaultValues: {
|
||||||
composePath: "./docker-compose.yml",
|
composePath: "./docker-compose.yml",
|
||||||
repository: {
|
repository: {
|
||||||
|
|||||||
+2
-2
@@ -1,4 +1,4 @@
|
|||||||
import { zodResolver } from "@hookform/resolvers/zod";
|
import { standardSchemaResolver as zodResolver } from "@hookform/resolvers/standard-schema";
|
||||||
import { KeyRoundIcon, LockIcon, X } from "lucide-react";
|
import { KeyRoundIcon, LockIcon, X } from "lucide-react";
|
||||||
import Link from "next/link";
|
import Link from "next/link";
|
||||||
import { useRouter } from "next/router";
|
import { useRouter } from "next/router";
|
||||||
@@ -60,7 +60,7 @@ export const SaveGitProviderCompose = ({ composeId }: Props) => {
|
|||||||
|
|
||||||
const { mutateAsync, isLoading } = api.compose.update.useMutation();
|
const { mutateAsync, isLoading } = api.compose.update.useMutation();
|
||||||
|
|
||||||
const form = useForm<GitProvider>({
|
const form = useForm({
|
||||||
defaultValues: {
|
defaultValues: {
|
||||||
branch: "",
|
branch: "",
|
||||||
repositoryURL: "",
|
repositoryURL: "",
|
||||||
|
|||||||
+2
-2
@@ -1,4 +1,4 @@
|
|||||||
import { zodResolver } from "@hookform/resolvers/zod";
|
import { standardSchemaResolver as zodResolver } from "@hookform/resolvers/standard-schema";
|
||||||
import { CheckIcon, ChevronsUpDown, Plus, X } from "lucide-react";
|
import { CheckIcon, ChevronsUpDown, Plus, X } from "lucide-react";
|
||||||
import Link from "next/link";
|
import Link from "next/link";
|
||||||
import { useEffect } from "react";
|
import { useEffect } from "react";
|
||||||
@@ -75,7 +75,7 @@ export const SaveGiteaProviderCompose = ({ composeId }: Props) => {
|
|||||||
const { mutateAsync, isLoading: isSavingGiteaProvider } =
|
const { mutateAsync, isLoading: isSavingGiteaProvider } =
|
||||||
api.compose.update.useMutation();
|
api.compose.update.useMutation();
|
||||||
|
|
||||||
const form = useForm<GiteaProvider>({
|
const form = useForm({
|
||||||
defaultValues: {
|
defaultValues: {
|
||||||
composePath: "./docker-compose.yml",
|
composePath: "./docker-compose.yml",
|
||||||
repository: {
|
repository: {
|
||||||
|
|||||||
+2
-2
@@ -1,4 +1,4 @@
|
|||||||
import { zodResolver } from "@hookform/resolvers/zod";
|
import { standardSchemaResolver as zodResolver } from "@hookform/resolvers/standard-schema";
|
||||||
import { CheckIcon, ChevronsUpDown, HelpCircle, X } from "lucide-react";
|
import { CheckIcon, ChevronsUpDown, HelpCircle, X } from "lucide-react";
|
||||||
import Link from "next/link";
|
import Link from "next/link";
|
||||||
import { useEffect } from "react";
|
import { useEffect } from "react";
|
||||||
@@ -75,7 +75,7 @@ export const SaveGithubProviderCompose = ({ composeId }: Props) => {
|
|||||||
const { mutateAsync, isLoading: isSavingGithubProvider } =
|
const { mutateAsync, isLoading: isSavingGithubProvider } =
|
||||||
api.compose.update.useMutation();
|
api.compose.update.useMutation();
|
||||||
|
|
||||||
const form = useForm<GithubProvider>({
|
const form = useForm({
|
||||||
defaultValues: {
|
defaultValues: {
|
||||||
composePath: "./docker-compose.yml",
|
composePath: "./docker-compose.yml",
|
||||||
repository: {
|
repository: {
|
||||||
|
|||||||
+2
-2
@@ -1,4 +1,4 @@
|
|||||||
import { zodResolver } from "@hookform/resolvers/zod";
|
import { standardSchemaResolver as zodResolver } from "@hookform/resolvers/standard-schema";
|
||||||
import { CheckIcon, ChevronsUpDown, X } from "lucide-react";
|
import { CheckIcon, ChevronsUpDown, X } from "lucide-react";
|
||||||
import Link from "next/link";
|
import Link from "next/link";
|
||||||
import { useEffect, useMemo } from "react";
|
import { useEffect, useMemo } from "react";
|
||||||
@@ -77,7 +77,7 @@ export const SaveGitlabProviderCompose = ({ composeId }: Props) => {
|
|||||||
const { mutateAsync, isLoading: isSavingGitlabProvider } =
|
const { mutateAsync, isLoading: isSavingGitlabProvider } =
|
||||||
api.compose.update.useMutation();
|
api.compose.update.useMutation();
|
||||||
|
|
||||||
const form = useForm<GitlabProvider>({
|
const form = useForm({
|
||||||
defaultValues: {
|
defaultValues: {
|
||||||
composePath: "./docker-compose.yml",
|
composePath: "./docker-compose.yml",
|
||||||
repository: {
|
repository: {
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import { zodResolver } from "@hookform/resolvers/zod";
|
import { standardSchemaResolver as zodResolver } from "@hookform/resolvers/standard-schema";
|
||||||
import { AlertTriangle } from "lucide-react";
|
import { AlertTriangle } from "lucide-react";
|
||||||
import { useEffect, useState } from "react";
|
import { useEffect, useState } from "react";
|
||||||
import { useForm } from "react-hook-form";
|
import { useForm } from "react-hook-form";
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import { zodResolver } from "@hookform/resolvers/zod";
|
import { standardSchemaResolver as zodResolver } from "@hookform/resolvers/standard-schema";
|
||||||
import { PenBoxIcon } from "lucide-react";
|
import { PenBoxIcon } from "lucide-react";
|
||||||
import { useEffect, useState } from "react";
|
import { useEffect, useState } from "react";
|
||||||
import { useForm } from "react-hook-form";
|
import { useForm } from "react-hook-form";
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import { zodResolver } from "@hookform/resolvers/zod";
|
import { standardSchemaResolver as zodResolver } from "@hookform/resolvers/standard-schema";
|
||||||
import {
|
import {
|
||||||
CheckIcon,
|
CheckIcon,
|
||||||
ChevronsUpDown,
|
ChevronsUpDown,
|
||||||
@@ -207,7 +207,7 @@ export const HandleBackup = ({
|
|||||||
? api.backup.update.useMutation()
|
? api.backup.update.useMutation()
|
||||||
: api.backup.create.useMutation();
|
: api.backup.create.useMutation();
|
||||||
|
|
||||||
const form = useForm<z.infer<typeof Schema>>({
|
const form = useForm({
|
||||||
defaultValues: {
|
defaultValues: {
|
||||||
database: databaseType === "web-server" ? "dokploy" : "",
|
database: databaseType === "web-server" ? "dokploy" : "",
|
||||||
destinationId: "",
|
destinationId: "",
|
||||||
@@ -613,6 +613,7 @@ export const HandleBackup = ({
|
|||||||
type="number"
|
type="number"
|
||||||
placeholder={"keeps all the backups if left empty"}
|
placeholder={"keeps all the backups if left empty"}
|
||||||
{...field}
|
{...field}
|
||||||
|
value={field.value as string}
|
||||||
/>
|
/>
|
||||||
</FormControl>
|
</FormControl>
|
||||||
<FormDescription>
|
<FormDescription>
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import { zodResolver } from "@hookform/resolvers/zod";
|
import { standardSchemaResolver as zodResolver } from "@hookform/resolvers/standard-schema";
|
||||||
import copy from "copy-to-clipboard";
|
import copy from "copy-to-clipboard";
|
||||||
import _ from "lodash";
|
import _ from "lodash";
|
||||||
import {
|
import {
|
||||||
@@ -78,27 +78,15 @@ interface Props {
|
|||||||
|
|
||||||
const RestoreBackupSchema = z
|
const RestoreBackupSchema = z
|
||||||
.object({
|
.object({
|
||||||
destinationId: z
|
destinationId: z.string().min(1, {
|
||||||
.string({
|
message: "Destination is required",
|
||||||
required_error: "Please select a destination",
|
}),
|
||||||
})
|
backupFile: z.string().min(1, {
|
||||||
.min(1, {
|
message: "Backup file is required",
|
||||||
message: "Destination is required",
|
}),
|
||||||
}),
|
databaseName: z.string().min(1, {
|
||||||
backupFile: z
|
message: "Database name is required",
|
||||||
.string({
|
}),
|
||||||
required_error: "Please select a backup file",
|
|
||||||
})
|
|
||||||
.min(1, {
|
|
||||||
message: "Backup file is required",
|
|
||||||
}),
|
|
||||||
databaseName: z
|
|
||||||
.string({
|
|
||||||
required_error: "Please enter a database name",
|
|
||||||
})
|
|
||||||
.min(1, {
|
|
||||||
message: "Database name is required",
|
|
||||||
}),
|
|
||||||
databaseType: z
|
databaseType: z
|
||||||
.enum(["postgres", "mariadb", "mysql", "mongo", "web-server"])
|
.enum(["postgres", "mariadb", "mysql", "mongo", "web-server"])
|
||||||
.optional(),
|
.optional(),
|
||||||
@@ -219,7 +207,7 @@ export const RestoreBackup = ({
|
|||||||
|
|
||||||
const { data: destinations = [] } = api.destination.all.useQuery();
|
const { data: destinations = [] } = api.destination.all.useQuery();
|
||||||
|
|
||||||
const form = useForm<z.infer<typeof RestoreBackupSchema>>({
|
const form = useForm({
|
||||||
defaultValues: {
|
defaultValues: {
|
||||||
destinationId: "",
|
destinationId: "",
|
||||||
backupFile: "",
|
backupFile: "",
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import { zodResolver } from "@hookform/resolvers/zod";
|
import { standardSchemaResolver as zodResolver } from "@hookform/resolvers/standard-schema";
|
||||||
import { Loader2 } from "lucide-react";
|
import { Loader2 } from "lucide-react";
|
||||||
import { useEffect, useState } from "react";
|
import { useEffect, useState } from "react";
|
||||||
import { useForm } from "react-hook-form";
|
import { useForm } from "react-hook-form";
|
||||||
|
|||||||
+3
-3
@@ -1,4 +1,4 @@
|
|||||||
import { zodResolver } from "@hookform/resolvers/zod";
|
import { standardSchemaResolver as zodResolver } from "@hookform/resolvers/standard-schema";
|
||||||
import Link from "next/link";
|
import Link from "next/link";
|
||||||
import { useEffect, useState } from "react";
|
import { useEffect, useState } from "react";
|
||||||
import { useForm } from "react-hook-form";
|
import { useForm } from "react-hook-form";
|
||||||
@@ -51,7 +51,7 @@ export const ShowExternalMariadbCredentials = ({ mariadbId }: Props) => {
|
|||||||
const { mutateAsync, isLoading } = api.mariadb.saveExternalPort.useMutation();
|
const { mutateAsync, isLoading } = api.mariadb.saveExternalPort.useMutation();
|
||||||
const [connectionUrl, setConnectionUrl] = useState("");
|
const [connectionUrl, setConnectionUrl] = useState("");
|
||||||
const getIp = data?.server?.ipAddress || ip;
|
const getIp = data?.server?.ipAddress || ip;
|
||||||
const form = useForm<DockerProvider>({
|
const form = useForm({
|
||||||
defaultValues: {},
|
defaultValues: {},
|
||||||
resolver: zodResolver(DockerProviderSchema),
|
resolver: zodResolver(DockerProviderSchema),
|
||||||
});
|
});
|
||||||
@@ -140,7 +140,7 @@ export const ShowExternalMariadbCredentials = ({ mariadbId }: Props) => {
|
|||||||
<Input
|
<Input
|
||||||
placeholder="3306"
|
placeholder="3306"
|
||||||
{...field}
|
{...field}
|
||||||
value={field.value || ""}
|
value={field.value as string}
|
||||||
/>
|
/>
|
||||||
</FormControl>
|
</FormControl>
|
||||||
<FormMessage />
|
<FormMessage />
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import { zodResolver } from "@hookform/resolvers/zod";
|
import { standardSchemaResolver as zodResolver } from "@hookform/resolvers/standard-schema";
|
||||||
import { PenBoxIcon } from "lucide-react";
|
import { PenBoxIcon } from "lucide-react";
|
||||||
import { useEffect } from "react";
|
import { useEffect } from "react";
|
||||||
import { useForm } from "react-hook-form";
|
import { useForm } from "react-hook-form";
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import { zodResolver } from "@hookform/resolvers/zod";
|
import { standardSchemaResolver as zodResolver } from "@hookform/resolvers/standard-schema";
|
||||||
import Link from "next/link";
|
import Link from "next/link";
|
||||||
import { useEffect, useState } from "react";
|
import { useEffect, useState } from "react";
|
||||||
import { useForm } from "react-hook-form";
|
import { useForm } from "react-hook-form";
|
||||||
@@ -51,7 +51,7 @@ export const ShowExternalMongoCredentials = ({ mongoId }: Props) => {
|
|||||||
const { mutateAsync, isLoading } = api.mongo.saveExternalPort.useMutation();
|
const { mutateAsync, isLoading } = api.mongo.saveExternalPort.useMutation();
|
||||||
const [connectionUrl, setConnectionUrl] = useState("");
|
const [connectionUrl, setConnectionUrl] = useState("");
|
||||||
const getIp = data?.server?.ipAddress || ip;
|
const getIp = data?.server?.ipAddress || ip;
|
||||||
const form = useForm<DockerProvider>({
|
const form = useForm({
|
||||||
defaultValues: {},
|
defaultValues: {},
|
||||||
resolver: zodResolver(DockerProviderSchema),
|
resolver: zodResolver(DockerProviderSchema),
|
||||||
});
|
});
|
||||||
@@ -140,7 +140,7 @@ export const ShowExternalMongoCredentials = ({ mongoId }: Props) => {
|
|||||||
<Input
|
<Input
|
||||||
placeholder="27017"
|
placeholder="27017"
|
||||||
{...field}
|
{...field}
|
||||||
value={field.value || ""}
|
value={field.value as string}
|
||||||
/>
|
/>
|
||||||
</FormControl>
|
</FormControl>
|
||||||
<FormMessage />
|
<FormMessage />
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import { zodResolver } from "@hookform/resolvers/zod";
|
import { standardSchemaResolver as zodResolver } from "@hookform/resolvers/standard-schema";
|
||||||
import { PenBoxIcon } from "lucide-react";
|
import { PenBoxIcon } from "lucide-react";
|
||||||
import { useEffect, useState } from "react";
|
import { useEffect, useState } from "react";
|
||||||
import { useForm } from "react-hook-form";
|
import { useForm } from "react-hook-form";
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import { zodResolver } from "@hookform/resolvers/zod";
|
import { standardSchemaResolver as zodResolver } from "@hookform/resolvers/standard-schema";
|
||||||
import Link from "next/link";
|
import Link from "next/link";
|
||||||
import { useEffect, useState } from "react";
|
import { useEffect, useState } from "react";
|
||||||
import { useForm } from "react-hook-form";
|
import { useForm } from "react-hook-form";
|
||||||
@@ -51,7 +51,7 @@ export const ShowExternalMysqlCredentials = ({ mysqlId }: Props) => {
|
|||||||
const { mutateAsync, isLoading } = api.mysql.saveExternalPort.useMutation();
|
const { mutateAsync, isLoading } = api.mysql.saveExternalPort.useMutation();
|
||||||
const [connectionUrl, setConnectionUrl] = useState("");
|
const [connectionUrl, setConnectionUrl] = useState("");
|
||||||
const getIp = data?.server?.ipAddress || ip;
|
const getIp = data?.server?.ipAddress || ip;
|
||||||
const form = useForm<DockerProvider>({
|
const form = useForm({
|
||||||
defaultValues: {},
|
defaultValues: {},
|
||||||
resolver: zodResolver(DockerProviderSchema),
|
resolver: zodResolver(DockerProviderSchema),
|
||||||
});
|
});
|
||||||
@@ -140,7 +140,7 @@ export const ShowExternalMysqlCredentials = ({ mysqlId }: Props) => {
|
|||||||
<Input
|
<Input
|
||||||
placeholder="3306"
|
placeholder="3306"
|
||||||
{...field}
|
{...field}
|
||||||
value={field.value || ""}
|
value={field.value as string}
|
||||||
/>
|
/>
|
||||||
</FormControl>
|
</FormControl>
|
||||||
<FormMessage />
|
<FormMessage />
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import { zodResolver } from "@hookform/resolvers/zod";
|
import { standardSchemaResolver as zodResolver } from "@hookform/resolvers/standard-schema";
|
||||||
import { PenBoxIcon } from "lucide-react";
|
import { PenBoxIcon } from "lucide-react";
|
||||||
import { useEffect } from "react";
|
import { useEffect } from "react";
|
||||||
import { useForm } from "react-hook-form";
|
import { useForm } from "react-hook-form";
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import { zodResolver } from "@hookform/resolvers/zod";
|
import { standardSchemaResolver as zodResolver } from "@hookform/resolvers/standard-schema";
|
||||||
import { PenBoxIcon, Plus } from "lucide-react";
|
import { PenBoxIcon, Plus } from "lucide-react";
|
||||||
import { useEffect, useState } from "react";
|
import { useEffect, useState } from "react";
|
||||||
import { useForm } from "react-hook-form";
|
import { useForm } from "react-hook-form";
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import { zodResolver } from "@hookform/resolvers/zod";
|
import { standardSchemaResolver as zodResolver } from "@hookform/resolvers/standard-schema";
|
||||||
import { Plus, Trash2 } from "lucide-react";
|
import { Plus, Trash2 } from "lucide-react";
|
||||||
import { useEffect } from "react";
|
import { useEffect } from "react";
|
||||||
import { useFieldArray, useForm } from "react-hook-form";
|
import { useFieldArray, useForm } from "react-hook-form";
|
||||||
|
|||||||
+3
-3
@@ -1,4 +1,4 @@
|
|||||||
import { zodResolver } from "@hookform/resolvers/zod";
|
import { standardSchemaResolver as zodResolver } from "@hookform/resolvers/standard-schema";
|
||||||
import Link from "next/link";
|
import Link from "next/link";
|
||||||
import { useEffect, useState } from "react";
|
import { useEffect, useState } from "react";
|
||||||
import { useForm } from "react-hook-form";
|
import { useForm } from "react-hook-form";
|
||||||
@@ -53,7 +53,7 @@ export const ShowExternalPostgresCredentials = ({ postgresId }: Props) => {
|
|||||||
const getIp = data?.server?.ipAddress || ip;
|
const getIp = data?.server?.ipAddress || ip;
|
||||||
const [connectionUrl, setConnectionUrl] = useState("");
|
const [connectionUrl, setConnectionUrl] = useState("");
|
||||||
|
|
||||||
const form = useForm<DockerProvider>({
|
const form = useForm({
|
||||||
defaultValues: {},
|
defaultValues: {},
|
||||||
resolver: zodResolver(DockerProviderSchema),
|
resolver: zodResolver(DockerProviderSchema),
|
||||||
});
|
});
|
||||||
@@ -142,7 +142,7 @@ export const ShowExternalPostgresCredentials = ({ postgresId }: Props) => {
|
|||||||
<Input
|
<Input
|
||||||
placeholder="5432"
|
placeholder="5432"
|
||||||
{...field}
|
{...field}
|
||||||
value={field.value || ""}
|
value={field.value as string}
|
||||||
/>
|
/>
|
||||||
</FormControl>
|
</FormControl>
|
||||||
<FormMessage />
|
<FormMessage />
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import { zodResolver } from "@hookform/resolvers/zod";
|
import { standardSchemaResolver as zodResolver } from "@hookform/resolvers/standard-schema";
|
||||||
import { PenBox } from "lucide-react";
|
import { PenBox } from "lucide-react";
|
||||||
import { useEffect, useState } from "react";
|
import { useEffect, useState } from "react";
|
||||||
import { useForm } from "react-hook-form";
|
import { useForm } from "react-hook-form";
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import { zodResolver } from "@hookform/resolvers/zod";
|
import { standardSchemaResolver as zodResolver } from "@hookform/resolvers/standard-schema";
|
||||||
import { Folder, HelpCircle } from "lucide-react";
|
import { Folder, HelpCircle } from "lucide-react";
|
||||||
import { useState } from "react";
|
import { useState } from "react";
|
||||||
import { useForm } from "react-hook-form";
|
import { useForm } from "react-hook-form";
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import { zodResolver } from "@hookform/resolvers/zod";
|
import { standardSchemaResolver as zodResolver } from "@hookform/resolvers/standard-schema";
|
||||||
import { CircuitBoard, HelpCircle } from "lucide-react";
|
import { CircuitBoard, HelpCircle } from "lucide-react";
|
||||||
import { useEffect, useState } from "react";
|
import { useEffect, useState } from "react";
|
||||||
import { useForm } from "react-hook-form";
|
import { useForm } from "react-hook-form";
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import { zodResolver } from "@hookform/resolvers/zod";
|
import { standardSchemaResolver as zodResolver } from "@hookform/resolvers/standard-schema";
|
||||||
import { AlertTriangle, Database, HelpCircle } from "lucide-react";
|
import { AlertTriangle, Database, HelpCircle } from "lucide-react";
|
||||||
import { useState } from "react";
|
import { useState } from "react";
|
||||||
import { useForm } from "react-hook-form";
|
import { useForm } from "react-hook-form";
|
||||||
@@ -52,7 +52,7 @@ import {
|
|||||||
import { slugify } from "@/lib/slug";
|
import { slugify } from "@/lib/slug";
|
||||||
import { api } from "@/utils/api";
|
import { api } from "@/utils/api";
|
||||||
|
|
||||||
type DbType = typeof mySchema._type.type;
|
type DbType = z.infer<typeof mySchema>["type"];
|
||||||
|
|
||||||
const dockerImageDefaultPlaceholder: Record<DbType, string> = {
|
const dockerImageDefaultPlaceholder: Record<DbType, string> = {
|
||||||
mongo: "mongo:7",
|
mongo: "mongo:7",
|
||||||
@@ -196,7 +196,7 @@ export const AddDatabase = ({ environmentId, projectName }: Props) => {
|
|||||||
// Self-hosted: show only if there are remote servers (Dokploy is default, hide if no remote servers)
|
// Self-hosted: show only if there are remote servers (Dokploy is default, hide if no remote servers)
|
||||||
const shouldShowServerDropdown = hasServers;
|
const shouldShowServerDropdown = hasServers;
|
||||||
|
|
||||||
const form = useForm<AddDatabase>({
|
const form = useForm({
|
||||||
defaultValues: {
|
defaultValues: {
|
||||||
type: "postgres",
|
type: "postgres",
|
||||||
dockerImage: "",
|
dockerImage: "",
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import { zodResolver } from "@hookform/resolvers/zod";
|
import { standardSchemaResolver as zodResolver } from "@hookform/resolvers/standard-schema";
|
||||||
import { Terminal } from "lucide-react";
|
import { Terminal } from "lucide-react";
|
||||||
import { useEffect, useState } from "react";
|
import { useEffect, useState } from "react";
|
||||||
import { useForm } from "react-hook-form";
|
import { useForm } from "react-hook-form";
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
import { zodResolver } from "@hookform/resolvers/zod";
|
import { standardSchemaResolver } from "@hookform/resolvers/standard-schema";
|
||||||
|
|
||||||
import { PlusIcon, SquarePen } from "lucide-react";
|
import { PlusIcon, SquarePen } from "lucide-react";
|
||||||
import { useRouter } from "next/router";
|
import { useRouter } from "next/router";
|
||||||
import { useEffect, useState } from "react";
|
import { useEffect, useState } from "react";
|
||||||
@@ -80,7 +81,7 @@ export const HandleProject = ({ projectId }: Props) => {
|
|||||||
description: "",
|
description: "",
|
||||||
name: "",
|
name: "",
|
||||||
},
|
},
|
||||||
resolver: zodResolver(AddProjectSchema),
|
resolver: standardSchemaResolver(AddProjectSchema),
|
||||||
});
|
});
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import { zodResolver } from "@hookform/resolvers/zod";
|
import { standardSchemaResolver as zodResolver } from "@hookform/resolvers/standard-schema";
|
||||||
import { FileIcon } from "lucide-react";
|
import { FileIcon } from "lucide-react";
|
||||||
import { useEffect, useState } from "react";
|
import { useEffect, useState } from "react";
|
||||||
import { useForm } from "react-hook-form";
|
import { useForm } from "react-hook-form";
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import { zodResolver } from "@hookform/resolvers/zod";
|
import { standardSchemaResolver as zodResolver } from "@hookform/resolvers/standard-schema";
|
||||||
import Link from "next/link";
|
import Link from "next/link";
|
||||||
import { useEffect, useState } from "react";
|
import { useEffect, useState } from "react";
|
||||||
import { useForm } from "react-hook-form";
|
import { useForm } from "react-hook-form";
|
||||||
@@ -52,7 +52,7 @@ export const ShowExternalRedisCredentials = ({ redisId }: Props) => {
|
|||||||
const [connectionUrl, setConnectionUrl] = useState("");
|
const [connectionUrl, setConnectionUrl] = useState("");
|
||||||
const getIp = data?.server?.ipAddress || ip;
|
const getIp = data?.server?.ipAddress || ip;
|
||||||
|
|
||||||
const form = useForm<DockerProvider>({
|
const form = useForm({
|
||||||
defaultValues: {},
|
defaultValues: {},
|
||||||
resolver: zodResolver(DockerProviderSchema),
|
resolver: zodResolver(DockerProviderSchema),
|
||||||
});
|
});
|
||||||
@@ -134,7 +134,7 @@ export const ShowExternalRedisCredentials = ({ redisId }: Props) => {
|
|||||||
<Input
|
<Input
|
||||||
placeholder="6379"
|
placeholder="6379"
|
||||||
{...field}
|
{...field}
|
||||||
value={field.value || ""}
|
value={field.value as string}
|
||||||
/>
|
/>
|
||||||
</FormControl>
|
</FormControl>
|
||||||
<FormMessage />
|
<FormMessage />
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import { zodResolver } from "@hookform/resolvers/zod";
|
import { standardSchemaResolver as zodResolver } from "@hookform/resolvers/standard-schema";
|
||||||
import { PenBoxIcon } from "lucide-react";
|
import { PenBoxIcon } from "lucide-react";
|
||||||
import { useEffect } from "react";
|
import { useEffect } from "react";
|
||||||
import { useForm } from "react-hook-form";
|
import { useForm } from "react-hook-form";
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import { zodResolver } from "@hookform/resolvers/zod";
|
import { standardSchemaResolver as zodResolver } from "@hookform/resolvers/standard-schema";
|
||||||
import copy from "copy-to-clipboard";
|
import copy from "copy-to-clipboard";
|
||||||
import { useState } from "react";
|
import { useState } from "react";
|
||||||
import { useForm } from "react-hook-form";
|
import { useForm } from "react-hook-form";
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import { zodResolver } from "@hookform/resolvers/zod";
|
import { standardSchemaResolver as zodResolver } from "@hookform/resolvers/standard-schema";
|
||||||
import { HelpCircle, PlusIcon } from "lucide-react";
|
import { HelpCircle, PlusIcon } from "lucide-react";
|
||||||
import { useEffect, useState } from "react";
|
import { useEffect, useState } from "react";
|
||||||
import { useForm } from "react-hook-form";
|
import { useForm } from "react-hook-form";
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import { zodResolver } from "@hookform/resolvers/zod";
|
import { standardSchemaResolver as zodResolver } from "@hookform/resolvers/standard-schema";
|
||||||
import { AlertTriangle, PenBoxIcon, PlusIcon } from "lucide-react";
|
import { AlertTriangle, PenBoxIcon, PlusIcon } from "lucide-react";
|
||||||
import { useEffect, useState } from "react";
|
import { useEffect, useState } from "react";
|
||||||
import { useForm } from "react-hook-form";
|
import { useForm } from "react-hook-form";
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import { zodResolver } from "@hookform/resolvers/zod";
|
import { standardSchemaResolver as zodResolver } from "@hookform/resolvers/standard-schema";
|
||||||
import { PenBoxIcon, PlusIcon } from "lucide-react";
|
import { PenBoxIcon, PlusIcon } from "lucide-react";
|
||||||
import { useEffect, useState } from "react";
|
import { useEffect, useState } from "react";
|
||||||
import { useForm } from "react-hook-form";
|
import { useForm } from "react-hook-form";
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import { zodResolver } from "@hookform/resolvers/zod";
|
import { standardSchemaResolver as zodResolver } from "@hookform/resolvers/standard-schema";
|
||||||
import { ExternalLink } from "lucide-react";
|
import { ExternalLink } from "lucide-react";
|
||||||
import Link from "next/link";
|
import Link from "next/link";
|
||||||
import { useEffect, useState } from "react";
|
import { useEffect, useState } from "react";
|
||||||
|
|||||||
+1
-1
@@ -1,4 +1,4 @@
|
|||||||
import { zodResolver } from "@hookform/resolvers/zod";
|
import { standardSchemaResolver as zodResolver } from "@hookform/resolvers/standard-schema";
|
||||||
import { PenBoxIcon } from "lucide-react";
|
import { PenBoxIcon } from "lucide-react";
|
||||||
import { useEffect, useState } from "react";
|
import { useEffect, useState } from "react";
|
||||||
import { useForm } from "react-hook-form";
|
import { useForm } from "react-hook-form";
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import { zodResolver } from "@hookform/resolvers/zod";
|
import { standardSchemaResolver as zodResolver } from "@hookform/resolvers/standard-schema";
|
||||||
import { ExternalLink } from "lucide-react";
|
import { ExternalLink } from "lucide-react";
|
||||||
import Link from "next/link";
|
import Link from "next/link";
|
||||||
import { useEffect, useState } from "react";
|
import { useEffect, useState } from "react";
|
||||||
@@ -19,9 +19,9 @@ import {
|
|||||||
import {
|
import {
|
||||||
Form,
|
Form,
|
||||||
FormControl,
|
FormControl,
|
||||||
|
FormDescription,
|
||||||
FormField,
|
FormField,
|
||||||
FormItem,
|
FormItem,
|
||||||
FormDescription,
|
|
||||||
FormLabel,
|
FormLabel,
|
||||||
FormMessage,
|
FormMessage,
|
||||||
} from "@/components/ui/form";
|
} from "@/components/ui/form";
|
||||||
@@ -68,7 +68,7 @@ export const AddGiteaProvider = () => {
|
|||||||
const { mutateAsync, error, isError } = api.gitea.create.useMutation();
|
const { mutateAsync, error, isError } = api.gitea.create.useMutation();
|
||||||
const webhookUrl = `${baseUrl}/api/providers/gitea/callback`;
|
const webhookUrl = `${baseUrl}/api/providers/gitea/callback`;
|
||||||
|
|
||||||
const form = useForm<Schema>({
|
const form = useForm({
|
||||||
defaultValues: {
|
defaultValues: {
|
||||||
clientId: "",
|
clientId: "",
|
||||||
clientSecret: "",
|
clientSecret: "",
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import { zodResolver } from "@hookform/resolvers/zod";
|
import { standardSchemaResolver as zodResolver } from "@hookform/resolvers/standard-schema";
|
||||||
import { PenBoxIcon } from "lucide-react";
|
import { PenBoxIcon } from "lucide-react";
|
||||||
import { useRouter } from "next/router";
|
import { useRouter } from "next/router";
|
||||||
import { useEffect, useState } from "react";
|
import { useEffect, useState } from "react";
|
||||||
@@ -17,9 +17,9 @@ import {
|
|||||||
import {
|
import {
|
||||||
Form,
|
Form,
|
||||||
FormControl,
|
FormControl,
|
||||||
|
FormDescription,
|
||||||
FormField,
|
FormField,
|
||||||
FormItem,
|
FormItem,
|
||||||
FormDescription,
|
|
||||||
FormLabel,
|
FormLabel,
|
||||||
FormMessage,
|
FormMessage,
|
||||||
} from "@/components/ui/form";
|
} from "@/components/ui/form";
|
||||||
@@ -94,7 +94,7 @@ export const EditGiteaProvider = ({ giteaId }: Props) => {
|
|||||||
}
|
}
|
||||||
}, [router.query, router.isReady, refetch]);
|
}, [router.query, router.isReady, refetch]);
|
||||||
|
|
||||||
const form = useForm<z.infer<typeof formSchema>>({
|
const form = useForm({
|
||||||
resolver: zodResolver(formSchema),
|
resolver: zodResolver(formSchema),
|
||||||
defaultValues: {
|
defaultValues: {
|
||||||
name: "",
|
name: "",
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import { zodResolver } from "@hookform/resolvers/zod";
|
import { standardSchemaResolver as zodResolver } from "@hookform/resolvers/standard-schema";
|
||||||
import { PenBoxIcon } from "lucide-react";
|
import { PenBoxIcon } from "lucide-react";
|
||||||
import { useEffect, useState } from "react";
|
import { useEffect, useState } from "react";
|
||||||
import { useForm } from "react-hook-form";
|
import { useForm } from "react-hook-form";
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import { zodResolver } from "@hookform/resolvers/zod";
|
import { standardSchemaResolver as zodResolver } from "@hookform/resolvers/standard-schema";
|
||||||
import { ExternalLink } from "lucide-react";
|
import { ExternalLink } from "lucide-react";
|
||||||
import Link from "next/link";
|
import Link from "next/link";
|
||||||
import { useEffect, useState } from "react";
|
import { useEffect, useState } from "react";
|
||||||
@@ -19,9 +19,9 @@ import {
|
|||||||
import {
|
import {
|
||||||
Form,
|
Form,
|
||||||
FormControl,
|
FormControl,
|
||||||
|
FormDescription,
|
||||||
FormField,
|
FormField,
|
||||||
FormItem,
|
FormItem,
|
||||||
FormDescription,
|
|
||||||
FormLabel,
|
FormLabel,
|
||||||
FormMessage,
|
FormMessage,
|
||||||
} from "@/components/ui/form";
|
} from "@/components/ui/form";
|
||||||
@@ -63,7 +63,7 @@ export const AddGitlabProvider = () => {
|
|||||||
const { mutateAsync, error, isError } = api.gitlab.create.useMutation();
|
const { mutateAsync, error, isError } = api.gitlab.create.useMutation();
|
||||||
const webhookUrl = `${url}/api/providers/gitlab/callback`;
|
const webhookUrl = `${url}/api/providers/gitlab/callback`;
|
||||||
|
|
||||||
const form = useForm<Schema>({
|
const form = useForm({
|
||||||
defaultValues: {
|
defaultValues: {
|
||||||
applicationId: "",
|
applicationId: "",
|
||||||
applicationSecret: "",
|
applicationSecret: "",
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import { zodResolver } from "@hookform/resolvers/zod";
|
import { standardSchemaResolver as zodResolver } from "@hookform/resolvers/standard-schema";
|
||||||
import { PenBoxIcon } from "lucide-react";
|
import { PenBoxIcon } from "lucide-react";
|
||||||
import { useEffect, useState } from "react";
|
import { useEffect, useState } from "react";
|
||||||
import { useForm } from "react-hook-form";
|
import { useForm } from "react-hook-form";
|
||||||
@@ -18,9 +18,9 @@ import {
|
|||||||
import {
|
import {
|
||||||
Form,
|
Form,
|
||||||
FormControl,
|
FormControl,
|
||||||
|
FormDescription,
|
||||||
FormField,
|
FormField,
|
||||||
FormItem,
|
FormItem,
|
||||||
FormDescription,
|
|
||||||
FormLabel,
|
FormLabel,
|
||||||
FormMessage,
|
FormMessage,
|
||||||
} from "@/components/ui/form";
|
} from "@/components/ui/form";
|
||||||
@@ -61,7 +61,7 @@ export const EditGitlabProvider = ({ gitlabId }: Props) => {
|
|||||||
const { mutateAsync, error, isError } = api.gitlab.update.useMutation();
|
const { mutateAsync, error, isError } = api.gitlab.update.useMutation();
|
||||||
const { mutateAsync: testConnection, isLoading } =
|
const { mutateAsync: testConnection, isLoading } =
|
||||||
api.gitlab.testConnection.useMutation();
|
api.gitlab.testConnection.useMutation();
|
||||||
const form = useForm<Schema>({
|
const form = useForm({
|
||||||
defaultValues: {
|
defaultValues: {
|
||||||
groupName: "",
|
groupName: "",
|
||||||
name: "",
|
name: "",
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
"use client";
|
"use client";
|
||||||
import { zodResolver } from "@hookform/resolvers/zod";
|
import { standardSchemaResolver as zodResolver } from "@hookform/resolvers/standard-schema";
|
||||||
import { Check, ChevronDown, PenBoxIcon, PlusIcon } from "lucide-react";
|
import { Check, ChevronDown, PenBoxIcon, PlusIcon } from "lucide-react";
|
||||||
import { useEffect, useState } from "react";
|
import { useEffect, useState } from "react";
|
||||||
import { useForm } from "react-hook-form";
|
import { useForm } from "react-hook-form";
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import { zodResolver } from "@hookform/resolvers/zod";
|
import { standardSchemaResolver as zodResolver } from "@hookform/resolvers/standard-schema";
|
||||||
import {
|
import {
|
||||||
AlertTriangle,
|
AlertTriangle,
|
||||||
Mail,
|
Mail,
|
||||||
@@ -298,7 +298,7 @@ export const HandleNotifications = ({ notificationId }: Props) => {
|
|||||||
? api.notification.updatePushover.useMutation()
|
? api.notification.updatePushover.useMutation()
|
||||||
: api.notification.createPushover.useMutation();
|
: api.notification.createPushover.useMutation();
|
||||||
|
|
||||||
const form = useForm<NotificationSchema>({
|
const form = useForm({
|
||||||
defaultValues: {
|
defaultValues: {
|
||||||
type: "slack",
|
type: "slack",
|
||||||
webhookUrl: "",
|
webhookUrl: "",
|
||||||
@@ -1898,7 +1898,7 @@ export const HandleNotifications = ({ notificationId }: Props) => {
|
|||||||
await testGotifyConnection({
|
await testGotifyConnection({
|
||||||
serverUrl: data.serverUrl,
|
serverUrl: data.serverUrl,
|
||||||
appToken: data.appToken,
|
appToken: data.appToken,
|
||||||
priority: data.priority,
|
priority: data.priority ?? 0,
|
||||||
decoration: data.decoration,
|
decoration: data.decoration,
|
||||||
});
|
});
|
||||||
} else if (data.type === "ntfy") {
|
} else if (data.type === "ntfy") {
|
||||||
@@ -1906,7 +1906,7 @@ export const HandleNotifications = ({ notificationId }: Props) => {
|
|||||||
serverUrl: data.serverUrl,
|
serverUrl: data.serverUrl,
|
||||||
topic: data.topic,
|
topic: data.topic,
|
||||||
accessToken: data.accessToken || "",
|
accessToken: data.accessToken || "",
|
||||||
priority: data.priority,
|
priority: data.priority ?? 0,
|
||||||
});
|
});
|
||||||
} else if (data.type === "lark") {
|
} else if (data.type === "lark") {
|
||||||
await testLarkConnection({
|
await testLarkConnection({
|
||||||
@@ -1943,7 +1943,7 @@ export const HandleNotifications = ({ notificationId }: Props) => {
|
|||||||
await testPushoverConnection({
|
await testPushoverConnection({
|
||||||
userKey: data.userKey,
|
userKey: data.userKey,
|
||||||
apiToken: data.apiToken,
|
apiToken: data.apiToken,
|
||||||
priority: data.priority,
|
priority: data.priority ?? 0,
|
||||||
retry: data.priority === 2 ? data.retry : undefined,
|
retry: data.priority === 2 ? data.retry : undefined,
|
||||||
expire: data.priority === 2 ? data.expire : undefined,
|
expire: data.priority === 2 ? data.expire : undefined,
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import { zodResolver } from "@hookform/resolvers/zod";
|
import { standardSchemaResolver as zodResolver } from "@hookform/resolvers/standard-schema";
|
||||||
import copy from "copy-to-clipboard";
|
import copy from "copy-to-clipboard";
|
||||||
import {
|
import {
|
||||||
CopyIcon,
|
CopyIcon,
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import { zodResolver } from "@hookform/resolvers/zod";
|
import { standardSchemaResolver as zodResolver } from "@hookform/resolvers/standard-schema";
|
||||||
import copy from "copy-to-clipboard";
|
import copy from "copy-to-clipboard";
|
||||||
import { CopyIcon, DownloadIcon, Fingerprint, QrCode } from "lucide-react";
|
import { CopyIcon, DownloadIcon, Fingerprint, QrCode } from "lucide-react";
|
||||||
import QRCode from "qrcode";
|
import QRCode from "qrcode";
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import { zodResolver } from "@hookform/resolvers/zod";
|
import { standardSchemaResolver as zodResolver } from "@hookform/resolvers/standard-schema";
|
||||||
import { Loader2, Palette, User } from "lucide-react";
|
import { Loader2, Palette, User } from "lucide-react";
|
||||||
import { useEffect, useMemo, useRef, useState } from "react";
|
import { useEffect, useMemo, useRef, useState } from "react";
|
||||||
import { useForm } from "react-hook-form";
|
import { useForm } from "react-hook-form";
|
||||||
@@ -82,7 +82,7 @@ export const ProfileForm = () => {
|
|||||||
]);
|
]);
|
||||||
}, [gravatarHash]);
|
}, [gravatarHash]);
|
||||||
|
|
||||||
const form = useForm<Profile>({
|
const form = useForm({
|
||||||
defaultValues: {
|
defaultValues: {
|
||||||
email: data?.user?.email || "",
|
email: data?.user?.email || "",
|
||||||
password: "",
|
password: "",
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import { zodResolver } from "@hookform/resolvers/zod";
|
import { standardSchemaResolver as zodResolver } from "@hookform/resolvers/standard-schema";
|
||||||
import { FileTerminal } from "lucide-react";
|
import { FileTerminal } from "lucide-react";
|
||||||
import { useEffect, useState } from "react";
|
import { useEffect, useState } from "react";
|
||||||
import { useForm } from "react-hook-form";
|
import { useForm } from "react-hook-form";
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import { zodResolver } from "@hookform/resolvers/zod";
|
import { standardSchemaResolver as zodResolver } from "@hookform/resolvers/standard-schema";
|
||||||
import { Pencil, PlusIcon } from "lucide-react";
|
import { Pencil, PlusIcon } from "lucide-react";
|
||||||
import Link from "next/link";
|
import Link from "next/link";
|
||||||
import { useEffect, useState } from "react";
|
import { useEffect, useState } from "react";
|
||||||
@@ -80,7 +80,7 @@ export const HandleServers = ({ serverId, asButton = false }: Props) => {
|
|||||||
const { mutateAsync, error, isLoading, isError } = serverId
|
const { mutateAsync, error, isLoading, isError } = serverId
|
||||||
? api.server.update.useMutation()
|
? api.server.update.useMutation()
|
||||||
: api.server.create.useMutation();
|
: api.server.create.useMutation();
|
||||||
const form = useForm<Schema>({
|
const form = useForm({
|
||||||
defaultValues: {
|
defaultValues: {
|
||||||
description: "",
|
description: "",
|
||||||
name: "",
|
name: "",
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import { zodResolver } from "@hookform/resolvers/zod";
|
import { standardSchemaResolver as zodResolver } from "@hookform/resolvers/standard-schema";
|
||||||
import { Eye, EyeOff, LayoutDashboardIcon, RefreshCw } from "lucide-react";
|
import { Eye, EyeOff, LayoutDashboardIcon, RefreshCw } from "lucide-react";
|
||||||
import { useEffect, useState } from "react";
|
import { useEffect, useState } from "react";
|
||||||
import { useForm } from "react-hook-form";
|
import { useForm } from "react-hook-form";
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import { zodResolver } from "@hookform/resolvers/zod";
|
import { standardSchemaResolver as zodResolver } from "@hookform/resolvers/standard-schema";
|
||||||
import Link from "next/link";
|
import Link from "next/link";
|
||||||
import { useEffect, useState } from "react";
|
import { useEffect, useState } from "react";
|
||||||
import { useForm } from "react-hook-form";
|
import { useForm } from "react-hook-form";
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import { zodResolver } from "@hookform/resolvers/zod";
|
import { standardSchemaResolver as zodResolver } from "@hookform/resolvers/standard-schema";
|
||||||
import { DownloadIcon, PenBoxIcon, PlusIcon } from "lucide-react";
|
import { DownloadIcon, PenBoxIcon, PlusIcon } from "lucide-react";
|
||||||
import { useEffect, useState } from "react";
|
import { useEffect, useState } from "react";
|
||||||
import { useForm } from "react-hook-form";
|
import { useForm } from "react-hook-form";
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import { zodResolver } from "@hookform/resolvers/zod";
|
import { standardSchemaResolver as zodResolver } from "@hookform/resolvers/standard-schema";
|
||||||
import { PlusIcon } from "lucide-react";
|
import { PlusIcon } from "lucide-react";
|
||||||
import { useEffect, useState } from "react";
|
import { useEffect, useState } from "react";
|
||||||
import { useForm } from "react-hook-form";
|
import { useForm } from "react-hook-form";
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import { zodResolver } from "@hookform/resolvers/zod";
|
import { standardSchemaResolver as zodResolver } from "@hookform/resolvers/standard-schema";
|
||||||
import { useEffect, useState } from "react";
|
import { useEffect, useState } from "react";
|
||||||
import { useForm } from "react-hook-form";
|
import { useForm } from "react-hook-form";
|
||||||
import { toast } from "sonner";
|
import { toast } from "sonner";
|
||||||
@@ -187,7 +187,7 @@ export const AddUserPermissions = ({ userId }: Props) => {
|
|||||||
const { mutateAsync, isError, error, isLoading } =
|
const { mutateAsync, isError, error, isLoading } =
|
||||||
api.user.assignPermissions.useMutation();
|
api.user.assignPermissions.useMutation();
|
||||||
|
|
||||||
const form = useForm<AddPermissions>({
|
const form = useForm({
|
||||||
defaultValues: {
|
defaultValues: {
|
||||||
accessedProjects: [],
|
accessedProjects: [],
|
||||||
accessedEnvironments: [],
|
accessedEnvironments: [],
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import { zodResolver } from "@hookform/resolvers/zod";
|
import { standardSchemaResolver as zodResolver } from "@hookform/resolvers/standard-schema";
|
||||||
import { useEffect, useState } from "react";
|
import { useEffect, useState } from "react";
|
||||||
import { useForm } from "react-hook-form";
|
import { useForm } from "react-hook-form";
|
||||||
import { toast } from "sonner";
|
import { toast } from "sonner";
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import { zodResolver } from "@hookform/resolvers/zod";
|
import { standardSchemaResolver as zodResolver } from "@hookform/resolvers/standard-schema";
|
||||||
import { GlobeIcon } from "lucide-react";
|
import { GlobeIcon } from "lucide-react";
|
||||||
import { useEffect } from "react";
|
import { useEffect } from "react";
|
||||||
import { useForm } from "react-hook-form";
|
import { useForm } from "react-hook-form";
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
import { zodResolver } from "@hookform/resolvers/zod";
|
import { standardSchemaResolver as zodResolver } from "@hookform/resolvers/standard-schema";
|
||||||
import { useEffect, useState } from "react";
|
import { useEffect, useState } from "react";
|
||||||
import { useForm } from "react-hook-form";
|
import { useForm } from "react-hook-form";
|
||||||
import { useHealthCheckAfterMutation } from "@/hooks/use-health-check-after-mutation";
|
|
||||||
import { toast } from "sonner";
|
import { toast } from "sonner";
|
||||||
import { z } from "zod";
|
import { z } from "zod";
|
||||||
import { AlertBlock } from "@/components/shared/alert-block";
|
import { AlertBlock } from "@/components/shared/alert-block";
|
||||||
@@ -24,6 +23,7 @@ import {
|
|||||||
FormLabel,
|
FormLabel,
|
||||||
FormMessage,
|
FormMessage,
|
||||||
} from "@/components/ui/form";
|
} from "@/components/ui/form";
|
||||||
|
import { useHealthCheckAfterMutation } from "@/hooks/use-health-check-after-mutation";
|
||||||
import { api } from "@/utils/api";
|
import { api } from "@/utils/api";
|
||||||
|
|
||||||
const schema = z.object({
|
const schema = z.object({
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import { zodResolver } from "@hookform/resolvers/zod";
|
import { standardSchemaResolver as zodResolver } from "@hookform/resolvers/standard-schema";
|
||||||
import { Settings } from "lucide-react";
|
import { Settings } from "lucide-react";
|
||||||
import { useForm } from "react-hook-form";
|
import { useForm } from "react-hook-form";
|
||||||
import { z } from "zod";
|
import { z } from "zod";
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
import { zodResolver } from "@hookform/resolvers/zod";
|
import { standardSchemaResolver as zodResolver } from "@hookform/resolvers/standard-schema";
|
||||||
import { ArrowRightLeft, Plus, Trash2 } from "lucide-react";
|
import { ArrowRightLeft, Plus, Trash2 } from "lucide-react";
|
||||||
import { useHealthCheckAfterMutation } from "@/hooks/use-health-check-after-mutation";
|
|
||||||
import type React from "react";
|
import type React from "react";
|
||||||
import { useEffect, useState } from "react";
|
import { useEffect, useState } from "react";
|
||||||
import { useFieldArray, useForm } from "react-hook-form";
|
import { useFieldArray, useForm } from "react-hook-form";
|
||||||
@@ -35,6 +34,7 @@ import {
|
|||||||
SelectTrigger,
|
SelectTrigger,
|
||||||
SelectValue,
|
SelectValue,
|
||||||
} from "@/components/ui/select";
|
} from "@/components/ui/select";
|
||||||
|
import { useHealthCheckAfterMutation } from "@/hooks/use-health-check-after-mutation";
|
||||||
import { api } from "@/utils/api";
|
import { api } from "@/utils/api";
|
||||||
|
|
||||||
interface Props {
|
interface Props {
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import { zodResolver } from "@hookform/resolvers/zod";
|
import { standardSchemaResolver as zodResolver } from "@hookform/resolvers/standard-schema";
|
||||||
import { RefreshCw } from "lucide-react";
|
import { RefreshCw } from "lucide-react";
|
||||||
import { useEffect, useState } from "react";
|
import { useEffect, useState } from "react";
|
||||||
import { useForm } from "react-hook-form";
|
import { useForm } from "react-hook-form";
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
"use client";
|
"use client";
|
||||||
|
|
||||||
import { zodResolver } from "@hookform/resolvers/zod";
|
import { standardSchemaResolver as zodResolver } from "@hookform/resolvers/standard-schema";
|
||||||
import { Plus, Trash2 } from "lucide-react";
|
import { Plus, Trash2 } from "lucide-react";
|
||||||
import { useEffect, useState } from "react";
|
import { useEffect, useState } from "react";
|
||||||
import type { FieldArrayPath } from "react-hook-form";
|
import type { FieldArrayPath } from "react-hook-form";
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
"use client";
|
"use client";
|
||||||
|
|
||||||
import { zodResolver } from "@hookform/resolvers/zod";
|
import { standardSchemaResolver as zodResolver } from "@hookform/resolvers/standard-schema";
|
||||||
import { Plus, Trash2 } from "lucide-react";
|
import { Plus, Trash2 } from "lucide-react";
|
||||||
import { useEffect, useState } from "react";
|
import { useEffect, useState } from "react";
|
||||||
import {
|
import {
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user