[mirotalksfu] - add roomsAllowed, fix, update dep
هذا الالتزام موجود في:
@@ -2106,3 +2106,11 @@ main {
|
||||
/* #roomName {
|
||||
text-align: left;
|
||||
} */
|
||||
|
||||
/*--------------------------------------------------------------
|
||||
# Login and Join ROOM
|
||||
--------------------------------------------------------------*/
|
||||
|
||||
#joinRoomForm {
|
||||
display: none;
|
||||
}
|
||||
|
||||
@@ -4,8 +4,13 @@ console.log(window.location);
|
||||
|
||||
const usernameInput = document.getElementById('username');
|
||||
const passwordInput = document.getElementById('password');
|
||||
const loginForm = document.getElementById('loginForm');
|
||||
const loginBtn = document.getElementById('loginButton');
|
||||
|
||||
const joinRoomForm = document.getElementById('joinRoomForm');
|
||||
const selectRoom = document.getElementById('selectRoom');
|
||||
const joinSelectRoomBtn = document.getElementById('joinSelectRoomButton');
|
||||
|
||||
usernameInput.onkeyup = (e) => {
|
||||
if (e.keyCode === 13) {
|
||||
e.preventDefault();
|
||||
@@ -23,6 +28,10 @@ loginBtn.onclick = (e) => {
|
||||
login();
|
||||
};
|
||||
|
||||
joinSelectRoomBtn.onclick = (e) => {
|
||||
join();
|
||||
};
|
||||
|
||||
function login() {
|
||||
const username = filterXSS(document.getElementById('username').value);
|
||||
const password = filterXSS(document.getElementById('password').value);
|
||||
@@ -50,6 +59,21 @@ function login() {
|
||||
const token = response.data.message;
|
||||
window.sessionStorage.peer_token = token;
|
||||
|
||||
// Allowed rooms
|
||||
const allowedRooms = response.data.allowedRooms;
|
||||
if (allowedRooms && !allowedRooms.includes('*')) {
|
||||
console.log('User detected with limited join room access!', allowedRooms);
|
||||
loginForm.style.display = 'none';
|
||||
joinRoomForm.style.display = 'block';
|
||||
allowedRooms.forEach((room) => {
|
||||
const option = document.createElement('option');
|
||||
option.value = room;
|
||||
option.text = room;
|
||||
selectRoom.appendChild(option);
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
if (room) {
|
||||
return (window.location.href = '/join/' + window.location.search);
|
||||
// return (window.location.href = '/join/?room=' + room + '&token=' + token);
|
||||
@@ -80,3 +104,10 @@ function login() {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
function join() {
|
||||
//window.location.href = '/join/' + selectRoom.value;
|
||||
const username = filterXSS(document.getElementById('username').value);
|
||||
const roomId = filterXSS(document.getElementById('selectRoom').value);
|
||||
window.location.href = '/join/?room=' + roomId + '&name=' + username + '&token=' + window.sessionStorage.peer_token;
|
||||
}
|
||||
|
||||
@@ -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.5.88
|
||||
* @version 1.5.89
|
||||
*
|
||||
*/
|
||||
|
||||
@@ -4500,7 +4500,7 @@ function showAbout() {
|
||||
imageUrl: image.about,
|
||||
customClass: { image: 'img-about' },
|
||||
position: 'center',
|
||||
title: 'WebRTC SFU v1.5.88',
|
||||
title: 'WebRTC SFU v1.5.89',
|
||||
html: `
|
||||
<br />
|
||||
<div id="about">
|
||||
|
||||
@@ -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.5.88
|
||||
* @version 1.5.89
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
@@ -42,6 +42,20 @@
|
||||
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=IBM+Plex+Sans:400,600" />
|
||||
<link rel="stylesheet" type="text/css" href="../css/landing.css" />
|
||||
|
||||
<!-- Bootstrap 5 -->
|
||||
|
||||
<link
|
||||
href="https://cdn.jsdelivr.net/npm/bootstrap@5.0.2/dist/css/bootstrap.min.css"
|
||||
rel="stylesheet"
|
||||
integrity="sha384-EVSTQN3/azprG1Anm3QDgpJLIm9Nao0Yz1ztcQTwFspd3yD65VohhpuuCOmLASjC"
|
||||
crossorigin="anonymous"
|
||||
/>
|
||||
<script
|
||||
src="https://cdn.jsdelivr.net/npm/bootstrap@5.0.2/dist/js/bootstrap.bundle.min.js"
|
||||
integrity="sha384-MrcW6ZMFYlzcLA8Nl+NtUVF0sA7MsXsP1UyJoMp4YLEuNSfAP+JcXn/tWtIaxVXM"
|
||||
crossorigin="anonymous"
|
||||
></script>
|
||||
|
||||
<!-- Js scripts -->
|
||||
|
||||
<script defer src="../js/Brand.js"></script>
|
||||
@@ -63,24 +77,7 @@
|
||||
<header class="site-header">
|
||||
<div class="container">
|
||||
<div class="site-header-inner">
|
||||
<div class="brand header-brand">
|
||||
<h1 class="m-0">
|
||||
<a href="/">
|
||||
<img
|
||||
class="header-logo-image"
|
||||
src="../images/logo.svg"
|
||||
alt="mirotalksfu-webrtc-logo"
|
||||
/>
|
||||
<!-- <img
|
||||
class="header-logo-image reveal-from-left"
|
||||
src="../images/mirotalk-mc.png"
|
||||
alt="mirotalksfu-webrtc-logo"
|
||||
width="96"
|
||||
height="auto"
|
||||
/> -->
|
||||
</a>
|
||||
</h1>
|
||||
</div>
|
||||
<div class="brand header-brand"></div>
|
||||
</div>
|
||||
</div>
|
||||
</header>
|
||||
@@ -119,6 +116,25 @@
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
<!-- Join Room Section hidden -->
|
||||
<div id="joinRoomForm" class="mb-12">
|
||||
<div class="hero-copy reveal-from-bottom">
|
||||
<h1 class="hero-title mt-0">
|
||||
Pick name. <br />
|
||||
Share URL. <br />
|
||||
Start conference.
|
||||
</h1>
|
||||
</div>
|
||||
<br />
|
||||
<div class="mb-12">
|
||||
<select id="selectRoom" class="form-select text-light bg-dark"></select>
|
||||
</div>
|
||||
<div class="mt-24 mb-32">
|
||||
<button id="joinSelectRoomButton" class="button button-primary button-block">
|
||||
JOIN ROOM
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="hero-figure anime-element">
|
||||
<svg class="placeholder" width="528" height="396" viewBox="0 0 528 396">
|
||||
@@ -143,11 +159,7 @@
|
||||
<footer id="footer" class="site-footer">
|
||||
<div class="container">
|
||||
<div class="site-footer-inner">
|
||||
<div class="brand footer-brand">
|
||||
<a href="/">
|
||||
<img class="header-logo-image" src="../images/logo.svg" alt="Logo" />
|
||||
</a>
|
||||
</div>
|
||||
<div class="brand footer-brand"></div>
|
||||
<ul class="footer-links list-reset">
|
||||
<li>
|
||||
<a href="/about">About</a>
|
||||
|
||||
المرجع في مشكلة جديدة
حظر مستخدم