From 697eddb5d989a9b8215f31e540e65c4257a16d60 Mon Sep 17 00:00:00 2001 From: Stephan Yelle Date: Sun, 5 Jan 2025 20:16:49 -0500 Subject: [PATCH] Update TGBeta.ps1 --- TGBeta.ps1 | 46 ++++++++++++++++++++-------------------------- 1 file changed, 20 insertions(+), 26 deletions(-) diff --git a/TGBeta.ps1 b/TGBeta.ps1 index e0b6ff1..b8cac65 100644 --- a/TGBeta.ps1 +++ b/TGBeta.ps1 @@ -695,31 +695,21 @@ function GetHtmlContent { } - function triggerInstall() { - - const installSVSMSPModule = document.querySelector('input[name="installSVSMSPModule"]'); - if (installSVSMSPModule.checked) { - fetch('/installSVSMSPModule', { method: 'GET' }); - appendLog("Installing SVSMSP Module", "cyan"); - - } - - + function triggerInstall() { + 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"]'); + const installSVSMSPModule = document.querySelector('input[name="installSVSMSPModule"]'); + if (installSVSMSPModule.checked) { + fetch('/installSVSMSPModule', { method: 'GET' }); + appendLog("Installing SVSMSP Module", "cyan"); - if (installDattoRMM.checked) { + } + + const installDattoRMM = document.querySelector('input[name="installDattoRMM"]'); + if (installDattoRMM.checked) { const DattoRMMCheckbox = document.querySelectorAll('input[name="dattoRMMOption"]:checked'); appendLog("Installing selected site RMM...", "cyan"); @@ -737,13 +727,17 @@ function GetHtmlContent { 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");