[mirotalksfu] - improve stats, update dep.
هذا الالتزام موجود في:
@@ -40,7 +40,7 @@ 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.3.56
|
||||
* @version 1.3.57
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
@@ -152,7 +152,7 @@ module.exports = {
|
||||
stats: {
|
||||
/*
|
||||
Umami: https://github.com/umami-software/umami
|
||||
We use Umami to track aggregated usage statistics in order to improve our service.
|
||||
We use our Self-hosted Umami to track aggregated usage statistics in order to improve our service.
|
||||
*/
|
||||
enabled: true,
|
||||
src: 'https://stats.mirotalk.com/script.js',
|
||||
|
||||
10
package.json
10
package.json
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "mirotalksfu",
|
||||
"version": "1.3.56",
|
||||
"version": "1.3.57",
|
||||
"description": "WebRTC SFU browser-based video calls",
|
||||
"main": "Server.js",
|
||||
"scripts": {
|
||||
@@ -38,9 +38,9 @@
|
||||
"author": "Miroslav Pejic",
|
||||
"license": "AGPL-3.0",
|
||||
"dependencies": {
|
||||
"@sentry/integrations": "7.94.1",
|
||||
"@sentry/node": "7.94.1",
|
||||
"axios": "^1.6.5",
|
||||
"@sentry/integrations": "7.98.0",
|
||||
"@sentry/node": "7.98.0",
|
||||
"axios": "^1.6.7",
|
||||
"body-parser": "1.20.2",
|
||||
"colors": "1.4.0",
|
||||
"compression": "1.7.4",
|
||||
@@ -51,7 +51,7 @@
|
||||
"mediasoup": "3.13.16",
|
||||
"mediasoup-client": "3.7.2",
|
||||
"ngrok": "^4.3.3",
|
||||
"openai": "^4.24.7",
|
||||
"openai": "^4.26.0",
|
||||
"qs": "6.11.2",
|
||||
"socket.io": "4.7.4",
|
||||
"swagger-ui-express": "5.0.0",
|
||||
|
||||
@@ -11,7 +11,7 @@ if (location.href.substr(0, 5) !== 'https') location.href = 'https' + location.h
|
||||
* @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.3.56
|
||||
* @version 1.3.57
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
* @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.3.56
|
||||
* @version 1.3.57
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
@@ -1,26 +1,39 @@
|
||||
'use strict';
|
||||
|
||||
// const url = 'https://localhost:3010/stats';
|
||||
const url = 'https://sfu.mirotalk.com/stats';
|
||||
console.log('STATS', window.location);
|
||||
|
||||
fetch(url)
|
||||
.then((response) => {
|
||||
if (!response.ok) {
|
||||
throw new Error('Network response was not ok');
|
||||
}
|
||||
return response.json();
|
||||
})
|
||||
.then((data) => {
|
||||
// console.log('STATS', data);
|
||||
const { enabled, src, id } = data;
|
||||
if (enabled) {
|
||||
const script = document.createElement('script');
|
||||
script.setAttribute('async', '');
|
||||
script.setAttribute('src', src);
|
||||
script.setAttribute('data-website-id', id);
|
||||
document.head.appendChild(script);
|
||||
}
|
||||
})
|
||||
.catch((error) => {
|
||||
console.error('Stats fetch error:', error);
|
||||
});
|
||||
const statsDataKey = 'statsData';
|
||||
const statsData = window.sessionStorage.getItem(statsDataKey);
|
||||
|
||||
const apiUrl = window.location.origin + '/stats';
|
||||
|
||||
if (statsData) {
|
||||
setStats(JSON.parse(statsData));
|
||||
} else {
|
||||
fetch(apiUrl)
|
||||
.then((response) => {
|
||||
if (!response.ok) {
|
||||
throw new Error('Network response was not ok');
|
||||
}
|
||||
return response.json();
|
||||
})
|
||||
.then((data) => {
|
||||
setStats(data);
|
||||
window.sessionStorage.setItem(statsDataKey, JSON.stringify(data));
|
||||
})
|
||||
.catch((error) => {
|
||||
console.error('Stats fetch error:', error);
|
||||
});
|
||||
}
|
||||
|
||||
function setStats(data) {
|
||||
console.log('STATS', data);
|
||||
const { enabled, src, id } = data;
|
||||
if (enabled) {
|
||||
const script = document.createElement('script');
|
||||
script.setAttribute('async', '');
|
||||
script.setAttribute('src', src);
|
||||
script.setAttribute('data-website-id', id);
|
||||
document.head.appendChild(script);
|
||||
}
|
||||
}
|
||||
|
||||
المرجع في مشكلة جديدة
حظر مستخدم