mirror of
https://github.com/andwati/dokploy.git
synced 2026-11-21 19:38:47 +00:00
[autofix.ci] apply automated fixes
This commit is contained in:
@@ -40,7 +40,7 @@ export const sendBuildSuccessNotifications = async ({
|
|||||||
const notificationList = await db.query.notifications.findMany({
|
const notificationList = await db.query.notifications.findMany({
|
||||||
where: and(
|
where: and(
|
||||||
eq(notifications.appDeploy, true),
|
eq(notifications.appDeploy, true),
|
||||||
eq(notifications.organizationId, organizationId)
|
eq(notifications.organizationId, organizationId),
|
||||||
),
|
),
|
||||||
with: {
|
with: {
|
||||||
email: true,
|
email: true,
|
||||||
@@ -67,12 +67,12 @@ export const sendBuildSuccessNotifications = async ({
|
|||||||
buildLink,
|
buildLink,
|
||||||
date: date.toLocaleString(),
|
date: date.toLocaleString(),
|
||||||
environmentName,
|
environmentName,
|
||||||
})
|
}),
|
||||||
).catch();
|
).catch();
|
||||||
await sendEmailNotification(
|
await sendEmailNotification(
|
||||||
email,
|
email,
|
||||||
"Build success for dokploy",
|
"Build success for dokploy",
|
||||||
template
|
template,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -142,7 +142,7 @@ export const sendBuildSuccessNotifications = async ({
|
|||||||
`${decorate("🌍", `Environment: ${environmentName}`)}` +
|
`${decorate("🌍", `Environment: ${environmentName}`)}` +
|
||||||
`${decorate("❔", `Type: ${applicationType}`)}` +
|
`${decorate("❔", `Type: ${applicationType}`)}` +
|
||||||
`${decorate("🕒", `Date: ${date.toLocaleString()}`)}` +
|
`${decorate("🕒", `Date: ${date.toLocaleString()}`)}` +
|
||||||
`${decorate("🔗", `Build details:\n${buildLink}`)}`
|
`${decorate("🔗", `Build details:\n${buildLink}`)}`,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -156,14 +156,14 @@ export const sendBuildSuccessNotifications = async ({
|
|||||||
`⚙️Application: ${applicationName}\n` +
|
`⚙️Application: ${applicationName}\n` +
|
||||||
`🌍Environment: ${environmentName}\n` +
|
`🌍Environment: ${environmentName}\n` +
|
||||||
`❔Type: ${applicationType}\n` +
|
`❔Type: ${applicationType}\n` +
|
||||||
`🕒Date: ${date.toLocaleString()}`
|
`🕒Date: ${date.toLocaleString()}`,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (telegram) {
|
if (telegram) {
|
||||||
const chunkArray = <T>(array: T[], chunkSize: number): T[][] =>
|
const chunkArray = <T>(array: T[], chunkSize: number): T[][] =>
|
||||||
Array.from({ length: Math.ceil(array.length / chunkSize) }, (_, i) =>
|
Array.from({ length: Math.ceil(array.length / chunkSize) }, (_, i) =>
|
||||||
array.slice(i * chunkSize, i * chunkSize + chunkSize)
|
array.slice(i * chunkSize, i * chunkSize + chunkSize),
|
||||||
);
|
);
|
||||||
|
|
||||||
const inlineButton = [
|
const inlineButton = [
|
||||||
@@ -177,7 +177,7 @@ export const sendBuildSuccessNotifications = async ({
|
|||||||
chunk.map((data) => ({
|
chunk.map((data) => ({
|
||||||
text: data.host,
|
text: data.host,
|
||||||
url: `${data.https ? "https" : "http"}://${data.host}`,
|
url: `${data.https ? "https" : "http"}://${data.host}`,
|
||||||
}))
|
})),
|
||||||
),
|
),
|
||||||
];
|
];
|
||||||
|
|
||||||
@@ -185,9 +185,9 @@ export const sendBuildSuccessNotifications = async ({
|
|||||||
telegram,
|
telegram,
|
||||||
`<b>✅ Build Success</b>\n\n<b>Project:</b> ${projectName}\n<b>Application:</b> ${applicationName}\n<b>Environment:</b> ${environmentName}\n<b>Type:</b> ${applicationType}\n<b>Date:</b> ${format(
|
`<b>✅ Build Success</b>\n\n<b>Project:</b> ${projectName}\n<b>Application:</b> ${applicationName}\n<b>Environment:</b> ${environmentName}\n<b>Type:</b> ${applicationType}\n<b>Date:</b> ${format(
|
||||||
date,
|
date,
|
||||||
"PP"
|
"PP",
|
||||||
)}\n<b>Time:</b> ${format(date, "pp")}`,
|
)}\n<b>Time:</b> ${format(date, "pp")}`,
|
||||||
inlineButton
|
inlineButton,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -39,13 +39,13 @@ export const sendDokployRestartNotifications = async () => {
|
|||||||
try {
|
try {
|
||||||
if (email) {
|
if (email) {
|
||||||
const template = await renderAsync(
|
const template = await renderAsync(
|
||||||
DokployRestartEmail({ date: date.toLocaleString() })
|
DokployRestartEmail({ date: date.toLocaleString() }),
|
||||||
).catch();
|
).catch();
|
||||||
|
|
||||||
await sendEmailNotification(
|
await sendEmailNotification(
|
||||||
email,
|
email,
|
||||||
"Dokploy Server Restarted",
|
"Dokploy Server Restarted",
|
||||||
template
|
template,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -86,7 +86,7 @@ export const sendDokployRestartNotifications = async () => {
|
|||||||
await sendGotifyNotification(
|
await sendGotifyNotification(
|
||||||
gotify,
|
gotify,
|
||||||
decorate("✅", "Dokploy Server Restarted"),
|
decorate("✅", "Dokploy Server Restarted"),
|
||||||
`${decorate("🕒", `Date: ${date.toLocaleString()}`)}`
|
`${decorate("🕒", `Date: ${date.toLocaleString()}`)}`,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -96,7 +96,7 @@ export const sendDokployRestartNotifications = async () => {
|
|||||||
"Dokploy Server Restarted",
|
"Dokploy Server Restarted",
|
||||||
"white_check_mark",
|
"white_check_mark",
|
||||||
"",
|
"",
|
||||||
`🕒Date: ${date.toLocaleString()}`
|
`🕒Date: ${date.toLocaleString()}`,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -105,8 +105,8 @@ export const sendDokployRestartNotifications = async () => {
|
|||||||
telegram,
|
telegram,
|
||||||
`<b>✅ Dokploy Server Restarted</b>\n\n<b>Date:</b> ${format(
|
`<b>✅ Dokploy Server Restarted</b>\n\n<b>Date:</b> ${format(
|
||||||
date,
|
date,
|
||||||
"PP"
|
"PP",
|
||||||
)}\n<b>Time:</b> ${format(date, "pp")}`
|
)}\n<b>Time:</b> ${format(date, "pp")}`,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -203,7 +203,7 @@ export const sendDokployRestartNotifications = async () => {
|
|||||||
tag: "markdown",
|
tag: "markdown",
|
||||||
content: `**Restart Time:**\n${format(
|
content: `**Restart Time:**\n${format(
|
||||||
date,
|
date,
|
||||||
"PP pp"
|
"PP pp",
|
||||||
)}`,
|
)}`,
|
||||||
text_align: "left",
|
text_align: "left",
|
||||||
text_size: "normal_v2",
|
text_size: "normal_v2",
|
||||||
|
|||||||
Reference in New Issue
Block a user