[mirotalksfu] - improve joinRoom
هذا الالتزام موجود في:
@@ -71,7 +71,9 @@ const view = {
|
|||||||
|
|
||||||
app.use(cors());
|
app.use(cors());
|
||||||
app.use(compression());
|
app.use(compression());
|
||||||
|
app.use(express.json());
|
||||||
app.use(express.static(dir.public));
|
app.use(express.static(dir.public));
|
||||||
|
app.use(apiBasePath + '/docs', swaggerUi.serve, swaggerUi.setup(swaggerDocument)); // api docs
|
||||||
|
|
||||||
// Remove trailing slashes in url handle bad requests
|
// Remove trailing slashes in url handle bad requests
|
||||||
app.use((err, req, res, next) => {
|
app.use((err, req, res, next) => {
|
||||||
@@ -153,7 +155,7 @@ app.get('/join/', (req, res) => {
|
|||||||
app.get('/join/*', (req, res) => {
|
app.get('/join/*', (req, res) => {
|
||||||
if (hostCfg.authenticated) {
|
if (hostCfg.authenticated) {
|
||||||
if (Object.keys(req.query).length > 0) {
|
if (Object.keys(req.query).length > 0) {
|
||||||
log.debug('redirect:' + req.url + ' to ' + url.parse(req.url).pathname);
|
log.debug('Redirect:' + req.url + ' to ' + url.parse(req.url).pathname);
|
||||||
res.redirect(url.parse(req.url).pathname);
|
res.redirect(url.parse(req.url).pathname);
|
||||||
} else {
|
} else {
|
||||||
res.sendFile(view.room);
|
res.sendFile(view.room);
|
||||||
@@ -177,12 +179,6 @@ app.get(['/privacy'], (req, res) => {
|
|||||||
// API
|
// API
|
||||||
// ####################################################
|
// ####################################################
|
||||||
|
|
||||||
// Api parse body data as json
|
|
||||||
app.use(express.json());
|
|
||||||
|
|
||||||
// api docs
|
|
||||||
app.use(apiBasePath + '/docs', swaggerUi.serve, swaggerUi.setup(swaggerDocument));
|
|
||||||
|
|
||||||
// request meeting room endpoint
|
// request meeting room endpoint
|
||||||
app.post(['/api/v1/meeting'], (req, res) => {
|
app.post(['/api/v1/meeting'], (req, res) => {
|
||||||
// check if user was authorized for the api call
|
// check if user was authorized for the api call
|
||||||
|
|||||||
@@ -119,7 +119,7 @@
|
|||||||
<button
|
<button
|
||||||
id="joinRoomButton"
|
id="joinRoomButton"
|
||||||
class="button button-primary pulse"
|
class="button button-primary pulse"
|
||||||
onclick="{window.location.href = '/join/' + document.getElementById('roomName').value}"
|
onclick="joinRoom()"
|
||||||
>
|
>
|
||||||
Join Room
|
Join Room
|
||||||
</button>
|
</button>
|
||||||
@@ -127,9 +127,13 @@
|
|||||||
document.getElementById('roomName').onkeyup = (e) => {
|
document.getElementById('roomName').onkeyup = (e) => {
|
||||||
if (e.keyCode === 13) {
|
if (e.keyCode === 13) {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
document.getElementById('joinRoomButton').click();
|
joinRoom();
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
function joinRoom() {
|
||||||
|
let roomName = document.getElementById('roomName').value;
|
||||||
|
window.location.href = '/join/' + roomName;
|
||||||
|
}
|
||||||
</script>
|
</script>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -122,7 +122,7 @@
|
|||||||
<button
|
<button
|
||||||
id="joinRoomButton"
|
id="joinRoomButton"
|
||||||
class="button button-primary pulse"
|
class="button button-primary pulse"
|
||||||
onclick="{window.location.href = '/join/' + document.getElementById('roomName').value}"
|
onclick="joinRoom()"
|
||||||
>
|
>
|
||||||
Join Room
|
Join Room
|
||||||
</button>
|
</button>
|
||||||
@@ -130,9 +130,13 @@
|
|||||||
document.getElementById('roomName').onkeyup = (e) => {
|
document.getElementById('roomName').onkeyup = (e) => {
|
||||||
if (e.keyCode === 13) {
|
if (e.keyCode === 13) {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
document.getElementById('joinRoomButton').click();
|
joinRoom();
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
function joinRoom() {
|
||||||
|
let roomName = document.getElementById('roomName').value;
|
||||||
|
window.location.href = '/join/' + roomName;
|
||||||
|
}
|
||||||
</script>
|
</script>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
المرجع في مشكلة جديدة
حظر مستخدم