add task completed
This commit is contained in:
5
samy.js
5
samy.js
@@ -336,6 +336,11 @@ async function triggerInstall() {
|
||||
if (totalTasks > 0) {
|
||||
console.info(`[Info] All tasks completed (${completedTasks}/${totalTasks})`);
|
||||
}
|
||||
try {
|
||||
await fetch("/tasksCompleted", { method: "POST" });
|
||||
} catch (err) {
|
||||
console.warn("Could not notify server about completion:", err);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
13
samy.ps1
13
samy.ps1
@@ -1208,6 +1208,13 @@ function Send-JSON {
|
||||
}
|
||||
#endregion HTTP responder helpers
|
||||
|
||||
function Invoke-TasksCompleted {
|
||||
param($Context)
|
||||
|
||||
Write-LogHybrid "All UI-selected tasks processed" Info UI -LogToEvent
|
||||
Send-Text $Context "Tasks completion acknowledged."
|
||||
}
|
||||
|
||||
#region Datto handlers
|
||||
function Invoke-FetchSites {
|
||||
param($Context)
|
||||
@@ -1732,6 +1739,12 @@ function Install-DattoRMM {
|
||||
return
|
||||
}
|
||||
|
||||
# ---- Tasks completed notification ----
|
||||
if ($Context.Request.HttpMethod -eq 'POST' -and $path -eq 'tasksCompleted') {
|
||||
Invoke-TasksCompleted $Context
|
||||
return
|
||||
}
|
||||
|
||||
# ---- Fetch Sites endpoint ----
|
||||
if ($Context.Request.HttpMethod -eq 'POST' -and $path -eq 'getpw') {
|
||||
Invoke-FetchSites $Context
|
||||
|
||||
Reference in New Issue
Block a user