File tree Expand file tree Collapse file tree
apps/dokploy/components/dashboard Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11import { standardSchemaResolver as zodResolver } from "@hookform/resolvers/standard-schema" ;
22import { PenBoxIcon } from "lucide-react" ;
3- import { useEffect } from "react" ;
3+ import { useEffect , useState } from "react" ;
44import { useForm } from "react-hook-form" ;
55import { toast } from "sonner" ;
66import { z } from "zod" ;
@@ -41,6 +41,7 @@ interface Props {
4141}
4242
4343export const UpdateMariadb = ( { mariadbId } : Props ) => {
44+ const [ isOpen , setIsOpen ] = useState ( false ) ;
4445 const utils = api . useUtils ( ) ;
4546 const { mutateAsync, error, isError, isPending } =
4647 api . mariadb . update . useMutation ( ) ;
@@ -79,6 +80,7 @@ export const UpdateMariadb = ({ mariadbId }: Props) => {
7980 utils . mariadb . one . invalidate ( {
8081 mariadbId : mariadbId ,
8182 } ) ;
83+ setIsOpen ( false ) ;
8284 } )
8385 . catch ( ( ) => {
8486 toast . error ( "Error updating the Mariadb" ) ;
@@ -87,7 +89,7 @@ export const UpdateMariadb = ({ mariadbId }: Props) => {
8789 } ;
8890
8991 return (
90- < Dialog >
92+ < Dialog open = { isOpen } onOpenChange = { setIsOpen } >
9193 < DialogTrigger asChild >
9294 < Button
9395 variant = "ghost"
Original file line number Diff line number Diff line change 11import { standardSchemaResolver as zodResolver } from "@hookform/resolvers/standard-schema" ;
22import { PenBoxIcon } from "lucide-react" ;
3- import { useEffect } from "react" ;
3+ import { useEffect , useState } from "react" ;
44import { useForm } from "react-hook-form" ;
55import { toast } from "sonner" ;
66import { z } from "zod" ;
@@ -41,6 +41,7 @@ interface Props {
4141}
4242
4343export const UpdateMysql = ( { mysqlId } : Props ) => {
44+ const [ isOpen , setIsOpen ] = useState ( false ) ;
4445 const utils = api . useUtils ( ) ;
4546 const { mutateAsync, error, isError, isPending } =
4647 api . mysql . update . useMutation ( ) ;
@@ -79,6 +80,7 @@ export const UpdateMysql = ({ mysqlId }: Props) => {
7980 utils . mysql . one . invalidate ( {
8081 mysqlId : mysqlId ,
8182 } ) ;
83+ setIsOpen ( false ) ;
8284 } )
8385 . catch ( ( ) => {
8486 toast . error ( "Error updating MySQL" ) ;
@@ -87,7 +89,7 @@ export const UpdateMysql = ({ mysqlId }: Props) => {
8789 } ;
8890
8991 return (
90- < Dialog >
92+ < Dialog open = { isOpen } onOpenChange = { setIsOpen } >
9193 < DialogTrigger asChild >
9294 < Button
9395 variant = "ghost"
Original file line number Diff line number Diff line change 11import { standardSchemaResolver as zodResolver } from "@hookform/resolvers/standard-schema" ;
22import { PenBoxIcon } from "lucide-react" ;
3- import { useEffect } from "react" ;
3+ import { useEffect , useState } from "react" ;
44import { useForm } from "react-hook-form" ;
55import { toast } from "sonner" ;
66import { z } from "zod" ;
@@ -41,6 +41,7 @@ interface Props {
4141}
4242
4343export const UpdateRedis = ( { redisId } : Props ) => {
44+ const [ isOpen , setIsOpen ] = useState ( false ) ;
4445 const utils = api . useUtils ( ) ;
4546 const { mutateAsync, error, isError, isPending } =
4647 api . redis . update . useMutation ( ) ;
@@ -79,6 +80,7 @@ export const UpdateRedis = ({ redisId }: Props) => {
7980 utils . redis . one . invalidate ( {
8081 redisId : redisId ,
8182 } ) ;
83+ setIsOpen ( false ) ;
8284 } )
8385 . catch ( ( ) => {
8486 toast . error ( "Error updating Redis" ) ;
@@ -87,7 +89,7 @@ export const UpdateRedis = ({ redisId }: Props) => {
8789 } ;
8890
8991 return (
90- < Dialog >
92+ < Dialog open = { isOpen } onOpenChange = { setIsOpen } >
9193 < DialogTrigger asChild >
9294 < Button
9395 variant = "ghost"
You can’t perform that action at this time.
0 commit comments