user kick, plugins, bugfixes

This commit is contained in:
NoobishSVK
2024-04-25 20:41:05 +02:00
parent 981c0f25e2
commit 510ed6b8f3
15 changed files with 152 additions and 46 deletions
+18 -1
View File
@@ -11,6 +11,7 @@ function submitData() {
const defaultTheme = themeDataValue;
const bgImage = $("#bg-image").val() || '';
const rdsMode = $('#rds-mode').is(":checked") || false;
const ant1enabled = $('#ant1-enabled').is(":checked") || false;
const ant2enabled = $('#ant2-enabled').is(":checked") || false;
@@ -71,6 +72,11 @@ function submitData() {
const tunePass = $('#tune-pass').val();
const adminPass = $('#admin-pass').val();
let plugins = [];
$('#plugin-list option:selected').each(function() {
plugins.push($(this).data('name'));
});
const publicTuner = $("#tuner-public").is(":checked");
const lockToAdmin = $("#tuner-lock").is(":checked");
const autoShutdown = $("#shutdown-tuner").is(":checked") || false;
@@ -88,7 +94,8 @@ function submitData() {
defaultTheme,
presets,
banlist,
bgImage
bgImage,
rdsMode,
},
antennas: {
enabled: antennasEnabled,
@@ -136,6 +143,7 @@ function submitData() {
tunePass,
adminPass,
},
plugins,
device,
publicTuner,
lockToAdmin,
@@ -181,6 +189,7 @@ function submitData() {
$("#chat-switch").prop("checked", data.webserver.chatEnabled || false);
$('#selected-theme').val(data.webserver.defaultTheme || 'Default');
$('#rds-mode').prop("checked", data.webserver.rdsMode || false);
var selectedTheme = $(".option[data-value='" + data.webserver.defaultTheme + "']");
@@ -273,6 +282,14 @@ function submitData() {
$("#shutdown-tuner").prop("checked", data.autoShutdown);
$("#antenna-switch").prop("checked", data.antennas?.enabled);
data.plugins.forEach(function(name) {
// Find the option with the corresponding data-name attribute and mark it as selected
$('#plugin-list option[data-name="' + name + '"]').prop('selected', true);
});
// Update the multi-select element to reflect the changes
$('#plugin-list').trigger('change');
// Check if latitude and longitude are present in the data
if (data.identification.lat && data.identification.lon) {
// Set the map's center to the received coordinates