add llama sugestions
This commit is contained in:
1 parent
fb84a79a04
commit
041a261540
2 files changed
+5
-5
No files matched your search
@@ -16,7 +16,7 @@ class NotificationService {
|
|||||||
return NotificationService.SERVICE_NAME;
|
return NotificationService.SERVICE_NAME;
|
||||||
}
|
}
|
||||||
|
|
||||||
sendNotification = async ({ notification, subject, content, html, discordContent }) => {
|
sendNotification = async ({ notification, subject, content, html, discordContent = null }) => {
|
||||||
const { type, address } = notification;
|
const { type, address } = notification;
|
||||||
|
|
||||||
if (type === "email") {
|
if (type === "email") {
|
||||||
@@ -79,7 +79,7 @@ class NotificationService {
|
|||||||
return success;
|
return success;
|
||||||
}
|
}
|
||||||
|
|
||||||
async notifyAll({ notificationIDs, subject, html, content, discordContent }) {
|
async notifyAll({ notificationIDs, subject, html, content, discordContent = null }) {
|
||||||
const notifications = await this.db.notificationModule.getNotificationsByIds(notificationIDs);
|
const notifications = await this.db.notificationModule.getNotificationsByIds(notificationIDs);
|
||||||
// Map each notification to a test promise
|
// Map each notification to a test promise
|
||||||
const promises = notifications.map(async (notification) => {
|
const promises = notifications.map(async (notification) => {
|
||||||
|
|||||||
@@ -74,7 +74,7 @@ class NotificationUtils {
|
|||||||
let discordMessageText = {
|
let discordMessageText = {
|
||||||
embeds: [
|
embeds: [
|
||||||
{
|
{
|
||||||
title: status ? "Uptime Alert: One of your monitors is back online" : "Downtime Alert: One of your monitors went offline",
|
title: status ? dn.uptimeAlert : dn.downtimeAlert,
|
||||||
color: status ? 5763719 : 15548997,
|
color: status ? 5763719 : 15548997,
|
||||||
|
|
||||||
fields: [
|
fields: [
|
||||||
@@ -129,9 +129,9 @@ class NotificationUtils {
|
|||||||
description: `Your current disk usage is above your threshold (${(diskThreshold * 100).toFixed(0)}%)`,
|
description: `Your current disk usage is above your threshold (${(diskThreshold * 100).toFixed(0)}%)`,
|
||||||
color: 15548997,
|
color: 15548997,
|
||||||
footer: { text: "Checkmate" },
|
footer: { text: "Checkmate" },
|
||||||
fields: disk.map((d, idx) => ({
|
fields: (Array.isArray(disk) ? disk : []).map((d, idx) => ({
|
||||||
name: `Disk ${idx}`,
|
name: `Disk ${idx}`,
|
||||||
value: `${(d.usage_percent * 100).toFixed(0)}%`,
|
value: `${(d?.usage_percent * 100).toFixed(0)}%`,
|
||||||
inline: true,
|
inline: true,
|
||||||
})),
|
})),
|
||||||
}),
|
}),
|
||||||
|
|||||||
Reference in new issue
Block a user