forked from LiteNet/freepbx-stats
h
This commit is contained in:
parent
2731ccd7f9
commit
b7ab603bcc
20
index.js
20
index.js
|
@ -139,18 +139,16 @@ async function sendSummary() {
|
|||
async function sendSummaryMatrix(yesterday, stats) {
|
||||
const html = `
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
<td colspan="2"><strong>Summary from ${yesterday.startDate.toString()} to ${yesterday.endDate.toString()}</strong></td>
|
||||
</tr>
|
||||
<thead>
|
||||
<tr><td colspan="2"><strong>Summary from ${yesterday.startDate.toString()} to ${yesterday.endDate.toString()}</strong></td></tr><br/>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr><td>Calls Made</td><td>${stats.totalCallsMade}</td></tr>
|
||||
<tr><td>Monthly Total</td><td>${stats.totalCallsThisMonth}</td></tr>
|
||||
<tr><td>Total Calls Ever Placed</td><td>${stats.totalCallsEverPlaced}</td></tr>
|
||||
<tr><td>System Uptime</td><td>${getSystemUptime().toString(false, false)}</td></tr>
|
||||
<tr><td>All Time Record</td><td>${stats.allTimeRecord}</td></tr>
|
||||
${stats.isNewRecord ? `<tr><td colspan="2">🎉 NEW RECORD! 🎉 A new record has been set, at ${stats.totalCallsMade}!</td></tr>` : ''}
|
||||
<tr><td>Calls Made</td><td>${stats.totalCallsMade}</td></tr><br/>
|
||||
<tr><td>Monthly Total</td><td>${stats.totalCallsThisMonth}</td></tr><br/>
|
||||
<tr><td>Total Calls Ever Placed</td><td>${stats.totalCallsEverPlaced}</td></tr><br/>
|
||||
<tr><td>System Uptime</td><td>${getSystemUptime().toString(false, false)}</td></tr><br/>
|
||||
<tr><td>All Time Record</td><td>${stats.allTimeRecord}</td></tr><br/>
|
||||
${stats.isNewRecord ? `<tr><td colspan="2">🎉 NEW RECORD! 🎉 A new record has been set, at ${stats.totalCallsMade}!</td></tr><br/>` : ''}
|
||||
</tbody>
|
||||
</table>
|
||||
`;
|
||||
|
@ -164,7 +162,7 @@ Total Calls Ever Placed: ${stats.totalCallsEverPlaced}
|
|||
System Uptime: ${getSystemUptime().toString(false, false)}
|
||||
All Time Record: ${stats.allTimeRecord}
|
||||
${stats.isNewRecord ? `🎉 NEW RECORD! 🎉 A new record has been set, at ${stats.totalCallsMade}!` : ''}`,
|
||||
"formatted_body": html,
|
||||
"formatted_body": html.split('\n').map(s => s.trim()).join(''),
|
||||
"tel.litenet.call_stats_summary": {
|
||||
...stats, date: yesterday
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue