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-08-01 20:12:24 +02:00
parent 2e719448b2
commit 8df2eab272
13 changed files with 54 additions and 59 deletions

View File

@@ -123,6 +123,10 @@ router.get('/setup', (req, res) => {
}); });
router.get('/rds', (req, res) => {
res.send('Please connect using a WebSocket compatible app to obtain RDS stream.');
});
router.get('/api', (req, res) => { router.get('/api', (req, res) => {
const { ps_errors, rt0_errors, rt1_errors, ims, eq, ant, st_forced, previousFreq, txInfo, ...dataToSend } = dataHandler.dataToSend; const { ps_errors, rt0_errors, rt1_errors, ims, eq, ant, st_forced, previousFreq, txInfo, ...dataToSend } = dataHandler.dataToSend;
res.json(dataToSend); res.json(dataToSend);

View File

@@ -34,7 +34,7 @@ console.log(`\x1b[32m
| _| | | | |_____| |_| / \\ \\ V V / __/ |_) \\__ \\ __/ | \\ V / __/ | | _| | | | |_____| |_| / \\ \\ V V / __/ |_) \\__ \\ __/ | \\ V / __/ |
|_| |_| |_| |____/_/\\_\\ \\_/\\_/ \\___|_.__/|___/\\___|_| \\_/ \\___|_| |_| |_| |_| |____/_/\\_\\ \\_/\\_/ \\___|_.__/|___/\\___|_| \\_/ \\___|_|
`); `);
console.log('\x1b[0mFM-DX-Webserver', pjson.version); console.log('\x1b[0mFM-DX Webserver', pjson.version);
console.log('\x1b[90m―――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――'); console.log('\x1b[90m―――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――');
// Start ffmpeg // Start ffmpeg
@@ -285,6 +285,8 @@ wss.on('connection', (ws, request) => {
logInfo(`Web client \x1b[32mconnected\x1b[0m (${clientIp}) \x1b[90m[${currentUsers}]\x1b[0m`); logInfo(`Web client \x1b[32mconnected\x1b[0m (${clientIp}) \x1b[90m[${currentUsers}]\x1b[0m`);
} }
}); });
}).on('error', (err) => {
logInfo(`Web client \x1b[32mconnected\x1b[0m (${clientIp}) \x1b[90m[${currentUsers}]\x1b[0m`);
}); });
ws.on('message', (message) => { ws.on('message', (message) => {
@@ -463,7 +465,7 @@ httpServer.on('upgrade', (request, socket, head) => {
chatWss.emit('connection', ws, request); chatWss.emit('connection', ws, request);
}); });
}); });
} else if (request.url === '/rds') { } else if (request.url === '/rds' || request.url === '/rdsspy') {
sessionMiddleware(request, {}, () => { sessionMiddleware(request, {}, () => {
rdsWss.handleUpgrade(request, socket, head, (ws) => { rdsWss.handleUpgrade(request, socket, head, (ws) => {
rdsWss.emit('connection', ws, request); rdsWss.emit('connection', ws, request);

View File

@@ -1,5 +1,6 @@
const fetch = require('node-fetch'); const fetch = require('node-fetch');
const { serverConfig } = require('./server_config') const { serverConfig } = require('./server_config');
const consoleCmd = require('./console');
let cachedData = {}; let cachedData = {};
@@ -39,7 +40,6 @@ function fetchTx(freq, piCode, rdsPs) {
return processData(data, piCode, rdsPs); return processData(data, piCode, rdsPs);
}) })
.catch(error => { .catch(error => {
console.error("Error fetching data:", error);
}); });
} }

View File

@@ -51,7 +51,7 @@ h4 {
padding: 5px 25px; padding: 5px 25px;
z-index: 1000; z-index: 1000;
opacity: 0; opacity: 0;
transition: opacity 0.3s ease-in-out; transition: opacity 0.3s ease;
} }
p#tuner-desc { p#tuner-desc {
@@ -126,7 +126,7 @@ label {
line-height: 64px; line-height: 64px;
text-align: center; text-align: center;
border-radius: 50%; border-radius: 50%;
transition: 500ms ease-in-out background; transition: 500ms ease background;
cursor: pointer; cursor: pointer;
} }
@@ -143,7 +143,7 @@ label {
line-height: 64px; line-height: 64px;
text-align: center; text-align: center;
border-radius: 50%; border-radius: 50%;
transition: 500ms ease-in-out background; transition: 500ms ease background;
cursor: pointer; cursor: pointer;
} }
@@ -278,7 +278,7 @@ label {
align-items: center; align-items: center;
font-size: 18px; font-size: 18px;
border-radius: 10px; border-radius: 10px;
transition: 0.3s ease-in-out background-color; transition: 0.3s ease background-color;
cursor: pointer; cursor: pointer;
} }
@@ -331,6 +331,10 @@ pre {
margin: auto !important; margin: auto !important;
width: 100%; width: 100%;
} }
h1#tuner-name {
max-width: 90%;
margin: auto;
}
h2 { h2 {
display: none; display: none;
} }

View File

@@ -3,7 +3,7 @@ button, input[type="submit"] {
height: 100%; height: 100%;
border: 0; border: 0;
border-radius: 15px; border-radius: 15px;
transition: 0.3s ease-in-out background-color; transition: 0.3s ease background-color;
background-color: var(--color-4); background-color: var(--color-4);
cursor: pointer; cursor: pointer;
font-family: inherit; font-family: inherit;
@@ -90,54 +90,39 @@ input[type="text"], textarea, input[type="password"] {
border: 2px solid transparent; border: 2px solid transparent;
outline: 0; outline: 0;
color: var(--color-text); color: var(--color-text);
background-color: transparent; background-color: var(--color-1-transparent);
font-family: 'Titillium Web', sans-serif; font-family: 'Titillium Web', sans-serif;
} }
#tune-buttons input[type="text"]:not(.no-bg):not(.no-filter)::before {
content: '';
position: absolute;
top: 0;
left: 0;
right: 0;
bottom: 0;
background-color: var(--color-1);
opacity: 0.6; /* Set the desired opacity */
pointer-events: none; /* Ensure it does not interfere with interactions */
z-index: -1; /* Place the pseudo-element behind the panel content */
border-radius: 15px;
}
#tune-buttons input[type="text"]:not(.no-bg):not(.no-filter) { #tune-buttons input[type="text"]:not(.no-bg):not(.no-filter) {
backdrop-filter: blur(5px); backdrop-filter: blur(5px);
background-attachment: fixed; background-attachment: fixed;
} }
#tune-buttons button { #tune-buttons button {
box-sizing: border-box; box-sizing: border-box;
background-color: var(--color-4); background-color: var(--color-4);
border: 0; border: 0;
color: var(--color-1); color: var(--color-1);
width: 25%; width: 25%;
height: 48px; height: 48px;
display: block; display: block;
padding: 14px; padding: 14px;
cursor: pointer; cursor: pointer;
transition: background-color 0.3s ease-in-out; transition: background-color 0.3s ease;
} }
#tune-buttons button:hover { #tune-buttons button:hover {
background-color: var(--color-main-bright); background-color: var(--color-main-bright);
} }
#freq-down { #freq-down {
border-radius: 15px 0 0 15px; border-radius: 15px 0 0 15px;
} }
#freq-up { #freq-up {
border-radius: 0 15px 15px 0; border-radius: 0 15px 15px 0;
} }
input[type="range"] { input[type="range"] {
margin: 0; margin: 0;
@@ -326,7 +311,7 @@ select {
border: 0; border: 0;
border-bottom: 4px solid var(--color-2); border-bottom: 4px solid var(--color-2);
cursor: pointer; cursor: pointer;
transition: 0.35s ease-in-out background; transition: 0.35s ease background;
font-family: inherit; font-family: inherit;
font-weight: bold; font-weight: bold;
} }

View File

@@ -40,7 +40,7 @@
background-color: var(--color-4); background-color: var(--color-4);
color: var(--color-main); color: var(--color-main);
border-radius: 15px; border-radius: 15px;
transition: 0.35s ease-in-out background-color; transition: 0.35s ease background-color;
} }
.dropdown input:hover { .dropdown input:hover {

View File

@@ -107,7 +107,7 @@
} }
.hover-brighten { .hover-brighten {
transition: 0.3s ease-in-out background-color; transition: 0.3s ease background-color;
} }
.hover-brighten:hover { .hover-brighten:hover {

View File

@@ -55,7 +55,7 @@ body {
background-repeat: no-repeat; background-repeat: no-repeat;
background-position: center; background-position: center;
background-size: cover; background-size: cover;
transition: 0.3s ease-in-out background-color; transition: 0.3s ease background-color;
margin: 0 auto; margin: 0 auto;
min-height: 100%; min-height: 100%;
} }

View File

@@ -7,7 +7,7 @@
height: 100%; height: 100%;
background-color: rgba(0, 0, 0, 0.6); /* Semi-transparent background */ background-color: rgba(0, 0, 0, 0.6); /* Semi-transparent background */
opacity: 0; opacity: 0;
transition: opacity 0.3s ease-in-out; /* Fade-in/out transition */ transition: opacity 0.3s ease; /* Fade-in/out transition */
z-index: 20; /* Ensure the modal is above other content */ z-index: 20; /* Ensure the modal is above other content */
color: var(--color-4); color: var(--color-4);
backdrop-filter: blur(10px); backdrop-filter: blur(10px);
@@ -24,7 +24,7 @@
padding: 30px; padding: 30px;
border-radius: 15px; border-radius: 15px;
opacity: 1; opacity: 1;
transition: opacity 0.3s ease-in-out; /* Fade-in/out transition */ transition: opacity 0.3s ease; /* Fade-in/out transition */
z-index: 21; /* Ensure the modal content is above the modal background */ z-index: 21; /* Ensure the modal content is above the modal background */
min-width: 500px; min-width: 500px;
} }
@@ -43,7 +43,7 @@
top: 17px; top: 17px;
right: 30px; right: 30px;
cursor: pointer; cursor: pointer;
transition: 0.3s ease-in-out color; transition: 0.3s ease color;
} }
.close:hover { .close:hover {
@@ -60,7 +60,7 @@
background: var(--color-4); background: var(--color-4);
font-weight: bold; font-weight: bold;
border: 0; border: 0;
transition: 0.35s ease-in-out background; transition: 0.35s ease background;
cursor: pointer; cursor: pointer;
} }

View File

@@ -5,11 +5,10 @@
border-radius: 15px; border-radius: 15px;
text-align: center; text-align: center;
margin-top: 20px; margin-top: 20px;
transition: 0.3s ease-in-out background-color; transition: 0.3s ease background-color;
} }
*[class^="panel-"]:not(.no-bg):not(.no-filter):not(.w-100) { *[class^="panel-"]:not(.no-bg):not(.no-filter):not(.w-100) {
-webkit-backdrop-filter: blur(5px);
backdrop-filter: blur(5px); backdrop-filter: blur(5px);
} }
@@ -71,8 +70,9 @@
margin-bottom: 20px; margin-bottom: 20px;
background-color: transparent; background-color: transparent;
} }
*[class^="panel-"]:not(.no-bg):not(.no-filter) { *[class^="panel-"]:not(.no-bg):not(.no-filter):not(#ps-container),
backdrop-filter:blur(0px); .panel-100.w-100::before {
backdrop-filter: blur(0px);
} }
.flex-phone { .flex-phone {
display: flex; display: flex;

View File

@@ -37,7 +37,7 @@ ul.nav li {
display: inline; display: inline;
padding: 15px; padding: 15px;
cursor: pointer; cursor: pointer;
transition: color 0.3s ease-in-out, background-color 0.3s ease-in-out; transition: color 0.3s ease, background-color 0.3s ease;
user-select: none; user-select: none;
} }

View File

@@ -146,7 +146,7 @@
</div> </div>
</div> </div>
<div class="panel-33 flex-container flex-phone" id="tune-buttons"> <div class="panel-33 flex-container flex-phone no-bg" id="tune-buttons">
<button id="freq-down" aria-label="Tune down"><i class="fa-solid fa-chevron-left"></i></button> <button id="freq-down" aria-label="Tune down"><i class="fa-solid fa-chevron-left"></i></button>
<input type="text" id="commandinput" inputmode="numeric" placeholder="Frequency" autocomplete="off" aria-label="Current frequency: "> <input type="text" id="commandinput" inputmode="numeric" placeholder="Frequency" autocomplete="off" aria-label="Current frequency: ">
<button id="freq-up" aria-label="Tune up"><i class="fa-solid fa-chevron-right"></i></button> <button id="freq-up" aria-label="Tune up"><i class="fa-solid fa-chevron-right"></i></button>

View File

@@ -1,9 +1,9 @@
var currentDate = new Date('Jul 31, 2024 17:00:00'); var currentDate = new Date('Aug 1, 2024 20:00:00');
var day = currentDate.getDate(); var day = currentDate.getDate();
var month = currentDate.getMonth() + 1; // Months are zero-indexed, so add 1 var month = currentDate.getMonth() + 1; // Months are zero-indexed, so add 1
var year = currentDate.getFullYear(); var year = currentDate.getFullYear();
var formattedDate = day + '/' + month + '/' + year; var formattedDate = day + '/' + month + '/' + year;
var currentVersion = 'v1.2.6 [' + formattedDate + ']'; var currentVersion = 'v1.2.6a [' + formattedDate + ']';
getInitialSettings(); getInitialSettings();