You've already forked fm-dx-webserver
mirror of
https://github.com/KubaPro010/fm-dx-webserver.git
synced 2026-02-26 22:13:53 +01:00
bugfixes, design changes
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "fm-dx-webserver",
|
||||
"version": "1.2.0",
|
||||
"version": "1.2.1",
|
||||
"description": "FM DX Webserver",
|
||||
"main": "index.js",
|
||||
"scripts": {
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -190,6 +190,10 @@
|
||||
padding: 10px;
|
||||
}
|
||||
|
||||
.p-left-10 {
|
||||
padding-left: 10px;
|
||||
}
|
||||
|
||||
.p-bottom-20 {
|
||||
padding-bottom: 20px;
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
101
web/index.ejs
101
web/index.ejs
@@ -188,35 +188,35 @@
|
||||
<input type="text" placeholder="Auto BW" readonly>
|
||||
<ul class="options open-top">
|
||||
<li data-vlaue="0" class="option">Auto</li>
|
||||
<li data-value="9000" class="option">9 KHz</li>
|
||||
<li data-value="15000" class="option">15 KHz</li>
|
||||
<li data-value="17000" class="option">17 KHz</li>
|
||||
<li data-value="20000" class="option">20 KHz</li>
|
||||
<li data-value="24000" class="option">24 KHz</li>
|
||||
<li data-value="27000" class="option">27 KHz</li>
|
||||
<li data-value="32000" class="option">32 KHz</li>
|
||||
<li data-value="36000" class="option">36 KHz</li>
|
||||
<li data-value="42000" class="option">42 KHz</li>
|
||||
<li data-value="48000" class="option">48 KHz</li>
|
||||
<li data-value="55000" class="option">55 KHz</li>
|
||||
<li data-value="63000" class="option">63 KHz</li>
|
||||
<li data-value="73000" class="option">73 KHz</li>
|
||||
<li data-value="83000" class="option">83 KHz</li>
|
||||
<li data-value="90000" class="option">90 KHz</li>
|
||||
<li data-value="95000" class="option">95 KHz</li>
|
||||
<li data-value="108000" class="option">108 KHz</li>
|
||||
<li data-value="125000" class="option">125 KHz</li>
|
||||
<li data-value="142000" class="option">142 KHz</li>
|
||||
<li data-value="159000" class="option">159 KHz</li>
|
||||
<li data-value="177000" class="option">177 KHz</li>
|
||||
<li data-value="194000" class="option">194 KHz</li>
|
||||
<li data-value="211000" class="option">211 KHz</li>
|
||||
<li data-value="229000" class="option">229 KHz</li>
|
||||
<li data-value="246000" class="option">246 KHz</li>
|
||||
<li data-value="263000" class="option">263 KHz</li>
|
||||
<li data-value="281000" class="option">281 KHz</li>
|
||||
<li data-value="298000" class="option">298 KHz</li>
|
||||
<li data-value="309000" class="option">309 KHz</li>
|
||||
<li data-value="1" class="option">9 KHz</li>
|
||||
<li data-value="2" class="option">15 KHz</li>
|
||||
<li data-value="3" class="option">17 KHz</li>
|
||||
<li data-value="4" class="option">20 KHz</li>
|
||||
<li data-value="5" class="option">24 KHz</li>
|
||||
<li data-value="6" class="option">27 KHz</li>
|
||||
<li data-value="7" class="option">32 KHz</li>
|
||||
<li data-value="8" class="option">36 KHz</li>
|
||||
<li data-value="9" class="option">42 KHz</li>
|
||||
<li data-value="10" class="option">48 KHz</li>
|
||||
<li data-value="11" class="option">55 KHz</li>
|
||||
<li data-value="12" class="option">63 KHz</li>
|
||||
<li data-value="13" class="option">73 KHz</li>
|
||||
<li data-value="14" class="option">83 KHz</li>
|
||||
<li data-value="15" class="option">90 KHz</li>
|
||||
<li data-value="16" class="option">95 KHz</li>
|
||||
<li data-value="17" class="option">108 KHz</li>
|
||||
<li data-value="18" class="option">125 KHz</li>
|
||||
<li data-value="19" class="option">142 KHz</li>
|
||||
<li data-value="20" class="option">159 KHz</li>
|
||||
<li data-value="21" class="option">177 KHz</li>
|
||||
<li data-value="22" class="option">194 KHz</li>
|
||||
<li data-value="23" class="option">211 KHz</li>
|
||||
<li data-value="24" class="option">229 KHz</li>
|
||||
<li data-value="25" class="option">246 KHz</li>
|
||||
<li data-value="26" class="option">263 KHz</li>
|
||||
<li data-value="27" class="option">281 KHz</li>
|
||||
<li data-value="28" class="option">298 KHz</li>
|
||||
<li data-value="29" class="option">309 KHz</li>
|
||||
</ul>
|
||||
</div>
|
||||
<% } %>
|
||||
@@ -402,19 +402,41 @@
|
||||
<% } %>
|
||||
<div id="login-message"></div>
|
||||
|
||||
<h2>Time</h2>
|
||||
<p class="m-0">Server: <span class="color-3" id="server-time"></span></p>
|
||||
<p class="m-0">Local: <span class="color-3" id="client-time"></span></p>
|
||||
<hr class="color-2 auto">
|
||||
|
||||
<p class="text-small" id="current-ping"></p>
|
||||
<table class="auto text-left p-10">
|
||||
<tr>
|
||||
<td>Device:</td>
|
||||
<td class="color-3 p-left-10">
|
||||
<% if (device == 'tef') { %>TEF668x<% } %>
|
||||
<% if (device == 'xdr') { %>Sony XDR<% } %>
|
||||
<% if (device == 'sdr') { %>SDR<% } %>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Server Time:</td>
|
||||
<td class="color-3 p-left-10" id="server-time"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Local Time:</td>
|
||||
<td class="color-3 p-left-10" id="client-time"></td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<table class="auto">
|
||||
<tr>
|
||||
<td class="p-left-10">P1: <a class="color-3 pointer" id="preset1">87.5</a></td>
|
||||
<td class="p-left-10">P2: <a class="color-3 pointer" id="preset2"></a></td>
|
||||
<td class="p-left-10">P3: <a class="color-3 pointer" id="preset3"></a></td>
|
||||
<td class="p-left-10">P4: <a class="color-3 pointer" id="preset4"></a></td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<div class="version-info">
|
||||
<p class="text-small">FM-DX WebServer <br>by <a href="https://noobish.eu" target="_blank">Noobish</a>, <a href="https://fmdx.pl" target="_blank">kkonradpl</a> & the OpenRadio community.</p>
|
||||
|
||||
<% if (device == 'tef') { %><p class="m-0">Device: TEF668x</p> <% } %>
|
||||
<% if (device == 'xdr') { %><p class="m-0">Device: Sony XDR</p> <% } %>
|
||||
<% if (device == 'sdr') { %><p class="m-0">Device: SDR</p> <% } %>
|
||||
<span style="color: var(--color-3);" class="version-string"></span><br>
|
||||
<p class="m-0">
|
||||
FM-DX Webserver <span style="color: var(--color-3);" class="version-string"></span>
|
||||
</p>
|
||||
<p class="text-small m-0 color-3">by <a href="https://noobish.eu" target="_blank">Noobish</a>, <a href="https://fmdx.pl" target="_blank">kkonradpl</a> & the OpenRadio community.</p>
|
||||
<span class="text-small" style="color: var(--color-3);">[<a href="https://list.fmdx.pl" target="_blank">Receiver Map</a>]</span>
|
||||
<br>
|
||||
<br>
|
||||
@@ -422,6 +444,7 @@
|
||||
<span>Owner contact:</span><br>
|
||||
<span class="text-small m-0 bottom-20"><%= ownerContact %></span>
|
||||
<% } %>
|
||||
<p class="text-small color-3" id="current-ping"></p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -14,7 +14,7 @@ $(document).ready(function() {
|
||||
const isAdmin = messageData.admin ? '<span style="color: #bada55">[ADMIN]</span>' : '';
|
||||
|
||||
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 = `
|
||||
|
||||
@@ -25,7 +25,12 @@ const selectOption = (event) => {
|
||||
tuneTo(getCurrentFreq()); //Reset RDS when change antenna input
|
||||
break;
|
||||
case 'data-bw':
|
||||
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:
|
||||
|
||||
@@ -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();
|
||||
|
||||
|
||||
@@ -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));
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@@ -54,7 +54,7 @@
|
||||
</div>
|
||||
|
||||
<h3>Current users</h3>
|
||||
<table>
|
||||
<table class="table-big">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>IP Address</th>
|
||||
@@ -131,8 +131,8 @@
|
||||
<input id="connection-type-toggle" type="checkbox"/>
|
||||
<a></a>
|
||||
<span>
|
||||
<span class="left-span">USB Cable</span>
|
||||
<span class="right-span">Wireless</span>
|
||||
<span class="left-span">Direct</span>
|
||||
<span class="right-span">TCP/IP</span>
|
||||
</span>
|
||||
</label>
|
||||
</div>
|
||||
|
||||
@@ -72,8 +72,8 @@
|
||||
<input id="connection-type-toggle" type="checkbox"/>
|
||||
<a></a>
|
||||
<span>
|
||||
<span class="left-span">USB Cable</span>
|
||||
<span class="right-span">Wireless</span>
|
||||
<span class="left-span">Direct</span>
|
||||
<span class="right-span">TCP/IP</span>
|
||||
</span>
|
||||
</label>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user