1
0
mirror of https://github.com/KubaPro010/fm-dx-webserver.git synced 2026-02-27 06:23:53 +01:00

Merge branch 'NoobishSVK:main' into main

This commit is contained in:
Adam Wisher
2024-02-07 16:45:49 +00:00
committed by GitHub
10 changed files with 132 additions and 21 deletions

View File

@@ -64,6 +64,10 @@ label {
display: none;
}
#data-station-name {
font-size: 20px;
}
.form-group {
float: left;
margin-bottom: 10px;
@@ -71,7 +75,7 @@ label {
margin-right: 5px;
}
#settings, #back-btn {
#settings, #back-btn, #users-online-container {
background: transparent;
border: 0;
color: white;
@@ -88,10 +92,14 @@ label {
cursor: pointer;
}
#settings:hover, #back-btn:hover {
#settings:hover, #back-btn:hover, #users-online-container:hover {
background: var(--color-3);
}
#users-online-container {
top: 80px;
}
#back-btn {
left: 15px;
right: auto;
@@ -115,6 +123,10 @@ label {
display: none;
}
#login-form {
padding: 5px;
}
.checkbox input[type="checkbox"] {
padding: 0;
height: initial;

View File

@@ -84,6 +84,13 @@ input[type="range"] {
background: transparent;
}
input[type="range"]::after {
width: 100px;
height: 100px;
background: blue;
}
/* Track: Mozilla Firefox */
input[type="range"]::-moz-range-track {
height: 48px;

View File

@@ -157,6 +157,10 @@
background-color: var(--color-2) !important;
}
.pointer {
cursor: pointer;
}
@media only screen and (max-width: 960px) {
.text-medium-big {
font-size: 32px;

View File

@@ -49,7 +49,8 @@
<audio id="audioTag"></audio>
<div id="wrapper">
<div class="panel-100 no-bg tuner-info">
<h1 id="tuner-name"><%= tunerName %> <% if (tunerLock) { %><i class="fa-solid fa-lock" title="Tuner is currently locked to admin."></i><% } %></h1>
<h1 id="tuner-name"><%= tunerName %> <% if (!publicTuner) { %><i class="fa-solid fa-key pointer" title="Only people with tune password can tune."></i>
<% } else if (tunerLock) { %><i class="fa-solid fa-lock pointer" title="Tuner is currently locked to admin."></i><% } %></h1>
<p id="tuner-desc"><%= tunerDesc %></p>
<div style="clear: both"></div>
</div>
@@ -192,7 +193,8 @@
</div>
<button id="settings" aria-label="Settings"><i class="fa-solid fa-gear"></i></button>
<button id="users-online-container" class="hide-phone" aria-label="Online users"><i class="fa-solid fa-user"></i> <span class="users-online"></span></button>
<div id="myModal" class="modal">
<div class="modal-content">
<span class="modal-title">Settings</span>
@@ -227,9 +229,9 @@
</div>
</div>
<div class="form-group bottom-20" style="float: none;">
<div class="form-group bottom-20 hide-desktop" style="float: none;">
<label for="themes"><i class="fa-solid fa-user"></i> Users online:</label>
<span id="users-online" name="users-online">0</span>
<span class="users-online" name="users-online">0</span>
</div>
<% if (isAdminAuthenticated) { %>
@@ -251,7 +253,7 @@
<div class="flex-container flex-left text-left bottom-20 hover-brighten p-10 br-5" onclick="window.open('https://buymeacoffee.com/noobish')">
<i class="fa-solid fa-hand-holding-medical"></i>&nbsp;<span><strong>Support</strong> the developer!</span>
</div>
<p class="text-small">FM-DX WebServer <span style="color: var(--color-3);">v1.0.1 [5/2/2024]</span> by <a href="https://noobish.eu" target="_blank">Noobish</a> & the OpenRadio community.</p>
<p class="text-small">FM-DX WebServer <span style="color: var(--color-3);">v1.0.2 [6/2/2024]</span> by <a href="https://noobish.eu" target="_blank">Noobish</a> & the OpenRadio community.</p>
<p class="text-small bottom-50">This app works thanks to these amazing projects: <br>
<span class="text-smaller">- librdsparser & maps.fmdx.pl by <a href="https://fmdx.pl" target="_blank">Konrad Kosmatka</a></span><br>
<span class="text-smaller">- 3LAS by <a href="https://github.com/JoJoBond/3LAS" target="_blank">JoJoBond</a></span><br>

View File

@@ -478,6 +478,7 @@ function updateSignalUnits(parsedData) {
function updateDataElements(parsedData) {
$('#data-frequency').text(parsedData.freq);
$("#commandinput").attr("aria-label", "Current frequency: " + parsedData.freq);
$('#data-pi').html(parsedData.pi === '?' ? "<span class='opacity-half'>?</span>" : parsedData.pi);
$('#data-ps').html(parsedData.ps === '?' ? "<span class='opacity-half'>?</span>" : processString(parsedData.ps, parsedData.ps_errors));
$('.data-tp').html(parsedData.tp === false ? "<span class='opacity-half'>TP</span>" : "TP");
@@ -554,7 +555,7 @@ function updatePanels(parsedData) {
// Update other elements every time
updateDataElements(parsedData);
updateSignalUnits(parsedData);
$('#users-online').text(parsedData.users);
$('.users-online').text(parsedData.users);
}
function createListItem(element) {

View File

@@ -147,9 +147,22 @@
<div id="login-message"></div>
</div>
</div>
<div class="panel-100 p-bottom-20">
<h2>CONSOLE OUTPUT</h2>
<% if (consoleOutput && consoleOutput.length > 0) { %>
<div class="panel-100 br-5 p-10 text-small text-left top-10" id="console-output" style="background-color: var(--color-main);height: 300px;overflow-y:auto;">
<% consoleOutput.forEach(function(log) { %>
<pre class="m-0" style="white-space:pre-wrap;"><%= log %></pre>
<% }); %>
</div>
<% } else { %>
<p>No console output available.</p>
<% } %>
</div>
<div class="panel-100 no-bg">
<p>Feel free to contact us on <a href="https://discord.gg/ZAVNdS74mC" target="_blank"><strong><i class="fa-brands fa-discord"></i> Discord</strong></a> for community support.</p>
</div>
<button onclick="document.location.href='./'" id="back-btn" aria-label="Go back to tuning"><i class="fa-solid fa-arrow-left"></i></button>
<% } else { %>
<div class="panel-100 no-bg">
@@ -168,6 +181,34 @@
</div>
<% } %>
</div>
<script>
$(document).ready(function() {
function stripAnsi(str) {
return str.replace(/\u001b\[\d+m/g, '');
}
$("pre").html(function(_, html) {
html = stripAnsi(html);
return html.replace(/\[(\d{2}:\d{2})\]|\[(INFO|DEBUG|WARN|ERROR)\]/g, function(match, time, level) {
if (time) {
return "<span style='color: gray;'>" + match + "</span>";
} else if (level === "INFO") {
return "<span style='color: lime;'>" + match + "</span>";
} else if (level === "DEBUG") {
return "<span style='color: cyan;'>" + match + "</span>";
} else if (level === "WARN") {
return "<span style='color: yellow;'>" + match + "</span>";
} else if (level === "ERROR") {
return "<span style='color: red;'>" + match + "</span>";
} else {
return "<span style='color: white;'>" + match + "</span>";
}
});
});
$("#console-output").scrollTop($("#console-output")[0].scrollHeight);
});
</script>
<script src="js/settings.js"></script>
<script src="js/dropdown.js"></script>
<script src="js/setup.js"></script>