reapplying previous code changes

This commit is contained in:
MCHost
2025-06-26 18:07:51 -04:00
parent d9be0e61b4
commit 19d90de79a
4 changed files with 196 additions and 83 deletions

View File

@ -1763,7 +1763,6 @@ document.addEventListener('DOMContentLoaded', () => {
async function fetchServerProperties() {
try {
const key = `action-fetch-properties`;
const notification = showNotification('Fetching server properties...', 'loading', key);
const response = await wsRequest('/server-properties', 'GET');
if (response.error) {
updateNotification(notification, `Failed to load server properties: ${response.error}`, 'error', key);
@ -1779,7 +1778,6 @@ document.addEventListener('DOMContentLoaded', () => {
);
renderPropertiesFields(displayProperties);
elements.editPropertiesModal.classList.remove('hidden');
updateNotification(notification, 'Server properties loaded successfully', 'success', key);
} catch (error) {
console.error('Fetch server properties error:', error);
showNotification(`Failed to load server properties: ${error.message}`, 'error', 'fetch-properties-error');
@ -1789,7 +1787,6 @@ document.addEventListener('DOMContentLoaded', () => {
async function saveServerProperties() {
try {
const key = `action-save-properties`;
const notification = showNotification('Saving server properties...', 'loading', key);
const properties = {};
const inputs = elements.propertiesFields.querySelectorAll('input:not(#propertiesSearch):not([id="customPropertyKey"]):not([id="customPropertyValue"])');
@ -1813,7 +1810,6 @@ document.addEventListener('DOMContentLoaded', () => {
renderPropertiesList(displayProperties, '');
}
elements.editPropertiesModal.classList.add('hidden');
updateNotification(notification, 'Server properties saved successfully', 'success', key);
} catch (error) {
console.error('Save server properties error:', error);
showNotification(`Failed to save server properties: ${error.message}`, 'error', 'save-properties-error');
@ -1870,10 +1866,10 @@ document.addEventListener('DOMContentLoaded', () => {
}
async function connectSftp() {
if (!isSftpOnline) {
showNotification('SFTP is offline. Please try again later.', 'error', 'sftp-offline');
return;
}
// if (!isSftpOnline) {
// showNotification('SFTP is offline. Please try again later.', 'error', 'sftp-offline');
// return;
// }
if (!sftpCredentials) {
showNotification('SFTP credentials not available.', 'error', 'sftp-credentials');