Update TGBeta.ps1

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

View File

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