Update TGBeta.ps1
This commit is contained in:
105
TGBeta.ps1
105
TGBeta.ps1
@@ -931,71 +931,64 @@ function GetHtmlContent {
|
|||||||
<p>Logs will appear here...</p>
|
<p>Logs will appear here...</p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<script>
|
||||||
|
|
||||||
<script>
|
// Central function to handle DattoRMM visibility
|
||||||
function toggleOnboardCheckboxes(selectedCheckbox) {
|
function toggleDattoRMMVisibility() {
|
||||||
const checkboxes = document.querySelectorAll('#onboardTab input[type="checkbox"]');
|
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');
|
const dattoRMMContainer = document.getElementById('DattoRMMContainer');
|
||||||
const dattoRMMContainer = document.getElementById('DattoRMMContainer');
|
|
||||||
|
|
||||||
if (dattoRMMCheckbox.checked) {
|
if (dattoRMMCheckbox.checked) {
|
||||||
optionsContainer.style.display = 'block';
|
optionsContainer.style.display = 'block';
|
||||||
n8nPasswordContainer.style.display = 'block';
|
n8nPasswordContainer.style.display = 'block';
|
||||||
dattoRMMContainer.style.display = 'block';
|
dattoRMMContainer.style.display = 'block';
|
||||||
} else {
|
} else {
|
||||||
optionsContainer.style.display = 'none';
|
optionsContainer.style.display = 'none';
|
||||||
n8nPasswordContainer.style.display = 'none';
|
n8nPasswordContainer.style.display = 'none';
|
||||||
dattoRMMContainer.style.display = 'none';
|
dattoRMMContainer.style.display = 'none';
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
function updateSelectAllCheckbox(selectAllId, checkboxGroupSelector) {
|
// Function to update "Select All" checkbox state
|
||||||
const selectAllCheckbox = document.getElementById(selectAllId);
|
function updateSelectAllCheckbox(selectAllId, checkboxGroupSelector) {
|
||||||
const checkboxes = document.querySelectorAll(checkboxGroupSelector);
|
const selectAllCheckbox = document.getElementById(selectAllId);
|
||||||
|
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 toggleLeftColumnCheckboxes(selectAllCheckbox) {
|
// Function to handle "Select All" logic for the left column
|
||||||
const leftCheckboxes = document.querySelectorAll('#leftColumn input[type="checkbox"]:not(#selectAllLeftCheckbox)');
|
function toggleLeftColumnCheckboxes(selectAllCheckbox) {
|
||||||
const dattoRMMCheckbox = document.getElementById('installDattoRMMCheckbox');
|
const leftCheckboxes = document.querySelectorAll('#leftColumn input[type="checkbox"]:not(#selectAllLeftCheckbox)');
|
||||||
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
|
|
||||||
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);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// 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) {
|
function toggleOffboardCheckboxes(selectAllCheckbox) {
|
||||||
const checkboxes = document.querySelectorAll('#offboardTab input[type="checkbox"]:not(#selectAllOffboardCheckbox)');
|
const checkboxes = document.querySelectorAll('#offboardTab input[type="checkbox"]:not(#selectAllOffboardCheckbox)');
|
||||||
checkboxes.forEach(checkbox => {
|
checkboxes.forEach(checkbox => {
|
||||||
|
|||||||
Reference in New Issue
Block a user