[mirotalk] - add timestamp to stats, fix api doc

This commit is contained in:
Miroslav Pejic
2024-12-21 11:15:12 +01:00
parent ada2db91c5
commit d566077f74
5 changed files with 21 additions and 18 deletions
+11 -13
View File
@@ -169,10 +169,17 @@ definitions:
StatsResponse:
type: object
properties:
meetings:
type: array
items:
$ref: '#/definitions/Stats'
success:
type: boolean
timestamp:
type: string
format: date-time
example: "2024-12-21T12:00:00Z"
totalRooms:
type: integer
totalPeers:
type: integer
MeetingsResponse:
type: object
properties:
@@ -235,15 +242,6 @@ definitions:
type: string
browser:
type: string
Stats:
type: object
properties:
success:
type: boolean
totalRooms:
type: integer
totalPeers:
type: integer
Meeting:
type: object
+3
View File
@@ -20,6 +20,8 @@ module.exports = class ServerApi {
}
getStats(peers) {
const timestamp = new Date().toISOString();
let totalRooms = 0;
let totalPeers = 0;
@@ -29,6 +31,7 @@ module.exports = class ServerApi {
}
return {
timestamp,
totalRooms,
totalPeers,
};
+4 -2
View File
@@ -39,7 +39,7 @@ dependencies: {
* @license For commercial use or closed source, contact us at license.mirotalk@gmail.com or purchase directly from CodeCanyon
* @license CodeCanyon: https://codecanyon.net/item/mirotalk-p2p-webrtc-realtime-video-conferences/38376661
* @author Miroslav Pejic - miroslav.pejic.85@gmail.com
* @version 1.4.14
* @version 1.4.15
*
*/
@@ -731,9 +731,10 @@ app.get([`${apiBasePath}/stats`], (req, res) => {
return res.status(403).json({ error: 'Unauthorized!' });
}
// Get stats
const { totalRooms, totalPeers } = api.getStats(peers);
const { timestamp, totalRooms, totalPeers } = api.getStats(peers);
res.json({
success: true,
timestamp,
totalRooms,
totalPeers,
});
@@ -741,6 +742,7 @@ app.get([`${apiBasePath}/stats`], (req, res) => {
log.debug('MiroTalk get stats - Authorized', {
header: req.headers,
body: req.body,
timestamp,
totalRooms,
totalPeers,
});
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "mirotalk",
"version": "1.4.14",
"version": "1.4.15",
"description": "A free WebRTC browser-based video call",
"main": "server.js",
"scripts": {
+2 -2
View File
@@ -15,7 +15,7 @@
* @license For commercial use or closed source, contact us at license.mirotalk@gmail.com or purchase directly from CodeCanyon
* @license CodeCanyon: https://codecanyon.net/item/mirotalk-p2p-webrtc-realtime-video-conferences/38376661
* @author Miroslav Pejic - miroslav.pejic.85@gmail.com
* @version 1.4.14
* @version 1.4.15
*
*/
@@ -10695,7 +10695,7 @@ function showAbout() {
Swal.fire({
background: swBg,
position: 'center',
title: '<strong>WebRTC P2P v1.4.14</strong>',
title: '<strong>WebRTC P2P v1.4.15</strong>',
imageAlt: 'mirotalk-about',
imageUrl: images.about,
customClass: { image: 'img-about' },