[mirotlaksfu] - add survey in config.js

هذا الالتزام موجود في:
Miroslav Pejic
2023-05-12 09:35:44 +02:00
الأصل edab82f809
التزام 37734cdfca
5 ملفات معدلة مع 20 إضافات و7 حذوفات

عرض الملف

@@ -7,6 +7,7 @@ const log = new Logger('Room');
module.exports = class Room {
constructor(room_id, worker, io) {
this.id = room_id;
this.survey = config.survey;
this.worker = worker;
this.router = null;
this.audioLevelObserver = null;
@@ -114,6 +115,7 @@ module.exports = class Room {
toJson() {
return {
id: this.id,
survey: this.survey,
peers: JSON.stringify([...this.peers]),
};
}

عرض الملف

@@ -106,6 +106,16 @@ module.exports = {
return `https://get.geojs.io/v1/ip/geo/${ip}.json`;
},
},
survey: {
/*
QuestionPro
1. GoTo https://www.questionpro.com/
2. Create your account
3. Create your custom survey
*/
enabled: false,
url: '',
},
mediasoup: {
// Worker settings
numWorkers: Object.keys(os.cpus()).length,

عرض الملف

@@ -23,10 +23,9 @@ const RoomURL = window.location.href;
const socket = io({ transports: ['websocket'] });
const surveyActive = true;
const url = {
survey: 'https://www.questionpro.com/t/AUs7VZq02P',
let survey = {
enabled: true,
url: 'https://www.questionpro.com/t/AUs7VZq02P',
};
const _PEER = {
@@ -1524,7 +1523,7 @@ function handleRoomClientEvents() {
console.log('Room Client save recording before to exit');
rc.stopRecording();
}
if (surveyActive) {
if (survey.enabled) {
leaveFeedback();
} else {
openURL('/newroom');
@@ -1555,7 +1554,7 @@ function leaveFeedback() {
},
}).then((result) => {
if (result.isConfirmed) {
openURL(url.survey);
openURL(survey.url);
} else {
openURL('/newroom');
}

عرض الملف

@@ -311,6 +311,8 @@ class RoomClient {
}
async handleRoomInfo(room) {
console.log('07.0 ----> Room Survey', room.survey);
survey = room.survey;
let peers = new Map(JSON.parse(room.peers));
participantsCount = peers.size;
for (let peer of Array.from(peers.keys()).filter((id) => id == this.peer_id)) {

عرض الملف

@@ -334,7 +334,7 @@ function execVoiceCommands(transcript) {
break;
case commands.survey:
printCommand(commands.survey);
openURL(url.survey, true);
survey.enabled && openURL(survey.url, true);
sound('open');
break;
case commands.stopRecognition: