diff --git a/apps/dokploy/server/api/routers/notification.ts b/apps/dokploy/server/api/routers/notification.ts index 170b7bf2..504e3320 100644 --- a/apps/dokploy/server/api/routers/notification.ts +++ b/apps/dokploy/server/api/routers/notification.ts @@ -188,8 +188,9 @@ export const notificationRouter = createTRPCRouter({ .mutation(async ({ input }) => { try { await sendDiscordNotification(input, { - title: "Test Notification", - description: "Hi, From Dokploy 👋", + title: "> `🤚` - Test Notification", + description: "> Hi, From Dokploy 👋", + color: 0xf3f7f4 }); return true; } catch (error) { diff --git a/packages/server/src/utils/notifications/build-error.ts b/packages/server/src/utils/notifications/build-error.ts index 9fcb0641..3c4fd73d 100644 --- a/packages/server/src/utils/notifications/build-error.ts +++ b/packages/server/src/utils/notifications/build-error.ts @@ -59,31 +59,46 @@ export const sendBuildErrorNotifications = async ({ if (discord) { await sendDiscordNotification(discord, { - title: "⚠️ Build Failed", - color: 0xff0000, + title: "> `⚠️` - Build Failed", + color: 0xed4245, fields: [ { - name: "Project", + name: "`🛠️`・Project", value: projectName, inline: true, }, { - name: "Application", + name: "`⚙️`・Application", value: applicationName, inline: true, }, { - name: "Type", + name: "`❔`・Type", value: applicationType, inline: true, }, { - name: "Error", - value: errorMessage, + name: "`📅`・Date", + value: date.toLocaleDateString(), + inline: true, }, { - name: "Build Link", - value: buildLink, + name: "`⌚`・Time", + value: date.toLocaleTimeString(), + inline: true, + }, + { + name: "`❓`・Type", + value: "Failed", + inline: true, + }, + { + name: "`⚠️`・Error Message", + value: `\`\`\`${errorMessage}\`\`\``, + }, + { + name: "`🧷`・Build Link", + value: `[Click here to access build link](${buildLink})`, }, ], timestamp: date.toISOString(), diff --git a/packages/server/src/utils/notifications/build-success.ts b/packages/server/src/utils/notifications/build-success.ts index 9210eca2..0e09e87d 100644 --- a/packages/server/src/utils/notifications/build-success.ts +++ b/packages/server/src/utils/notifications/build-success.ts @@ -57,27 +57,42 @@ export const sendBuildSuccessNotifications = async ({ if (discord) { await sendDiscordNotification(discord, { - title: "✅ Build Success", - color: 0x00ff00, + title: "> `✅` - Build Success", + color: 0x57f287, fields: [ { - name: "Project", + name: "`🛠️`・Project", value: projectName, inline: true, }, { - name: "Application", + name: "`⚙️`・Application", value: applicationName, inline: true, }, { - name: "Type", + name: "`❔`・Application Type", value: applicationType, inline: true, }, { - name: "Build Link", - value: buildLink, + name: "`📅`・Date", + value: date.toLocaleDateString(), + inline: true, + }, + { + name: "`⌚`・Time", + value: date.toLocaleTimeString(), + inline: true, + }, + { + name: "`❓`・Type", + value: "Successful", + inline: true, + }, + { + name: "`🧷`・Build Link", + value: `[Click here to access build link](${buildLink})`, }, ], timestamp: date.toISOString(), diff --git a/packages/server/src/utils/notifications/database-backup.ts b/packages/server/src/utils/notifications/database-backup.ts index c97afa03..115d8b20 100644 --- a/packages/server/src/utils/notifications/database-backup.ts +++ b/packages/server/src/utils/notifications/database-backup.ts @@ -64,39 +64,45 @@ export const sendDatabaseBackupNotifications = async ({ await sendDiscordNotification(discord, { title: type === "success" - ? "✅ Database Backup Successful" - : "❌ Database Backup Failed", - color: type === "success" ? 0x00ff00 : 0xff0000, + ? "> `✅` - Database Backup Successful" + : "> `❌` - Database Backup Failed", + color: type === "success" ? 0x57f287 : 0xed4245, fields: [ { - name: "Project", + name: "`🛠️`・Project", value: projectName, inline: true, }, { - name: "Application", + name: "`⚙️`・Application", value: applicationName, inline: true, }, { - name: "Type", + name: "`❔`・Database", value: databaseType, inline: true, }, { - name: "Time", - value: date.toLocaleString(), + name: "`📅`・Date", + value: date.toLocaleDateString(), inline: true, }, { - name: "Type", - value: type, + name: "`⌚`・Time", + value: date.toLocaleTimeString(), + inline: true, + }, + { + name: "`❓`・Type", + value: type.replace("error", "Failed").replace("success", "Successful"), + inline: true, }, ...(type === "error" && errorMessage ? [ { - name: "Error Message", - value: errorMessage, + name: "`⚠️`・Error Message", + value: `\`\`\`${errorMessage}\`\`\``, }, ] : []), diff --git a/packages/server/src/utils/notifications/docker-cleanup.ts b/packages/server/src/utils/notifications/docker-cleanup.ts index a2e09139..31c1c6c9 100644 --- a/packages/server/src/utils/notifications/docker-cleanup.ts +++ b/packages/server/src/utils/notifications/docker-cleanup.ts @@ -45,12 +45,28 @@ export const sendDockerCleanupNotifications = async ( if (discord) { await sendDiscordNotification(discord, { - title: "✅ Docker Cleanup", - color: 0x00ff00, + title: "> `✅` - Docker Cleanup", + color: 0x57f287, fields: [ + { - name: "Message", - value: message, + name: "`📅`・Date", + value: date.toLocaleDateString(), + inline: true, + }, + { + name: "`⌚`・Time", + value: date.toLocaleTimeString(), + inline: true, + }, + { + name: "`❓`・Type", + value: "Successful", + inline: true, + }, + { + name: "`📜`・Message", + value: `\`\`\`${message}\`\`\``, }, ], timestamp: date.toISOString(), diff --git a/packages/server/src/utils/notifications/dokploy-restart.ts b/packages/server/src/utils/notifications/dokploy-restart.ts index 33bc32f0..c552e269 100644 --- a/packages/server/src/utils/notifications/dokploy-restart.ts +++ b/packages/server/src/utils/notifications/dokploy-restart.ts @@ -34,12 +34,22 @@ export const sendDokployRestartNotifications = async () => { if (discord) { await sendDiscordNotification(discord, { - title: "✅ Dokploy Server Restarted", - color: 0x00ff00, + title: "> `✅` - Dokploy Server Restarted", + color: 0x57f287, fields: [ { - name: "Time", - value: date.toLocaleString(), + name: "`📅`・Date", + value: date.toLocaleDateString(), + inline: true, + }, + { + name: "`⌚`・Time", + value: date.toLocaleTimeString(), + inline: true, + }, + { + name: "`❓`・Type", + value: "Successful", inline: true, }, ],