diff --git a/package.json b/package.json
index ad308c0..266673a 100644
--- a/package.json
+++ b/package.json
@@ -1,6 +1,6 @@
{
"name": "fm-dx-webserver",
- "version": "1.2.0",
+ "version": "1.2.1",
"description": "FM DX Webserver",
"main": "index.js",
"scripts": {
diff --git a/server/datahandler.js b/server/datahandler.js
index 96029ee..43e950f 100644
--- a/server/datahandler.js
+++ b/server/datahandler.js
@@ -261,6 +261,10 @@ function handleData(ws, receivedData) {
for (const receivedLine of receivedLines) {
switch (true) {
+ case receivedLine.startsWith('F'): // Bandwidth
+ initialData.bw = receivedLine.substring(1);
+ dataToSend.bw = receivedLine.substring(1);
+ break;
case receivedLine.startsWith('P'): // PI Code
modifiedData = receivedLine.slice(1);
legacyRdsPiBuffer = modifiedData;
diff --git a/server/fmdx_list.js b/server/fmdx_list.js
index f422eba..977d7ea 100644
--- a/server/fmdx_list.js
+++ b/server/fmdx_list.js
@@ -67,7 +67,7 @@ function sendUpdate() {
}
const request = {
- status: (serverConfig.lockToAdmin ? 2 : 1),
+ status: ((serverConfig.lockToAdmin == 'true' || serverConfig.publicTuner == 'false') ? 2 : 1),
coords: [serverConfig.identification.lat, serverConfig.identification.lon],
name: serverConfig.identification.tunerName,
desc: serverConfig.identification.tunerDesc,
diff --git a/web/css/helpers.css b/web/css/helpers.css
index caa0ae3..701c78b 100644
--- a/web/css/helpers.css
+++ b/web/css/helpers.css
@@ -190,6 +190,10 @@
padding: 10px;
}
+.p-left-10 {
+ padding-left: 10px;
+}
+
.p-bottom-20 {
padding-bottom: 20px;
}
diff --git a/web/css/main.css b/web/css/main.css
index df73890..f1bb68c 100644
--- a/web/css/main.css
+++ b/web/css/main.css
@@ -81,38 +81,38 @@ hr {
color: var(--color-4);
}
-table {
+.table-big {
border-radius: 30px;
background-color: var(--color-2);
padding: 20px;
margin: auto;
}
-table th {
+.table-big th {
padding: 8px 20px;
outline: 1px solid var(--color-3);
background-color: var(--color-3);
}
-table td {
+.table-big td {
padding: 8px 20px;
}
-table td:nth-child(1) {
+.table-big td:nth-child(1) {
text-align: left;
}
-table td:nth-child(2) {
+.table-big td:nth-child(2) {
color: var(--color-main-bright);
text-align: left;
}
-table th:nth-child(1) {
+.table-big th:nth-child(1) {
border-radius: 30px 0px 0px 30px;
}
-table th:nth-last-child(1){
+.table-big th:nth-last-child(1){
border-radius: 0px 30px 30px 0px;
}
diff --git a/web/index.ejs b/web/index.ejs
index 6b37885..fa47a86 100644
--- a/web/index.ejs
+++ b/web/index.ejs
@@ -188,35 +188,35 @@
- Auto
- - 9 KHz
- - 15 KHz
- - 17 KHz
- - 20 KHz
- - 24 KHz
- - 27 KHz
- - 32 KHz
- - 36 KHz
- - 42 KHz
- - 48 KHz
- - 55 KHz
- - 63 KHz
- - 73 KHz
- - 83 KHz
- - 90 KHz
- - 95 KHz
- - 108 KHz
- - 125 KHz
- - 142 KHz
- - 159 KHz
- - 177 KHz
- - 194 KHz
- - 211 KHz
- - 229 KHz
- - 246 KHz
- - 263 KHz
- - 281 KHz
- - 298 KHz
- - 309 KHz
+ - 9 KHz
+ - 15 KHz
+ - 17 KHz
+ - 20 KHz
+ - 24 KHz
+ - 27 KHz
+ - 32 KHz
+ - 36 KHz
+ - 42 KHz
+ - 48 KHz
+ - 55 KHz
+ - 63 KHz
+ - 73 KHz
+ - 83 KHz
+ - 90 KHz
+ - 95 KHz
+ - 108 KHz
+ - 125 KHz
+ - 142 KHz
+ - 159 KHz
+ - 177 KHz
+ - 194 KHz
+ - 211 KHz
+ - 229 KHz
+ - 246 KHz
+ - 263 KHz
+ - 281 KHz
+ - 298 KHz
+ - 309 KHz
<% } %>
@@ -401,20 +401,42 @@
<% } %>
-
- Time
- Server:
- Local:
-
-
-
-
FM-DX WebServer
by Noobish, kkonradpl & the OpenRadio community.
+
- <% if (device == 'tef') { %>
Device: TEF668x
<% } %>
- <% if (device == 'xdr') { %>
Device: Sony XDR
<% } %>
- <% if (device == 'sdr') { %>
Device: SDR
<% } %>
-
+
+
+ | Device: |
+
+ <% if (device == 'tef') { %>TEF668x<% } %>
+ <% if (device == 'xdr') { %>Sony XDR<% } %>
+ <% if (device == 'sdr') { %>SDR<% } %>
+ |
+
+
+ | Server Time: |
+ |
+
+
+ | Local Time: |
+ |
+
+
+
+
+
+ | P1: 87.5 |
+ P2: |
+ P3: |
+ P4: |
+
+
+
+
+
+ FM-DX Webserver
+
+
by Noobish, kkonradpl & the OpenRadio community.
[Receiver Map]
@@ -422,6 +444,7 @@
Owner contact:
<%= ownerContact %>
<% } %>
+
diff --git a/web/js/chat.js b/web/js/chat.js
index a2e5358..c076ef3 100644
--- a/web/js/chat.js
+++ b/web/js/chat.js
@@ -14,7 +14,7 @@ $(document).ready(function() {
const isAdmin = messageData.admin ? '[ADMIN]' : '';
if (messageData.type === 'clientIp') {
- chatIdentityNickname.html(isAdmin + " " + (savedNickname.length > 0 ? savedNickname : 'Anonymous User'));
+ chatIdentityNickname.html(isAdmin + " " + (savedNickname?.length > 0 ? savedNickname : 'Anonymous User'));
chatIdentityNickname.attr('title', messageData.ip);
} else {
const chatMessage = `
diff --git a/web/js/dropdown.js b/web/js/dropdown.js
index 0be1700..b4ac1ba 100644
--- a/web/js/dropdown.js
+++ b/web/js/dropdown.js
@@ -25,7 +25,12 @@ const selectOption = (event) => {
tuneTo(getCurrentFreq()); //Reset RDS when change antenna input
break;
case 'data-bw':
- socket.send("W" + $(event.currentTarget).attr('data-value'));
+ if($(event.currentTarget).attr('data-value') > 500) {
+ socket.send("F" + $(event.currentTarget).attr('data-value'));
+ } else {
+ socket.send("W" + $(event.currentTarget).attr('data-value'));
+ }
+
$currentDropdown.find('input').val($(event.currentTarget).text());
break;
default:
diff --git a/web/js/init.js b/web/js/init.js
index 80abd8c..beaaf40 100644
--- a/web/js/init.js
+++ b/web/js/init.js
@@ -1,9 +1,9 @@
-var currentDate = new Date('April 25, 2024 22:00:00');
+var currentDate = new Date('May 4, 2024 01: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.2.0 [' + formattedDate + ']';
+var currentVersion = 'v1.2.1 [' + formattedDate + ']';
getInitialSettings();
diff --git a/web/js/main.js b/web/js/main.js
index 36870fa..fb150f2 100644
--- a/web/js/main.js
+++ b/web/js/main.js
@@ -49,6 +49,7 @@ $(document).ready(function () {
// Start updating the canvas
initCanvas();
+ fillPresets();
signalToggle.on("change", function () {
const signalText = localStorage.getItem('signalUnit');
@@ -150,6 +151,10 @@ $(document).ready(function () {
toggleButtonState("ims");
});
+ $("#volumeSlider").on('mouseup', function() {
+ $('#volumeSlider').blur();
+ })
+
$(freqUpButton).on("click", tuneUp);
$(freqDownButton).on("click", tuneDown);
$(psContainer).on("click", copyPs);
@@ -421,11 +426,13 @@ function getCurrentFreq() {
function checkKey(e) {
e = e || window.event;
- if ($('#password:focus').length > 0 || $('#chat-send-message:focus').length > 0) {
+ if ($('#password:focus').length > 0
+ || $('#chat-send-message:focus').length > 0
+ || $('#volumeSlider:focus').length > 0
+ || $('#chat-nickname:focus').length > 0) {
return;
}
- $('#volumeSlider').blur();
getCurrentFreq();
if (socket.readyState === WebSocket.OPEN) {
@@ -893,3 +900,13 @@ function initTooltips() {
$('.tooltiptext').css({ top: posY, left: posX });
});
}
+
+function fillPresets() {
+ for (let i = 1; i <= 4; i++) {
+ let presetText = localStorage.getItem(`preset${i}`);
+ $(`#preset${i}`).text(presetText);
+ $(`#preset${i}`).click(function() {
+ tuneTo(Number(presetText));
+ });
+ }
+}
diff --git a/web/setup.ejs b/web/setup.ejs
index 4e7029d..c68a6bb 100644
--- a/web/setup.ejs
+++ b/web/setup.ejs
@@ -54,7 +54,7 @@
Current users
-