Skip to content

Commit

Permalink
[mirotalkwebrtc] - improve config.js
Browse files Browse the repository at this point in the history
  • Loading branch information
miroslavpejic85 committed Dec 14, 2024
1 parent 75eeb0a commit 3158f72
Show file tree
Hide file tree
Showing 4 changed files with 43 additions and 14 deletions.
8 changes: 8 additions & 0 deletions backend/config.template.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
'use-strict';

module.exports = {
App: {
Name: 'MiroTalk test',
Logo: '../Images/logo.png',
},
Author: {
Email: 'miroslav.pejic.85@gmail.com',
Profile: 'https://www.linkedin.com/in/miroslav-pejic-976a07101/',
Expand All @@ -9,6 +13,7 @@ module.exports = {
MiroTalk: {
P2P: {
Visible: true,
Label: 'MiroTalk P2P',
Home: 'https://p2p.mirotalk.com',
Room: 'https://p2p.mirotalk.com/newcall',
Join: 'https://p2p.mirotalk.com/join/',
Expand All @@ -22,6 +27,7 @@ module.exports = {
SFU: {
Visible: true,
Protected: false, // host_protected or user_auth enabled
Label: 'MiroTalk SFU',
Home: 'https://sfu.mirotalk.com',
Room: 'https://sfu.mirotalk.com/newroom',
Join: 'https://sfu.mirotalk.com/join/',
Expand All @@ -34,6 +40,7 @@ module.exports = {
},
C2C: {
Visible: true,
Label: 'MiroTalk C2C',
Home: 'https://c2c.mirotalk.com',
Room: 'https://c2c.mirotalk.com/?room=',
GitHub: {
Expand All @@ -45,6 +52,7 @@ module.exports = {
},
BRO: {
Visible: true,
Label: 'MiroTalk BRO',
Home: 'https://bro.mirotalk.com',
Broadcast: 'https://bro.mirotalk.com/broadcast?id=',
Viewer: 'https://bro.mirotalk.com/viewer?id=',
Expand Down
16 changes: 8 additions & 8 deletions frontend/html/client.html
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,9 @@
<nav>
<div class="logo-name">
<div class="logo-image">
<img src="../Images/logo.png" alt="miroslav-pejic" />
<img id="navLogoImage" src="../Images/logo.png" alt="miroslav-pejic" />
</div>
<span class="logo_name">MiroTalk</span>
<span id="navLogoLabel" class="logo_name">MiroTalk</span>
</div>

<div class="menu-items">
Expand All @@ -69,25 +69,25 @@
<li>
<a id="navP2P" href="javascript:void(0)">
<i class="uil uil-rocket"></i>
<span class="link-name">MiroTalk P2P</span>
<span id="navP2PLabel" class="link-name">MiroTalk P2P</span>
</a>
</li>
<li>
<a id="navSFU" href="javascript:void(0)">
<i class="uil uil-trophy"></i>
<span class="link-name">MiroTalk SFU</span>
<span id="navSFULabel" class="link-name">MiroTalk SFU</span>
</a>
</li>
<li>
<a id="navC2C" href="javascript:void(0)">
<i class="uil uil-star"></i>
<span class="link-name">MiroTalk C2C</span>
<span id="navC2CLabel" class="link-name">MiroTalk C2C</span>
</a>
</li>
<li>
<a id="navBRO" href="javascript:void(0)">
<i class="uil uil-wifi"></i>
<span class="link-name">MiroTalk BRO</span>
<span id="navBROLabel" class="link-name">MiroTalk BRO</span>
</a>
</li>
<li>
Expand Down Expand Up @@ -241,7 +241,7 @@
<table id="myTable" class="fadeIn">
<thead>
<tr>
<th>MiroTalk</th>
<th id="tableAppName">MiroTalk</th>
<th>Tag</th>
<th>Email</th>
<th>Phone</th>
Expand All @@ -257,7 +257,7 @@

<form id="addRowDiv" class="addRowDiv hidden" onsubmit="return false">
<i id="add-close-btn" class="uil uil-multiply"></i>
<label for="mirotalk">MiroTalk</label>
<label id="rowAppName" for="mirotalk">MiroTalk</label>
<select id="add-type" class="add-row-select-options" required>
<option value="P2P">P2P</option>
<option value="SFU">SFU</option>
Expand Down
23 changes: 22 additions & 1 deletion frontend/js/client.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
* @license For private project or commercial purposes contact us at: license.mirotalk@gmail.com or purchase it directly via Code Canyon:
* @license https://codecanyon.net/item/a-selfhosted-mirotalks-webrtc-rooms-scheduler-server/42643313
* @author Miroslav Pejic - miroslav.pejic.85@gmail.com
* @version 1.1.26
* @version 1.1.27
*/

const isMobile = !!/Android|webOS|iPhone|iPad|iPod|BB10|BlackBerry|IEMobile|Opera Mini|Mobile|mobile/i.test(
Expand All @@ -30,6 +30,17 @@ const navSup = document.getElementById('navSup');
const navAcc = document.getElementById('navAcc');
const navSet = document.getElementById('navSet');

const navLogoImage = document.getElementById('navLogoImage');
const navLogoLabel = document.getElementById('navLogoLabel');

const navP2PLabel = document.getElementById('navP2PLabel');
const navSFULabel = document.getElementById('navSFULabel');
const navC2CLabel = document.getElementById('navC2CLabel');
const navBROLabel = document.getElementById('navBROLabel');

const tableAppName = document.getElementById('tableAppName');
const rowAppName = document.getElementById('rowAppName');

const myProfile = document.getElementById('myProfile');

const search = document.getElementById('search');
Expand Down Expand Up @@ -192,6 +203,8 @@ function loadConfig(cfg) {
config = cfg;
html = cfg.HTML ? cfg.HTML : html;
console.log('Config', config);
const appName = config?.App?.Name || 'MiroTalk';
const appLogo = config?.App?.Logo || '../Images/logo.png';
myProfile.setAttribute('href', config.Author.Profile);
repoP2P.setAttribute('href', config.MiroTalk.P2P.GitHub.Repo);
starP2P.setAttribute('href', config.MiroTalk.P2P.GitHub.Star);
Expand All @@ -209,6 +222,14 @@ function loadConfig(cfg) {
sfuIframe.setAttribute('src', config.MiroTalk.SFU.Room);
c2cIframe.setAttribute('src', config.MiroTalk.C2C.Home);
broIframe.setAttribute('src', config.MiroTalk.BRO.Home);
navLogoImage.setAttribute('src', appLogo);
navLogoLabel.textContent = appName;
navP2PLabel.textContent = config.MiroTalk.P2P.Label || 'MiroTalk P2P';
navSFULabel.textContent = config.MiroTalk.SFU.Label || 'MiroTalk SFU';
navC2CLabel.textContent = config.MiroTalk.C2C.Label || 'MiroTalk C2C';
navBROLabel.textContent = config.MiroTalk.BRO.Label || 'MiroTalk BRO';
tableAppName.textContent = appName;
rowAppName.textContent = appName;
}

function handleTokens(cfg) {
Expand Down
10 changes: 5 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "mirotalkwebrtc",
"version": "1.1.26",
"version": "1.1.27",
"description": "MiroTalk WebRTC admin",
"main": "server.js",
"scripts": {
Expand Down Expand Up @@ -33,7 +33,7 @@
"license": "AGPL-3.0",
"homepage": "https://github.com/miroslavpejic85/mirotalkwebrtc",
"dependencies": {
"@sentry/node": "^8.42.0",
"@sentry/node": "^8.45.0",
"axios": "^1.7.9",
"bcryptjs": "^2.4.3",
"colors": "1.4.0",
Expand All @@ -44,14 +44,14 @@
"express": "^4.21.2",
"jsonwebtoken": "^9.0.2",
"js-yaml": "^4.1.0",
"mongoose": "^8.8.4",
"mongoose": "^8.9.0",
"ngrok": "^5.0.0-beta.2",
"nodemailer": "^6.9.16",
"swagger-ui-express": "^5.0.1",
"twilio": "^5.3.7"
"twilio": "^5.4.0"
},
"devDependencies": {
"nodemon": "^3.1.7",
"nodemon": "^3.1.9",
"prettier": "3.4.2"
}
}

0 comments on commit 3158f72

Please sign in to comment.