[mirotalksfu] - add timestamp to stats, fix api doc
هذا الالتزام موجود في:
@@ -128,10 +128,16 @@ 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:
|
||||
@@ -218,15 +224,6 @@ definitions:
|
||||
browser:
|
||||
type: string
|
||||
|
||||
Stats:
|
||||
type: object
|
||||
properties:
|
||||
success:
|
||||
type: boolean
|
||||
totalRooms:
|
||||
type: integer
|
||||
totalUser:
|
||||
type: integer
|
||||
Meeting:
|
||||
type: object
|
||||
properties:
|
||||
|
||||
@@ -55,7 +55,7 @@ dev dependencies: {
|
||||
* @license For commercial or closed source, contact us at license.mirotalk@gmail.com or purchase directly via CodeCanyon
|
||||
* @license CodeCanyon: https://codecanyon.net/item/mirotalk-sfu-webrtc-realtime-video-conferences/40769970
|
||||
* @author Miroslav Pejic - miroslav.pejic.85@gmail.com
|
||||
* @version 1.6.54
|
||||
* @version 1.6.55
|
||||
*
|
||||
*/
|
||||
|
||||
@@ -945,10 +945,11 @@ function startServer() {
|
||||
return res.status(403).json({ error: 'Unauthorized!' });
|
||||
}
|
||||
|
||||
const { totalRooms, totalUsers } = api.getStats(roomList);
|
||||
const { timestamp, totalRooms, totalUsers } = api.getStats(roomList);
|
||||
|
||||
res.json({
|
||||
success: true,
|
||||
timestamp,
|
||||
totalRooms,
|
||||
totalUsers,
|
||||
});
|
||||
@@ -957,6 +958,7 @@ function startServer() {
|
||||
log.debug('MiroTalk get stats - Authorized', {
|
||||
header: req.headers,
|
||||
body: req.body,
|
||||
timestamp,
|
||||
totalRooms,
|
||||
totalUsers,
|
||||
});
|
||||
|
||||
@@ -21,10 +21,10 @@ module.exports = class ServerApi {
|
||||
return true;
|
||||
}
|
||||
|
||||
getStats(roomList) {
|
||||
getStats(roomList, timestamp = new Date().toISOString()) {
|
||||
const totalUsers = Array.from(roomList.values()).reduce((total, room) => total + room.peers.size, 0);
|
||||
const totalRooms = roomList.size;
|
||||
return { totalRooms, totalUsers };
|
||||
return { timestamp, totalRooms, totalUsers };
|
||||
}
|
||||
|
||||
getMeetings(roomList) {
|
||||
|
||||
المرجع في مشكلة جديدة
حظر مستخدم