Update TGBeta.ps1
This commit is contained in:
59
TGBeta.ps1
59
TGBeta.ps1
@@ -512,11 +512,6 @@ function GetHtmlContent {
|
|||||||
<div id="onboardTab" class="tab-content active">
|
<div id="onboardTab" class="tab-content active">
|
||||||
<h2>On-Boarding</h2>
|
<h2>On-Boarding</h2>
|
||||||
<h3 class="subtitle">This new way of deploying our stack will make it easier to be sure everything is deployed successfully</h3>
|
<h3 class="subtitle">This new way of deploying our stack will make it easier to be sure everything is deployed successfully</h3>
|
||||||
<!-- Module Status Display -->
|
|
||||||
<div id="moduleStatusContainer">
|
|
||||||
<h3>Module Status</h3>
|
|
||||||
<p id="moduleStatusMessage">Checking module status...</p>
|
|
||||||
</div>
|
|
||||||
<div class="checkbox-group">
|
<div class="checkbox-group">
|
||||||
<label>
|
<label>
|
||||||
<input type="checkbox" id="selectAllOnboardCheckbox" onclick="toggleOnboardCheckboxes(this)">
|
<input type="checkbox" id="selectAllOnboardCheckbox" onclick="toggleOnboardCheckboxes(this)">
|
||||||
@@ -657,33 +652,6 @@ function GetHtmlContent {
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
|
||||||
async function fetchModuleStatus() {
|
|
||||||
try {
|
|
||||||
const response = await fetch('/checkModuleStatus', { method: 'GET' });
|
|
||||||
if (!response.ok) {
|
|
||||||
throw new Error('Failed to fetch module status');
|
|
||||||
}
|
|
||||||
|
|
||||||
const data = await response.json();
|
|
||||||
const statusMessage = data.Installed
|
|
||||||
? `${data.Message}`
|
|
||||||
: `${data.Message}`;
|
|
||||||
|
|
||||||
const moduleStatusMessage = document.getElementById('moduleStatusMessage');
|
|
||||||
moduleStatusMessage.textContent = statusMessage;
|
|
||||||
moduleStatusMessage.style.color = data.Installed ? 'green' : 'red';
|
|
||||||
} catch (error) {
|
|
||||||
console.error('Error fetching module status:', error);
|
|
||||||
const moduleStatusMessage = document.getElementById('moduleStatusMessage');
|
|
||||||
moduleStatusMessage.textContent = 'Error checking module status.';
|
|
||||||
moduleStatusMessage.style.color = 'red';
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Call the function when the page loads
|
|
||||||
window.addEventListener('load', fetchModuleStatus);
|
|
||||||
|
|
||||||
function toggleOnboardCheckboxes(selectedCheckbox) {
|
function toggleOnboardCheckboxes(selectedCheckbox) {
|
||||||
const checkboxes = document.querySelectorAll('#onboardTab input[type="checkbox"]');
|
const checkboxes = document.querySelectorAll('#onboardTab input[type="checkbox"]');
|
||||||
const dattoRMMCheckbox = document.getElementById('installDattoRMMCheckbox');
|
const dattoRMMCheckbox = document.getElementById('installDattoRMMCheckbox');
|
||||||
@@ -1450,33 +1418,6 @@ try {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
"/checkModuleStatus" {
|
|
||||||
if ($request.HttpMethod -eq "GET") {
|
|
||||||
$moduleName = "SVSMSP" # Change this to your module name
|
|
||||||
$moduleVersion = Check-ModuleVersion -ModuleName $moduleName
|
|
||||||
|
|
||||||
$status = if ($null -ne $moduleVersion) {
|
|
||||||
@{
|
|
||||||
Installed = $true
|
|
||||||
Version = $moduleVersion.ToString()
|
|
||||||
Message = "Module '$moduleName' is installed. Version: $moduleVersion."
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
@{
|
|
||||||
Installed = $false
|
|
||||||
Message = "Module '$moduleName' is not installed."
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
$responseData = $status | ConvertTo-Json -Depth 1
|
|
||||||
$buffer = [System.Text.Encoding]::UTF8.GetBytes($responseData)
|
|
||||||
$response.ContentType = "application/json"
|
|
||||||
$response.ContentLength64 = $buffer.Length
|
|
||||||
$response.OutputStream.Write($buffer, 0, $buffer.Length)
|
|
||||||
$response.OutputStream.Close()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
# ----------------------------------------------------------------
|
# ----------------------------------------------------------------
|
||||||
# 4) NEW ROUTE: /getLogs
|
# 4) NEW ROUTE: /getLogs
|
||||||
|
|||||||
Reference in New Issue
Block a user