From aeee2ef3cd03637af92f88f6c4a80158a2146aa1 Mon Sep 17 00:00:00 2001 From: Stephan Yelle Date: Sun, 5 Jan 2025 20:12:02 -0500 Subject: [PATCH] Update TGBeta.ps1 --- TGBeta.ps1 | 81 +++++++++++++++++++++++++++--------------------------- 1 file changed, 41 insertions(+), 40 deletions(-) diff --git a/TGBeta.ps1 b/TGBeta.ps1 index d441ee2..e0b6ff1 100644 --- a/TGBeta.ps1 +++ b/TGBeta.ps1 @@ -694,32 +694,37 @@ function GetHtmlContent { } } - function triggerInstall() { - // Priority 1: installSVSMSPModule - const svsMSPCheckbox = document.getElementById('installSVSMSPModule'); - if (svsMSPCheckbox && svsMSPCheckbox.checked) { - appendLog("Installing SVS MSP Module...", "blue"); - // Perform SVS MSP Module installation logic here - fetch('/installSVSMSPModule', { method: 'GET' }); - appendLog("Installing CyberQP", "cyan"); - - } - - // Priority 2: installDattoRMMCheckbox - const dattoRMMCheckbox = document.getElementById('installDattoRMMCheckbox'); - if (dattoRMMCheckbox && dattoRMMCheckbox.checked) { - const dattoRMMOptions = document.querySelectorAll('input[name="dattoRMMOption"]:checked'); - const dattoRMMValues = Array.from(dattoRMMOptions).map(option => option.value); - - // Handle dropdown selection - const dropdown = document.getElementById('dattoRmmDropdown'); - const UID = dropdown.options[dropdown.selectedIndex].value; - const Name = dropdown.options[dropdown.selectedIndex].text; - - appendLog(`Installing Datto RMM with options: ${dattoRMMValues.join(', ')}`, "cyan"); - appendLog(`Selected Datto RMM UID: ${UID}, Name: ${Name}`, "cyan"); + + function triggerInstall() { - // Perform Datto RMM installation logic here + const installSVSMSPModule = document.querySelector('input[name="installSVSMSPModule"]'); + if (installSVSMSPModule.checked) { + fetch('/installSVSMSPModule', { method: 'GET' }); + appendLog("Installing SVSMSP Module", "cyan"); + + } + + + const dropdown = document.getElementById('dattoRmmDropdown'); + const UID = dropdown.options[dropdown.selectedIndex].value; + const Name = dropdown.options[dropdown.selectedIndex].text; + + const setSVSPowerplan = document.querySelector('input[name="setSVSPowerplan"]'); + + const installDattoRMM = document.querySelector('input[name="installDattoRMM"]'); + const installCyberQP = document.querySelector('input[name="installCyberQP"]'); + const installSplashtop = document.querySelector('input[name="installSplashtop"]'); + const installSVSHelpDesk = document.querySelector('input[name="installSVSHelpDesk"]'); + const installSVSWatchtower = document.querySelector('input[name="installSVSWatchtower"]'); + const installThreatLocker = document.querySelector('input[name="installThreatLocker"]'); + const installRocketCyber = document.querySelector('input[name="installRocketCyber"]'); + + if (installDattoRMM.checked) { + const DattoRMMCheckbox = document.querySelectorAll('input[name="dattoRMMOption"]:checked'); + appendLog("Installing selected site RMM...", "cyan"); + + const checkedValues = Array.from(DattoRMMCheckbox).map(c => c.value); + const payload = { checkedValues, // Array of selected checkbox values UID, // Selected site UID @@ -730,29 +735,25 @@ function GetHtmlContent { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify(payload), + }); + + fetch('/installrmm', { + method: 'POST', + headers: { 'Content-Type': 'application/json' }, + body: JSON.stringify({ installRMMCommand, UID, Name }) }); } - - - - - const setSVSPowerplan = document.querySelector('input[name="setSVSPowerplan"]'); - const installCyberQP = document.querySelector('input[name="installCyberQP"]'); - const installSplashtop = document.querySelector('input[name="installSplashtop"]'); - const installSVSHelpDesk = document.querySelector('input[name="installSVSHelpDesk"]'); - const installSVSWatchtower = document.querySelector('input[name="installSVSWatchtower"]'); - const installThreatLocker = document.querySelector('input[name="installThreatLocker"]'); - const installRocketCyber = document.querySelector('input[name="installRocketCyber"]'); - - - } - if (setSVSPowerplan.checked) { fetch('/SetSVSPowerplan', { method: 'GET' }); appendLog("Setting SVS Powerplan", "cyan"); } + if (installSVSMSPModule.checked) { + fetch('/installSVSMSPModule', { method: 'GET' }); + appendLog("Installing CyberQP", "cyan"); + + } if (installCyberQP.checked) { fetch('/installCyberQP', { method: 'GET' });