diff --git a/package-lock.json b/package-lock.json index 5304b79..fe42fd1 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "fm-dx-webserver", - "version": "1.3.3.1", + "version": "1.3.4", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "fm-dx-webserver", - "version": "1.3.3.1", + "version": "1.3.4", "license": "ISC", "dependencies": { "@mapbox/node-pre-gyp": "1.0.11", diff --git a/package.json b/package.json index 2bfa0ee..ecb234c 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "fm-dx-webserver", - "version": "1.3.3.1", + "version": "1.3.4", "description": "FM DX Webserver", "main": "index.js", "scripts": { diff --git a/server/datahandler.js b/server/datahandler.js index 0160f95..82c9e8a 100644 --- a/server/datahandler.js +++ b/server/datahandler.js @@ -401,7 +401,7 @@ function handleData(wss, receivedData, rdsWss) { // Get the received TX info fetchTx(parseFloat(dataToSend.freq).toFixed(1), dataToSend.pi, dataToSend.ps) .then((currentTx) => { - if (currentTx && currentTx.station !== undefined) { + if (currentTx && currentTx.station !== undefined && parseInt(currentTx.distance) < 4000) { dataToSend.txInfo = { tx: currentTx.station, pol: currentTx.pol, diff --git a/server/endpoints.js b/server/endpoints.js index 8f450c5..fa85f57 100644 --- a/server/endpoints.js +++ b/server/endpoints.js @@ -21,11 +21,13 @@ router.get('/', (req, res) => { let requestIp = req.headers['x-forwarded-for'] || req.connection.remoteAddress; const normalizedIp = requestIp?.replace(/^::ffff:/, ''); - const isBanned = serverConfig.webserver.banlist.some(banEntry => banEntry[0] === normalizedIp); - + const ipList = normalizedIp.split(',').map(ip => ip.trim()); // in case there are multiple IPs (proxy), we need to check all of them + + const isBanned = ipList.some(ip => serverConfig.webserver.banlist.some(banEntry => banEntry[0] === ip)); + if (isBanned) { res.render('403'); - logInfo(`Web client (${requestIp}) is banned`); + logInfo(`Web client (${normalizedIp}) is banned`); return; } @@ -391,7 +393,8 @@ router.get('/log_fmlist', (req, res) => { client: { request_ip: clientIp }, - log_msg: "Logged PS: " + dataHandler.dataToSend.ps.replace(/\s+/g, '_') + ", PI: " + dataHandler.dataToSend.pi + ", Signal: " + dataHandler.dataToSend.sig.toFixed(0) + " dBf", + type: req.query.type ? req.query.type : 'tropo', + log_msg: "Logged PS: " + dataHandler.dataToSend.ps.replace(/\s+/g, '_') + ", PI: " + dataHandler.dataToSend.pi + ", Signal: " + (dataHandler.dataToSend.sig - 11.25).toFixed(0) + " dBµV", }); const options = { diff --git a/server/tx_search.js b/server/tx_search.js index bd4b74b..819cfa4 100644 --- a/server/tx_search.js +++ b/server/tx_search.js @@ -108,7 +108,7 @@ async function processData(data, piCode, rdsPs) { weightDistance = Math.abs(distance.distanceKm - 1500); } let erp = station.erp && station.erp > 0 ? station.erp : 1; - let extraWeight = erp > 10 && distance.distanceKm <= 2500 ? 0.3 : 0; + let extraWeight = erp >= 10 && distance.distanceKm <= 2500 ? 0.5 : 0; const score = ((10 * Math.log10(erp * 1000)) / weightDistance) + extraWeight; if (score > maxScore) { maxScore = score; diff --git a/web/css/breadcrumbs.css b/web/css/breadcrumbs.css index f53d1dc..5ed2e92 100644 --- a/web/css/breadcrumbs.css +++ b/web/css/breadcrumbs.css @@ -302,7 +302,7 @@ pre { position: absolute; width: 16px; height: 16px; - border: 2px solid var(--color-3); + border: 2px solid var(--color-text); border-radius: 50%; } diff --git a/web/css/buttons.css b/web/css/buttons.css index efc5761..273eade 100644 --- a/web/css/buttons.css +++ b/web/css/buttons.css @@ -333,6 +333,52 @@ select:hover { background: var(--color-5); } +.popup { + position: relative; + cursor: pointer; + -webkit-user-select: none; + -moz-user-select: none; + -ms-user-select: none; + user-select: none; + } + + .popup .popup-content { + visibility: hidden; + width: 230px; + background-color: var(--color-2-transparent); + backdrop-filter: blur(5px); + color: var(--color-text);; + text-align: center; + border-radius: 15px; + padding: 8px; + position: absolute; + z-index: 1; + top: 125%; + left: 50%; + margin-left: -115px; + border: 3px solid var(--color-3); + } + + .popup .show { + visibility: visible; + } + + button[disabled] .popup-content { + visibility: hidden; + } + + .popup .popup-content::after { + content: ""; + position: absolute; + bottom: calc(100% + 3px); + left: 50%; + margin-left: -5px; + border-width: 5px; + border-style: solid; + border-color: transparent transparent var(--color-3) transparent; + } + + @media only screen and (max-width: 768px) { #tune-buttons input[type="text"] { background-color: var(--color-1-transparent); diff --git a/web/css/modal.css b/web/css/modal.css index f0a1ea5..9cbe6a8 100644 --- a/web/css/modal.css +++ b/web/css/modal.css @@ -4,7 +4,6 @@ body.modal-open { .modal-panel, .modal-panel-chat { max-height: 100vh; - overflow-y: auto; } .modal { @@ -99,6 +98,7 @@ body.modal-open { width: 64px; background-color: var(--color-1); cursor: pointer; + padding: 5px; } .modal-panel-content { diff --git a/web/index.ejs b/web/index.ejs index a9453f4..7d4fc6e 100644 --- a/web/index.ejs +++ b/web/index.ejs @@ -70,9 +70,9 @@

-
+

-

+

TP TA
@@ -231,9 +231,16 @@
<% } %> <% if (fmlist_integration == true) { %> - + style="width: 80px; height: 48px;margin-left: 15px !important;"> + + + Choose the DX propagation type:
+ TropoSporadic-E +
+ <% } %>

@@ -461,15 +468,15 @@