resolve merge conflicts

This commit is contained in:
Vishnu Sreekumaran Nair committed 2025-03-19 16:00:40 -04:00
commit 0a1f47c532
22 files changed
+1014 -301

No files matched your search

+22
View File
@@ -669,6 +669,28 @@ class NetworkService {
});
}
/**
* ************************************
* Test a notification integration
* ************************************
*
* @async
* @param {Object} config - The configuration object.
* @param {string} config.platform - The notification platform (slack, discord, telegram, webhook).
* @param {Object} config.payload - The payload with configuration for the notification.
* @returns {Promise<AxiosResponse>} The response from the axios POST request.
*/
async testNotification(config) {
return this.axiosInstance.post('/notifications/test-webhook', {
platform: config.platform,
...config.payload
}, {
headers: {
"Content-Type": "application/json",
},
});
}
/**
* ************************************
* Creates a maintenance window
+5 -2
View File
@@ -83,8 +83,11 @@ export const getHumanReadableDuration = (ms) => {
const days = Math.floor(durationObj.asDays());
return { time: days, units: days === 1 ? "day" : "days" };
} else if (durationObj.asHours() >= 1) {
const hours = Math.floor(durationObj.asHours());
return { time: hours, units: hours === 1 ? "hour" : "hours" };
const hoursRounded = Math.round(durationObj.asHours() * 10) / 10;
const hours = Number.isInteger(hoursRounded)
? Math.floor(hoursRounded)
: hoursRounded;
return { time: hours, units: hours <= 1 ? "hour" : "hours" };
} else if (durationObj.asMinutes() >= 1) {
const minutes = Math.floor(durationObj.asMinutes());
return { time: minutes, units: minutes === 1 ? "minute" : "minutes" };