Demo: migrations follow the schedule, worked by a simulated team
Each device now migrates on the day of its date tag instead of on a looping 24-hour clock: earlier days are finished, today's devices go through backup and restore during working hours, later days haven't started. The few that don't finish have a cause the dashboard shows (broken client, broken WMI, low disk, a USMT error, unreachable PC). A simulated team keeps two weeks of working days tagged. During working hours it adds devices, reschedules or drops one, tags stuck PCs with their problem, then fixes them and moves them to a new day; each morning finished days are closed out and a new day is scheduled. Actions print in the worker terminal as [Team] lines. Settings live in Demo.Team. The visitor sandbox now keeps per-tag edits laid over the live roster, so the team's changes keep showing around a visitor's own edits. Overview calendar: today is a filled badge on the date number, so it no longer looks like the selected day (outline plus tint).
This commit is contained in:
7 files changed
+563
-155
No files matched your search
+19
-7
@@ -51,12 +51,13 @@ for ($m = 0; $m -lt 3; $m++) {
|
||||
$manual += "$src, $dst"
|
||||
}
|
||||
|
||||
# --- 2. Date-batch tags (recent and upcoming working days; the worker keeps them current) ---
|
||||
$dateTags = Get-DemoDateTags
|
||||
[System.IO.File]::WriteAllText((Join-Path $dataDir "Demo-Dates.json"), (@{ Tags = $dateTags } | ConvertTo-Json), [System.Text.Encoding]::UTF8)
|
||||
|
||||
# --- 2. Schedule: the last few working days (mostly finished) and the next two weeks ---
|
||||
$team = $config.Demo.Team
|
||||
$today = (Get-Date).Date
|
||||
$days = @(@(1..[int]$team.DaysKept | ForEach-Object { Get-DemoWorkday $today (-$_) }) | Sort-Object) + @(0..([int]$team.DaysAhead - 1) | ForEach-Object { Get-DemoWorkday $today $_ })
|
||||
$tags = [ordered]@{}
|
||||
foreach ($t in $dateTags) { $tags[$t] = [System.Collections.Generic.List[string]]::new() }
|
||||
foreach ($d in $days) { $tags[(ConvertTo-DemoDateTag $d)] = [System.Collections.Generic.List[string]]::new() }
|
||||
$dateTags = @($tags.Keys)
|
||||
for ($n = 0; $n -lt $pool.Count; $n++) { $tags[$dateTags[$n % $dateTags.Count]].Add($pool[$n]) }
|
||||
$tags["Manual Pairs"] = [System.Collections.Generic.List[string]]::new([string[]]$manual)
|
||||
|
||||
@@ -70,8 +71,16 @@ foreach ($d in $pool) {
|
||||
foreach ($pair in @(@("Accounting", "Accounting"), @("Sales Floor", "Sales"), @("Exec Suite", "Executive"))) {
|
||||
if ($byDept.ContainsKey($pair[1])) { $tags[$pair[0]] = [System.Collections.Generic.List[string]]::new([string[]]@($byDept[$pair[1]] | Select-Object -First 12)) }
|
||||
}
|
||||
$tags["Broken WMI"] = [System.Collections.Generic.List[string]]::new([string[]]@($pool | Where-Object { (Get-DemoRand $_ 'wmi') -lt 0.03 } | Select-Object -First 5))
|
||||
$tags["Bad Client"] = [System.Collections.Generic.List[string]]::new([string[]]@($pool | Where-Object { (Get-DemoRand $_ 'badclient') -lt 0.03 } | Select-Object -First 4))
|
||||
|
||||
# Problems that have already shown up on earlier days are tagged, as the team would have
|
||||
Set-DemoSchedule $tags @() -Pin
|
||||
foreach ($d in $pool) {
|
||||
$kind = Get-DemoStuck $d
|
||||
if (-not $kind) { continue }
|
||||
$t = $script:DemoIssueTags[$kind]
|
||||
if (-not $tags.Contains($t)) { $tags[$t] = [System.Collections.Generic.List[string]]::new() }
|
||||
$tags[$t].Add($d)
|
||||
}
|
||||
$tags["Public PCs"] = $skipPublic
|
||||
$tags["Laptops"] = $skipLaptops
|
||||
|
||||
@@ -81,6 +90,9 @@ foreach ($t in $tags.Keys) {
|
||||
$tracked[$t] = [ordered]@{ devices = @($tags[$t]); skipUSMT = ($skipTags -contains $t) }
|
||||
}
|
||||
($tracked | ConvertTo-Json -Depth 5) | Set-Content -Path $trackedPath -Encoding UTF8
|
||||
# The simulated team picks up from here (see Invoke-DemoTeam in Providers/Demo.ps1)
|
||||
$teamState = [ordered]@{ Day = $today.ToString("yyyy-MM-dd"); NextAction = (Get-Date).AddMinutes(2).ToString("o"); Serial = 0; Fixed = @(); Moves = @{} }
|
||||
[System.IO.File]::WriteAllText((Join-Path $dataDir "Demo-Team.json"), ($teamState | ConvertTo-Json), [System.Text.Encoding]::UTF8)
|
||||
|
||||
# --- 3. Blacklist / suite rules ---
|
||||
Copy-Item (Join-Path $PSScriptRoot "Blacklisted-Apps.txt") (Join-Path $dataDir "Blacklisted-Apps.txt") -Force
|
||||
|
||||
Reference in new issue
Block a user