Update TGBeta.ps1

This commit is contained in:
2025-01-28 01:38:35 -05:00
parent b7ed0d2563
commit c5c23674f6

View File

@@ -931,10 +931,10 @@ function GetHtmlContent {
<p>Logs will appear here...</p> <p>Logs will appear here...</p>
</div> </div>
</div> </div>
<script> <script>
function toggleOnboardCheckboxes(selectedCheckbox) {
const checkboxes = document.querySelectorAll('#onboardTab input[type="checkbox"]'); // Central function to handle DattoRMM visibility
function toggleDattoRMMVisibility() {
const dattoRMMCheckbox = document.getElementById('installDattoRMMCheckbox'); const dattoRMMCheckbox = document.getElementById('installDattoRMMCheckbox');
const optionsContainer = document.getElementById('dattoRMMOptionsContainer'); const optionsContainer = document.getElementById('dattoRMMOptionsContainer');
const n8nPasswordContainer = document.getElementById('n8nPasswordContainer'); const n8nPasswordContainer = document.getElementById('n8nPasswordContainer');
@@ -951,49 +951,42 @@ function GetHtmlContent {
} }
} }
// Function to update "Select All" checkbox state
function updateSelectAllCheckbox(selectAllId, checkboxGroupSelector) { function updateSelectAllCheckbox(selectAllId, checkboxGroupSelector) {
const selectAllCheckbox = document.getElementById(selectAllId); const selectAllCheckbox = document.getElementById(selectAllId);
const checkboxes = document.querySelectorAll(checkboxGroupSelector); const checkboxes = document.querySelectorAll(checkboxGroupSelector);
// If any checkbox is unchecked, uncheck "Select All" // Uncheck "Select All" if any checkbox is unchecked
selectAllCheckbox.checked = Array.from(checkboxes).every(checkbox => checkbox.checked); selectAllCheckbox.checked = Array.from(checkboxes).every(checkbox => checkbox.checked);
} }
// Function to handle "Select All" logic for the left column
function toggleLeftColumnCheckboxes(selectAllCheckbox) { function toggleLeftColumnCheckboxes(selectAllCheckbox) {
const leftCheckboxes = document.querySelectorAll('#leftColumn input[type="checkbox"]:not(#selectAllLeftCheckbox)'); const leftCheckboxes = document.querySelectorAll('#leftColumn input[type="checkbox"]:not(#selectAllLeftCheckbox)');
const dattoRMMCheckbox = document.getElementById('installDattoRMMCheckbox');
const optionsContainer = document.getElementById('dattoRMMOptionsContainer');
const n8nPasswordContainer = document.getElementById('n8nPasswordContainer');
const dattoRMMContainer = document.getElementById('DattoRMMContainer');
// Toggle all checkboxes // Toggle all checkboxes
leftCheckboxes.forEach(checkbox => { leftCheckboxes.forEach(checkbox => {
checkbox.checked = selectAllCheckbox.checked; checkbox.checked = selectAllCheckbox.checked;
}); });
// Check if "Install DattoRMM" is selected // Handle DattoRMM visibility
if (dattoRMMCheckbox.checked) { toggleDattoRMMVisibility();
optionsContainer.style.display = 'block';
n8nPasswordContainer.style.display = 'block';
dattoRMMContainer.style.display = 'block';
} else {
optionsContainer.style.display = 'none';
n8nPasswordContainer.style.display = 'none';
dattoRMMContainer.style.display = 'none';
}
} }
// Function to handle checkbox changes in the Onboard tab
function toggleOnboardCheckboxes(selectedCheckbox) {
// Update DattoRMM visibility
toggleDattoRMMVisibility();
function gatherSelectedTasks() { // Update "Select All" checkbox state
const selectedLeftTasks = Array.from(document.querySelectorAll('.left-checkbox:checked')).map(checkbox => checkbox.name); updateSelectAllCheckbox('selectAllLeftCheckbox', '#onboardTab input[type="checkbox"]:not(#selectAllLeftCheckbox)');
const selectedRightTasks = Array.from(document.querySelectorAll('.right-checkbox:checked')).map(checkbox => checkbox.name);
return [...selectedLeftTasks, ...selectedRightTasks];
} }
// Attach event listeners to dynamically update the "Select All" checkbox
// Attach the updateSelectAllonboard function to all individual checkboxes document.querySelectorAll('#onboardTab input[type="checkbox"]:not(#selectAllLeftCheckbox)').forEach(checkbox => {
document.querySelectorAll('#onboardTab input[type="checkbox"]:not(#selectAllOnboardCheckbox)').forEach(checkbox => { checkbox.addEventListener('change', () => {
checkbox.addEventListener('change', updateSelectAllonboard); updateSelectAllCheckbox('selectAllLeftCheckbox', '#onboardTab input[type="checkbox"]:not(#selectAllLeftCheckbox)');
});
}); });
function toggleOffboardCheckboxes(selectAllCheckbox) { function toggleOffboardCheckboxes(selectAllCheckbox) {