attempted to install-dattormm

This commit is contained in:
2025-07-09 17:16:19 -04:00
parent 5d8e3263c6
commit 70c14a0ec2

View File

@@ -870,22 +870,14 @@ catch (e) {
}
}
async function triggerInstall() {
// disable the button so you can't double-click while work is in flight
const runBtn = document.querySelector('.run-button');
runBtn.disabled = true;
try {
for (const t of tasks) {
const cb = document.getElementById(t.id);
if (!cb || !cb.checked) continue;
if (t.id === 'installDattoRMM') {
// 1. If installDattoRMM is selected, run it first
const dattoCB = document.getElementById('installDattoRMM');
if (dattoCB && dattoCB.checked) {
const sub = Array.from(
document.querySelectorAll('.sub-option-installDattoRMM:checked')
).map(x => x.value);
@@ -902,21 +894,25 @@ async function triggerInstall() {
Name: name
})
});
} else {
await fetch(t.handler, { method: 'GET' });
}
// 2. Now run everything else
for (const t of tasks) {
if (t.id === 'installDattoRMM') continue;
const cb = document.getElementById(t.id);
if (!cb || !cb.checked) continue;
await fetch(t.handler, { method: 'GET' });
}
} catch (e) {
console.error('Error during triggerInstall:', e);
} finally {
// always re-enable, even if an error occurred
runBtn.disabled = false;
}
}
// =======================================================================
// Shutdown Handler
// =======================================================================