[mirotalksfu] - update dep, email alert if worker died (optional)

هذا الالتزام موجود في:
Miroslav Pejic
2025-07-01 17:55:53 +02:00
الأصل af3a8c3f4e
التزام 126ed22272
10 ملفات معدلة مع 66 إضافات و16 حذوفات

عرض الملف

@@ -61,7 +61,11 @@ function sendEmailAlert(event, data) {
subject = getJoinRoomSubject(data);
body = getJoinRoomBody(data);
break;
// ...
case 'alert':
subject = getAlertSubject(data);
body = getAlertBody(data);
break;
//...
default:
break;
}
@@ -143,6 +147,46 @@ function getJoinRoomBody(data) {
`;
}
function getAlertSubject(data) {
const { subject } = data;
return subject || 'MiroTalk SFU - Alert';
}
function getAlertBody(data) {
const { body } = data;
const currentDataTime = getCurrentDataTime();
return `
<h1>🚨 Alert Notification</h1>
<style>
table {
font-family: arial, sans-serif;
border-collapse: collapse;
width: 100%;
}
td {
border: 1px solid #dddddd;
text-align: left;
padding: 8px;
}
tr:nth-child(even) {
background-color: #dddddd;
}
</style>
<table>
<tr>
<td>⚠️ Alert</td>
<td>${body}</td>
</tr>
<tr>
<td>🕒 Date, Time</td>
<td>${currentDataTime}</td>
</tr>
</table>
`;
}
// ####################################################
// UTILITY
// ####################################################