1
0
mirror of https://github.com/KubaPro010/fm-dx-webserver.git synced 2026-02-26 22:13:53 +01:00

ui changes, playback bugfixes

This commit is contained in:
NoobishSVK
2024-02-11 20:16:51 +01:00
parent 858c0bd251
commit 037b282e25
7 changed files with 125 additions and 23 deletions

View File

@@ -121,7 +121,6 @@ function connectToXdrd() {
const lines = receivedData.split('\n');
for (const line of lines) {
if (!authFlags.receivedPassword) {
authFlags.receivedSalt = line.trim();
authenticateWithXdrd(client, authFlags.receivedSalt, serverConfig.xdrd.xdrdPassword);
@@ -143,7 +142,7 @@ function connectToXdrd() {
if (authFlags.authMsg && authFlags.firstClient) {
client.write('T87500\n');
client.write('A0\n');
client.write('G11\n');
client.write('G00\n');
client.off('data', authDataHandler);
return;
}
@@ -226,6 +225,17 @@ app.get('/static_data', (req, res) => {
});
});
app.get('/server_time', (req, res) => {
const serverTime = new Date().toISOString();
res.json({
serverTime
});
});
app.get('/ping', (req, res) => {
res.send('pong');
});
/**
* AUTHENTICATION BLOCK
@@ -342,7 +352,6 @@ app.get('/getData', (req, res) => {
app.get('/getDevices', (req, res) => {
if (req.session.isAdminAuthenticated || !fs.existsSync('config.json')) {
parseAudioDevice((result) => {
console.log(result);
res.json(result);
});
} else {