Update TGBeta.ps1

This commit is contained in:
2025-01-07 23:59:49 -05:00
parent cdda7889d0
commit b43eb95e98

View File

@@ -1,17 +1,18 @@
### To Modify of January 5 2025 ### To Modify of January 5 2025
### set the priority in the js code so it waits for one function to complete before starting the next one
### let's start thinking about the write-log -TaskCategory "On-boarding" or "Off-boarding" ### let's start thinking about the write-log -TaskCategory "On-boarding" or "Off-boarding"
### need new logo and the RGB color codes form john ### need new logo and the RGB color codes form john
### add the .net silent install tweaks to toolkit ### add the .net silent install tweaks to toolkit
### for the reg tweak need to do/undo function maybe it should have it own check box list ### for the reg tweak need to do/undo function maybe it should have it own check box list
### new tab for client apps? ### new tab for client apps?
### need to add the set-DefaultEdgeSearchProvider to the module ### the set-DefaultEdgeSearchProvider will be added to the module v 25.1.8
############################################################# #############################################################
### Changes done ### Changes done
### priorities are set for the install order as far as 1 svsmsp module,2 datto rmm, 3 the rest
### added the Tweaks and Offboard buttons ### added the Tweaks and Offboard buttons
### added the Set-DefaultEdgeSearchProvider ### added the Set-DefaultEdgeSearchProvider
### minor change the the param of install-svsmsp ### minor change the the param of install-svsmsp
@@ -848,77 +849,130 @@ function GetHtmlContent {
} }
} }
function triggerInstall() { function triggerInstall() {
const dropdown = document.getElementById('dattoRmmDropdown'); const dropdown = document.getElementById('dattoRmmDropdown');
const UID = dropdown.options[dropdown.selectedIndex]?.value || null; const UID = dropdown && dropdown.options[dropdown.selectedIndex]
const Name = dropdown.options[dropdown.selectedIndex]?.text || null; ? dropdown.options[dropdown.selectedIndex].value
: null;
const setSVSPowerplan = document.querySelector('input[name="setSVSPowerplan"]'); const Name = dropdown && dropdown.options[dropdown.selectedIndex]
const installSVSMSPModule = document.querySelector('input[name="installSVSMSPModule"]'); ? dropdown.options[dropdown.selectedIndex].text
const installDattoRMM = document.querySelector('input[name="installDattoRMM"]'); : null;
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"]');
(async () => {
// Priority 1: Install SVSMSP Module // Priority 1: Install SVSMSP Module
if (installSVSMSPModule.checked) { if (document.querySelector('input[name="installSVSMSPModule"]').checked) {
appendLog("Installing SVSMSP Module (Priority 1)...", "cyan"); appendLog("Installing SVSMSP Module (Priority 1)...", "cyan");
fetch('/installSVSMSPModule', { method: 'GET' }) try {
await fetch('/installSVSMSPModule', { method: 'GET' });
appendLog("SVSMSP Module installation completed.", "green");
} catch (error) {
appendLog("Error installing SVSMS", "red");
}
} }
// Priority 2: Install DattoRMM
if (installDattoRMM.checked) {
const DattoRMMCheckbox = document.querySelectorAll('input[name="dattoRMMOption"]:checked');
appendLog("Installing selected site RMM (Priority 2)...", "cyan");
// Priority 2: Install DattoRMM
if (document.querySelector('input[name="installDattoRMM"]').checked) {
appendLog("Installing DattoRMM (Priority 2)...", "cyan");
try {
const DattoRMMCheckbox = document.querySelectorAll('input[name="dattoRMMOption"]:checked');
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,
UID, // Selected site UID UID,
Name // Selected site name Name
}; };
fetch('/installrmm', { await fetch('/installrmm', {
method: 'POST', method: 'POST',
headers: { 'Content-Type': 'application/json' }, headers: { 'Content-Type': 'application/json' },
body: JSON.stringify(payload) body: JSON.stringify(payload)
}) });
appendLog("DattoRMM installation completed.", "green");
} catch (error) {
appendLog("Error installing DattoRMM: ${error.message}", "red");
}
} }
// Lower-priority tasks
if (setSVSPowerplan.checked) { // Priority 3: Other tasks
fetch('/SetSVSPowerplan', { method: 'GET' }) if (document.querySelector('input[name="setSVSPowerplan"]').checked) {
appendLog("Setting SVS Powerplan (Priority 3)...", "cyan");
try {
await fetch('/SetSVSPowerplan', { method: 'GET' });
appendLog("SVS Powerplan set successfully.", "green");
} catch (error) {
appendLog("Error setting SVS Powerplan: ${error.message}", "red");
}
} }
if (installCyberQP.checked) { if (document.querySelector('input[name="installCyberQP"]').checked) {
fetch('/installCyberQP', { method: 'GET' }) appendLog("Installing CyberQP (Priority 3)...", "cyan");
try {
await fetch('/installCyberQP', { method: 'GET' });
appendLog("CyberQP installation completed.", "green");
} catch (error) {
appendLog("Error installing CyberQP: ${error.message}", "red");
}
} }
if (installSplashtop.checked) { if (document.querySelector('input[name="installSplashtop"]').checked) {
fetch('/installSplashtop', { method: 'GET' }) appendLog("Installing Splashtop (Priority 3)...", "cyan");
try {
await fetch('/installSplashtop', { method: 'GET' });
appendLog("Splashtop installation completed.", "green");
} catch (error) {
appendLog("Error installing Splashtop: ${error.message}", "red");
}
} }
if (installSVSHelpDesk.checked) { if (document.querySelector('input[name="installSVSHelpDesk"]').checked) {
fetch('/installSVSHelpDesk', { method: 'GET' }) appendLog("Installing SVS HelpDesk (Priority 3)...", "cyan");
try {
await fetch('/installSVSHelpDesk', { method: 'GET' });
appendLog("SVS HelpDesk installation completed.", "green");
} catch (error) {
appendLog("Error installing SVS HelpDesk: ${error.message}", "red");
}
} }
if (installSVSWatchtower.checked) { if (document.querySelector('input[name="installSVSWatchtower"]').checked) {
fetch('/installSVSWatchtower', { method: 'GET' }) appendLog("Installing SVS Watchtower (Priority 3)...", "cyan");
try {
await fetch('/installSVSWatchtower', { method: 'GET' });
appendLog("SVS Watchtower installation completed.", "green");
} catch (error) {
appendLog("Error installing SVS Watchtower: ${error.message}", "red");
}
} }
if (installThreatLocker.checked) { if (document.querySelector('input[name="installThreatLocker"]').checked) {
fetch('/installThreatLocker', { method: 'GET' }) appendLog("Installing ThreatLocker (Priority 3)...", "cyan");
try {
await fetch('/installThreatLocker', { method: 'GET' });
appendLog("ThreatLocker installation completed.", "green");
} catch (error) {
appendLog("Error installing ThreatLocker: ${error.message}", "red");
}
} }
if (installRocketCyber.checked) { if (document.querySelector('input[name="installRocketCyber"]').checked) {
fetch('/installRocketCyber', { method: 'GET' }) appendLog("Installing RocketCyber (Priority 3)...", "cyan");
try {
await fetch('/installRocketCyber', { method: 'GET' });
appendLog("RocketCyber installation completed.", "green");
} catch (error) {
appendLog("Error installing RocketCyber: ${error.message}", "red");
}
} }
})();
} }
function endSession() { function endSession() {
appendLog("Session ended. Closing application...", "yellow"); appendLog("Session ended. Closing application...", "yellow");
fetch('/quit', { method: 'GET' }) fetch('/quit', { method: 'GET' })
@@ -1033,7 +1087,8 @@ try {
"/installSVSMSPModule" { "/installSVSMSPModule" {
if ($request.HttpMethod -eq "GET") { if ($request.HttpMethod -eq "GET") {
try { try {
Install-SVSMSP -InstallToolkit write-host "toolkit would have installed"
#Install-SVSMSP -InstallToolkit
$responseString = "Install SVSMSP Module triggered successfully." $responseString = "Install SVSMSP Module triggered successfully."
$response.StatusCode = 200 $response.StatusCode = 200
} catch { } catch {