Phone Jump button; docs never scroll sideways; presence sweep timing kept
- Jump (phones / tablets): find a device by name and scroll to its card, or jump to a section, the top or the bottom of the page. - Documentation on phones: long paths, links, code and tables wrap; toolbar is title, last edited, then the buttons. - Filter bar's Clear is the only clear button on phones. - Card fields: search box and add list as wide as the field rows. - Presence sweep: the demo uses the hourly schedule too, and the last sweep time survives a worker restart (a restart used to trigger an extra sweep).
This commit is contained in:
1 parent
9dc2d88726
commit
b0f700928e
6 files changed
+272
-5
No files matched your search
+10
-2
@@ -146,6 +146,12 @@ $hasLastSeen = [bool](Get-Command Get-DeviceLastSeen -ErrorAction SilentlyContin
|
||||
# Every ping the worker makes is recorded here: when the device was last checked, what the
|
||||
# ping said, and when it last answered. Kept across restarts in Presence.json.
|
||||
$global:Presence = Read-JsonTable $presencePath
|
||||
# When the last presence sweep ran survives a worker restart, so a restart doesn't trigger
|
||||
# an extra sweep (it's kept in Presence.json under a reserved key)
|
||||
if ($global:Presence.ContainsKey('__sweep')) {
|
||||
try { $global:LastPresenceSweep = [datetime]$global:Presence['__sweep'].Last } catch {}
|
||||
$global:Presence.Remove('__sweep')
|
||||
}
|
||||
$global:PingedThisCycle = [System.Collections.Generic.HashSet[string]]::new([StringComparer]::OrdinalIgnoreCase)
|
||||
|
||||
function Set-Presence {
|
||||
@@ -272,7 +278,9 @@ function Save-AdvancedCache {
|
||||
$out[$key] = $entry
|
||||
}
|
||||
Write-JsonFile $advancedCachePath $out 5
|
||||
Write-JsonFile $presencePath $global:Presence 4
|
||||
$presenceOut = @{} + $global:Presence
|
||||
if ($global:LastPresenceSweep -gt [datetime]::MinValue) { $presenceOut['__sweep'] = @{ Last = $global:LastPresenceSweep.ToString("o") } }
|
||||
Write-JsonFile $presencePath $presenceOut 4
|
||||
}
|
||||
|
||||
# Cached / skipped rows show the latest presence-sweep result instead of a placeholder
|
||||
@@ -796,7 +804,7 @@ while ($true) {
|
||||
}
|
||||
$presenceCount = $toPing.Count
|
||||
$global:LastPresenceSweep = Get-Date
|
||||
Write-Host "[Presence Updated]" -ForegroundColor Green
|
||||
Write-Host "[Presence Updated. Next presence sweep after $($global:LastPresenceSweep.AddMinutes($presenceMinutes).ToString('hh:mm tt')), or at midnight]" -ForegroundColor Green
|
||||
}
|
||||
$presenceSeconds = $phaseWatch.Elapsed.TotalSeconds
|
||||
$phaseWatch.Restart()
|
||||
|
||||
Reference in new issue
Block a user