Update samy.js
This commit is contained in:
37
samy.js
37
samy.js
@@ -457,23 +457,28 @@ async function triggerInstall() {
|
|||||||
// 1. DattoRMM first
|
// 1. DattoRMM first
|
||||||
const dattoCB = document.getElementById("installDattoRMM");
|
const dattoCB = document.getElementById("installDattoRMM");
|
||||||
if (dattoCB && dattoCB.checked) {
|
if (dattoCB && dattoCB.checked) {
|
||||||
try {
|
const sub = Array.from(
|
||||||
const sub = Array.from(
|
document.querySelectorAll(".sub-option-installDattoRMM:checked")
|
||||||
document.querySelectorAll(".sub-option-installDattoRMM:checked")
|
).map((x) => x.value);
|
||||||
).map((x) => x.value);
|
const dropdown = document.getElementById("dattoDropdown");
|
||||||
const dropdown = document.getElementById("dattoDropdown");
|
const uid = dropdown?.value;
|
||||||
const uid = dropdown?.value;
|
const name = dropdown?.selectedOptions?.[0]?.text || "Datto";
|
||||||
const name = dropdown?.selectedOptions?.[0]?.text || "Datto";
|
|
||||||
|
|
||||||
await fetch("/installDattoRMM", {
|
if (!uid) {
|
||||||
method: "POST",
|
alert("Please select a Datto RMM site before running.");
|
||||||
headers: { "Content-Type": "application/json" },
|
logProgress("Install DattoRMM (no site selected)", false);
|
||||||
body: JSON.stringify({ checkedValues: sub, UID: uid, Name: name }),
|
} else {
|
||||||
});
|
try {
|
||||||
logProgress("Install DattoRMM", true);
|
await fetch("/installDattoRMM", {
|
||||||
} catch (e) {
|
method: "POST",
|
||||||
logProgress("Install DattoRMM", false);
|
headers: { "Content-Type": "application/json" },
|
||||||
console.error(e);
|
body: JSON.stringify({ checkedValues: sub, UID: uid, Name: name }),
|
||||||
|
});
|
||||||
|
logProgress("Install DattoRMM", true);
|
||||||
|
} catch (e) {
|
||||||
|
logProgress("Install DattoRMM", false);
|
||||||
|
console.error(e);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user