diff --git a/apps/dokploy/components/dashboard/application/volume-backups/handle-volume-backups.tsx b/apps/dokploy/components/dashboard/application/volume-backups/handle-volume-backups.tsx index dbd7c2a1e..04a027cb8 100644 --- a/apps/dokploy/components/dashboard/application/volume-backups/handle-volume-backups.tsx +++ b/apps/dokploy/components/dashboard/application/volume-backups/handle-volume-backups.tsx @@ -132,6 +132,11 @@ export const HandleVolumeBackups = ({ { enabled: !!volumeBackupId }, ); + const { data: mounts } = api.mounts.allNamedByApplicationId.useQuery( + { applicationId: id || "" }, + { enabled: !!id }, + ); + const { data: services, isFetching: isLoadingServices, @@ -479,22 +484,61 @@ export const HandleVolumeBackups = ({ )} /> - ( - - Volume Name - - - - - The name of the Docker volume to backup - - - - )} - /> + {serviceTypeForm === "application" && ( + <> + ( + + Volumes + + + Choose the volume to backup, if you dont see the volume + here, you can type the volume name manually + + + + )} + /> + + ( + + Volume Name + + + + + The name of the Docker volume to backup + + + + )} + /> + + )} { return await updateMount(input.mountId, input); }), + allNamedByApplicationId: protectedProcedure + .input(z.object({ applicationId: z.string().min(1) })) + .query(async ({ input }) => { + return await db.query.mounts.findMany({ + where: and( + eq(mounts.applicationId, input.applicationId), + eq(mounts.type, "volume"), + ), + }); + }), });