1
0
mirror of https://github.com/KubaPro010/fm-dx-webserver.git synced 2026-02-26 22:13:53 +01:00
This commit is contained in:
NoobishSVK
2024-04-22 21:44:39 +02:00
parent ea2914f3e5
commit 1775da67cc
5 changed files with 12 additions and 10 deletions

View File

@@ -16,7 +16,7 @@ const fmdxList = require('./fmdx_list');
// Endpoints
router.get('/', (req, res) => {
if(serverConfig.webserver.banlist.includes(req.connection.remoteAddress)) {
if(serverConfig.webserver.banlist.includes(req.connection.remoteAddress || req.headers['x-forwarded-for'])) {
res.render('403');
return;
}

View File

@@ -86,7 +86,7 @@ function connectToSerial() {
serialport.write('F-1\n');
serialport.write('W0\n');
serialport.write('D0\n');
serialport.write('G11\n');
serialport.write('G00\n');
serverConfig.audio.startupVolume ? serialport.write('Y' + (serverConfig.audio.startupVolume * 100).toFixed(0) + '\n') : serialport.write('Y100\n');
serialport.on('data', (data) => {
@@ -277,7 +277,7 @@ wss.on('connection', (ws, request) => {
return;
}
if (command.includes("'")) {
if (command.includes("\'")) {
return;
}
@@ -448,4 +448,4 @@ httpServer.listen(serverConfig.webserver.webserverPort, serverConfig.webserver.w
}
});
fmdxList.update();
fmdxList.update();

View File

@@ -25,12 +25,12 @@ function OnPlayButtonClick(_ev) {
Stream.Stop();
} else {
Stream.Start();
const $playbutton = $('.playbutton');
$playbutton.find('.fa-solid').toggleClass('fa-play fa-stop');
$playbutton.addClass('bg-gray').prop('disabled', true);
setTimeout(() => {
$playbutton.removeClass('bg-gray').prop('disabled', false);
}, 3000);
const $playbutton = $('.playbutton');
$playbutton.find('.fa-solid').toggleClass('fa-play fa-stop');
}
} catch (error) {
console.error(error);

View File

@@ -1,9 +1,9 @@
var currentDate = new Date('April 6, 2024 01:00:00');
var currentDate = new Date('April 22, 2024 22:00:00');
var day = currentDate.getDate();
var month = currentDate.getMonth() + 1; // Months are zero-indexed, so add 1
var year = currentDate.getFullYear();
var formattedDate = day + '/' + month + '/' + year;
var currentVersion = 'v1.1.9b [' + formattedDate + ']';
var currentVersion = 'v1.1.9c [' + formattedDate + ']';
getInitialSettings();
@@ -25,4 +25,4 @@ function getInitialSettings() {
console.error('Error:', error);
}
});
}
}

View File

@@ -59,6 +59,7 @@
<th>IP Address</th>
<th>Location</th>
<th>Online since</th>
<th></th>
</tr>
</thead>
<tbody>
@@ -68,11 +69,12 @@
<td><%= user.ip %></td>
<td><%= user.location %></td>
<td><%= user.time %></td>
<td><a href="./kick?user=<% user.ip %>">Kick</a></td>
</tr>
<% }); %>
<% } else { %>
<tr>
<td colspan="3" style="text-align: center">No users online</td>
<td colspan="4" style="text-align: center">No users online</td>
</tr>
<% } %>
</tbody>