Appease sonar

This commit is contained in:
amcmanu3 2023-09-04 21:14:03 -04:00
parent 6158ea85b5
commit 9b7d0d83b5
5 changed files with 14 additions and 18 deletions

View File

@ -20,11 +20,9 @@ function getDirView(event = false) {
console.log("Well that failed"); console.log("Well that failed");
} }
} else if ($("#root_files_button").hasClass("clicked")) { } else if ($("#root_files_button").hasClass("clicked")) {
path = $("#zip_server_path").val(); getTreeView($("#zip_server_path").val(), true);
getTreeView(path, true);
} else { } else {
path = $("#file-uploaded").val(); getTreeView($("#file-uploaded").val(), true, true);
getTreeView(path, true, true);
} }
} }

View File

@ -98,8 +98,8 @@
function updateAnnouncements(data) { function updateAnnouncements(data) {
console.log(data) console.log(data)
let text = ""; let text = "";
for (let i = 0; i < data.length; i++) { for (let value of data) {
text += `<li class="card-header header-sm justify-content-between align-items-center" id="${data[i].id}"><p style="float: right;"><i data-id="${data[i].id}"class="clear-button fa-regular fa-x"></i></p><a style="color: var(--purple);" href=${data[i].link} target="_blank"><h6>${data[i].title}</h6><small><p>${data[i].date}</p></small><p>${data[i].desc}</p></li></a>` text += `<li class="card-header header-sm justify-content-between align-items-center" id="${value.id}"><p style="float: right;"><i data-id="${value.id}"class="clear-button fa-regular fa-x"></i></p><a style="color: var(--purple);" href=${value.link} target="_blank"><h6>${value.title}</h6><small><p>${value.date}</p></small><p>${value.desc}</p></li></a>`
} }
if (data.length > 0) { if (data.length > 0) {
localStorage.setItem("notif-count", data.length); localStorage.setItem("notif-count", data.length);

View File

@ -201,8 +201,8 @@
let responseData = await res.json(); let responseData = await res.json();
let html = `` let html = ``
if (responseData.status === "ok") { if (responseData.status === "ok") {
for (let i = 0; i < responseData.data.length; i++) { for (let value of responseData.data) {
html += `<span class='box'>${responseData.data[i]}<br /></span>` html += `<span class='box'>${value}<br /></span>`
} }
console.log('Got Log From Server') console.log('Got Log From Server')
$('#virt_console').html(html); $('#virt_console').html(html);

View File

@ -240,8 +240,8 @@
let responseData = await res.json(); let responseData = await res.json();
let html = `` let html = ``
if (responseData.status === "ok") { if (responseData.status === "ok") {
for (let i = 0; i < responseData.data.length; i++) { for (let value of responseData.data) {
html += `<span class='box'>${responseData.data[i]}<br /></span>` html += `<span class='box'>${value}<br /></span>`
} }
console.log('Got Log From Server') console.log('Got Log From Server')
$('#virt_console').html(html); $('#virt_console').html(html);
@ -385,7 +385,6 @@
} }
$(document).ready(() => { $(document).ready(() => {
let scrolled = false;
$('#virt_console').on('scroll', chkScroll); $('#virt_console').on('scroll', chkScroll);
$('#to-bottom').on('click', scrollToBottom) $('#to-bottom').on('click', scrollToBottom)
}); });

View File

@ -890,7 +890,6 @@
window.location.reload(); window.location.reload();
} }
}); });
let doUpload = false;
} }
}, false); }, false);
xmlHttpRequest.addEventListener('error', (e) => { xmlHttpRequest.addEventListener('error', (e) => {
@ -1198,7 +1197,7 @@
let idx = document.getElementById('server_type').selectedIndex; let idx = document.getElementById('server_type').selectedIndex;
// get the value of the selected option // get the value of the selected option
let cSelect = document.getElementById("server"); let cSelect = document.getElementById("server");
let which; let which = {};
try { try {
which = document.getElementById('server_type').options[idx].value; which = document.getElementById('server_type').options[idx].value;
} catch { } catch {
@ -1234,10 +1233,10 @@
} }
function serverJarChange(selectObj) { function serverJarChange(selectObj) {
let type_select = document.getElementById('server_jar') const type_select = document.getElementById('server_jar')
let tidx = type_select.selectedIndex; const tidx = type_select.selectedIndex;
let val = type_select.options[tidx].value; const val = type_select.options[tidx].value;
let jcSelect = ""; let jcSelect = {};
if (val == 'None') { if (val == 'None') {
jcSelect = document.getElementById("server_type"); jcSelect = document.getElementById("server_type");
while (jcSelect.options.length > 0) { while (jcSelect.options.length > 0) {
@ -1251,7 +1250,7 @@
// get the value of the selected option // get the value of the selected option
let jwhich = selectObj.options[jidx].value; let jwhich = selectObj.options[jidx].value;
// use the selected option value to retrieve the list of items from the serverTypesLists array // use the selected option value to retrieve the list of items from the serverTypesLists array
jcList = Object.keys(serverTypesLists[jwhich]); let jcList = Object.keys(serverTypesLists[jwhich]);
// get the country select element via its known id // get the country select element via its known id
jcSelect = document.getElementById("server_type"); jcSelect = document.getElementById("server_type");
// remove the current options from the country select // remove the current options from the country select