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

bugfixes & plugins WS & UI fixes

This commit is contained in:
NoobishSVK
2024-09-12 21:30:12 +02:00
parent 0fa3e85258
commit 51121132d5
12 changed files with 111 additions and 95 deletions

View File

@@ -1,9 +1,9 @@
var currentDate = new Date('Sep 11, 2024 23:50:00');
var currentDate = new Date('Sep 12, 2024 21:30: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.8 [' + formattedDate + ']';
var currentVersion = 'v1.2.8.1 [' + formattedDate + ']';
getInitialSettings();
removeUrlParameters(); // Call this function to remove URL parameters

View File

@@ -827,7 +827,8 @@ const updateDataElements = throttle(function(parsedData) {
updateTextIfChanged($('#data-station-itu'), parsedData.txInfo.itu);
updateTextIfChanged($('#data-station-pol'), parsedData.txInfo.pol);
updateTextIfChanged($('#data-station-distance'), parsedData.txInfo.dist);
updateTextIfChanged($('#data-station-azimuth'), parsedData.txInfo.azi);
updateHtmlIfChanged($('#data-station-azimuth'), parsedData.txInfo.azi + '°');
updateHtmlIfChanged($('#data-regular-pi'), parsedData.txInfo.reg === true ? parsedData.txInfo.pi : ' ');
$dataStationContainer.css('display', 'block');
} else {
$dataStationContainer.removeAttr('style');

View File

@@ -64,37 +64,8 @@ $(document).ready(function() {
$('#tuner-wireless').hide();
$('#tuner-usb').show();
}
});
$('#login-form').submit(function (event) {
event.preventDefault();
// Perform an AJAX request to the /login endpoint
$.ajax({
type: 'POST',
url: './login',
data: $(this).serialize(),
success: function (data) {
// Update the content on the page with the message from the response
$('#login-message').text(data.message);
setTimeout(function () {
location.reload(true);
}, 1750);
},
error: function (xhr, status, error) {
// Handle error response
if (xhr.status === 403) {
// Update the content on the page with the message from the error response
$('#login-message').text(xhr.responseJSON.message);
} else {
// Handle other types of errors if needed
console.error('Error:', status, error);
}
}
});
});
});
// Assuming you have an anchor tag with id 'logout-link'
$('.logout-link').click(function (event) {
event.preventDefault();