diff --git a/apps/dokploy/components/dashboard/application/deployments/show-deployments.tsx b/apps/dokploy/components/dashboard/application/deployments/show-deployments.tsx index 796a002da..ca7a93518 100644 --- a/apps/dokploy/components/dashboard/application/deployments/show-deployments.tsx +++ b/apps/dokploy/components/dashboard/application/deployments/show-deployments.tsx @@ -143,7 +143,7 @@ export const ShowDeployments = ({ See the last 10 deployments for this {type} -
${errorMessage}`
+ : "";
+ const sizeInfo = backupSize ? `\nBackup Size: ${backupSize}` : "";
+
+ const messageText = `${statusEmoji} Volume Backup ${typeStatus}\n\nProject: ${projectName}\nApplication: ${applicationName}\nVolume Name: ${volumeName}\nService Type: ${serviceType}${sizeInfo}\nDate: ${format(date, "PP")}\nTime: ${format(date, "pp")}${isError ? errorMsg : ""}`;
+
+ await sendTelegramNotification(telegram, messageText);
+ }
+
+ if (slack) {
+ const { channel } = slack;
+ await sendSlackNotification(slack, {
+ channel: channel,
+ attachments: [
+ {
+ color: type === "success" ? "#00FF00" : "#FF0000",
+ pretext:
+ type === "success"
+ ? ":white_check_mark: *Volume Backup Successful*"
+ : ":x: *Volume Backup Failed*",
+ fields: [
+ ...(type === "error" && errorMessage
+ ? [
+ {
+ title: "Error Message",
+ value: errorMessage,
+ short: false,
+ },
+ ]
+ : []),
+ {
+ title: "Project",
+ value: projectName,
+ short: true,
+ },
+ {
+ title: "Application",
+ value: applicationName,
+ short: true,
+ },
+ {
+ title: "Volume Name",
+ value: volumeName,
+ short: true,
+ },
+ {
+ title: "Service Type",
+ value: serviceType,
+ short: true,
+ },
+ ...(backupSize
+ ? [
+ {
+ title: "Backup Size",
+ value: backupSize,
+ short: true,
+ },
+ ]
+ : []),
+ {
+ title: "Time",
+ value: date.toLocaleString(),
+ short: true,
+ },
+ {
+ title: "Type",
+ value: type,
+ short: true,
+ },
+ {
+ title: "Status",
+ value: type === "success" ? "Successful" : "Failed",
+ short: true,
+ },
+ ],
+ },
+ ],
+ });
+ }
+ }
+};
diff --git a/packages/server/src/utils/volume-backups/utils.ts b/packages/server/src/utils/volume-backups/utils.ts
index b6a34e2aa..b508c6b88 100644
--- a/packages/server/src/utils/volume-backups/utils.ts
+++ b/packages/server/src/utils/volume-backups/utils.ts
@@ -11,8 +11,54 @@ import {
} from "@dokploy/server/utils/process/execAsync";
import { scheduledJobs, scheduleJob } from "node-schedule";
import { getS3Credentials, normalizeS3Path } from "../backups/utils";
+import { sendVolumeBackupNotifications } from "../notifications/volume-backup";
import { backupVolume } from "./backup";
+// Helper functions to extract project info from volume backup
+const getProjectName = (
+ volumeBackup: Awaited