Update TGBeta.ps1
This commit is contained in:
38
TGBeta.ps1
38
TGBeta.ps1
@@ -822,7 +822,7 @@ function GetHtmlContent {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
async function triggerInstall() {
|
function triggerInstall() {
|
||||||
const dropdown = document.getElementById('dattoRmmDropdown');
|
const dropdown = document.getElementById('dattoRmmDropdown');
|
||||||
const UID = dropdown.options[dropdown.selectedIndex].value;
|
const UID = dropdown.options[dropdown.selectedIndex].value;
|
||||||
const Name = dropdown.options[dropdown.selectedIndex].text;
|
const Name = dropdown.options[dropdown.selectedIndex].text;
|
||||||
@@ -837,20 +837,10 @@ function GetHtmlContent {
|
|||||||
const installThreatLocker = document.querySelector('input[name="installThreatLocker"]');
|
const installThreatLocker = document.querySelector('input[name="installThreatLocker"]');
|
||||||
const installRocketCyber = document.querySelector('input[name="installRocketCyber"]');
|
const installRocketCyber = document.querySelector('input[name="installRocketCyber"]');
|
||||||
|
|
||||||
async function executeFetch(url, options = {}) {
|
|
||||||
try {
|
|
||||||
appendLog(`Starting ${url}...`, "cyan");
|
|
||||||
const response = await fetch(url, options);
|
|
||||||
if (!response.ok) throw new Error(`Failed at ${url}: ${response.statusText}`);
|
|
||||||
appendLog(`${url} completed successfully.`, "green");
|
|
||||||
} catch (error) {
|
|
||||||
appendLog(`Error: ${error.message}`, "red");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Priority 1: Install SVSMSP Module
|
// Priority 1: Install SVSMSP Module
|
||||||
if (installSVSMSPModule.checked) {
|
if (installSVSMSPModule.checked) {
|
||||||
await executeFetch('/installSVSMSPModule', { method: 'GET' });
|
appendLog("Installing SVSMSP Module (Priority 1)...", "cyan");
|
||||||
|
fetch('/installSVSMSPModule', { method: 'GET' })
|
||||||
}
|
}
|
||||||
|
|
||||||
// Priority 2: Install DattoRMM
|
// Priority 2: Install DattoRMM
|
||||||
@@ -859,49 +849,49 @@ function GetHtmlContent {
|
|||||||
appendLog("Installing selected site RMM (Priority 2)...", "cyan");
|
appendLog("Installing selected site RMM (Priority 2)...", "cyan");
|
||||||
|
|
||||||
const checkedValues = Array.from(DattoRMMCheckbox).map(c => c.value);
|
const checkedValues = Array.from(DattoRMMCheckbox).map(c => c.value);
|
||||||
|
|
||||||
const payload = {
|
const payload = {
|
||||||
checkedValues, // Array of selected checkbox values
|
checkedValues, // Array of selected checkbox values
|
||||||
UID, // Selected site UID
|
UID, // Selected site UID
|
||||||
Name // Selected site name
|
Name // Selected site name
|
||||||
};
|
};
|
||||||
|
|
||||||
await executeFetch('/installrmm', {
|
fetch('/installrmm', {
|
||||||
method: 'POST',
|
method: 'POST',
|
||||||
headers: { 'Content-Type': 'application/json' },
|
headers: { 'Content-Type': 'application/json' },
|
||||||
body: JSON.stringify(payload)
|
body: JSON.stringify(payload)
|
||||||
});
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
// Lower-priority tasks
|
// Lower-priority tasks
|
||||||
if (setSVSPowerplan.checked) {
|
if (setSVSPowerplan.checked) {
|
||||||
await executeFetch('/SetSVSPowerplan', { method: 'GET' });
|
fetch('/SetSVSPowerplan', { method: 'GET' })
|
||||||
}
|
}
|
||||||
|
|
||||||
if (installCyberQP.checked) {
|
if (installCyberQP.checked) {
|
||||||
await executeFetch('/installCyberQP', { method: 'GET' });
|
fetch('/installCyberQP', { method: 'GET' })
|
||||||
}
|
}
|
||||||
|
|
||||||
if (installSplashtop.checked) {
|
if (installSplashtop.checked) {
|
||||||
await executeFetch('/installSplashtop', { method: 'GET' });
|
fetch('/installSplashtop', { method: 'GET' })
|
||||||
}
|
}
|
||||||
|
|
||||||
if (installSVSHelpDesk.checked) {
|
if (installSVSHelpDesk.checked) {
|
||||||
await executeFetch('/installSVSHelpDesk', { method: 'GET' });
|
fetch('/installSVSHelpDesk', { method: 'GET' })
|
||||||
}
|
}
|
||||||
|
|
||||||
if (installSVSWatchtower.checked) {
|
if (installSVSWatchtower.checked) {
|
||||||
await executeFetch('/installSVSWatchtower', { method: 'GET' });
|
fetch('/installSVSWatchtower', { method: 'GET' })
|
||||||
}
|
}
|
||||||
|
|
||||||
if (installThreatLocker.checked) {
|
if (installThreatLocker.checked) {
|
||||||
await executeFetch('/installThreatLocker', { method: 'GET' });
|
fetch('/installThreatLocker', { method: 'GET' })
|
||||||
}
|
}
|
||||||
|
|
||||||
if (installRocketCyber.checked) {
|
if (installRocketCyber.checked) {
|
||||||
await executeFetch('/installRocketCyber', { method: 'GET' });
|
fetch('/installRocketCyber', { method: 'GET' })
|
||||||
}
|
}
|
||||||
|
|
||||||
appendLog("All tasks completed.", "green");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function endSession() {
|
function endSession() {
|
||||||
|
|||||||
Reference in New Issue
Block a user