Update TGBeta.ps1

This commit is contained in:
2025-01-07 02:11:55 -05:00
parent c34ae64236
commit b0b14eae94

View File

@@ -912,49 +912,7 @@ function GetHtmlContent {
}); });
function runSelectedTweaks() {
const tweaks = [];
const tweakCheckboxes = document.querySelectorAll('#tweaksTab input[type="checkbox"]:not(#selectAllTweaksCheckbox)');
// Collect selected tweaks
tweakCheckboxes.forEach((checkbox) => {
if (checkbox.checked) {
tweaks.push(checkbox.id); // Use checkbox IDs as identifiers
}
});
// Check if no tweaks are selected
if (tweaks.length === 0) {
appendLog("No tweaks selected. Please select at least one tweak to run.", "red");
return;
}
appendLog("Running selected tweaks...", "yellow");
// Prepare payload
const payload = JSON.stringify({ tweaks });
// Use fetch to call the backend
fetch('/runTweaks', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
},
body: payload,
})
.then((response) => {
if (!response.ok) {
throw new Error(`Failed to run tweaks. Status: ${response.status}`);
}
return response.text(); // Parse response as text
})
.then((result) => {
appendLog(result, "green");
})
.catch((error) => {
appendLog(`Error running tweaks: ${error.message}`, "red");
});
}