diff options
| author | Danilo M. <danix@danix.xyz> | 2026-11-11 10:10:53 +0100 |
|---|---|---|
| committer | Danilo M. <danix@danix.xyz> | 2026-11-11 10:10:53 +0100 |
| commit | ed5ff682efbefd3e90d21ea618473af2844b774d (patch) | |
| tree | 9a25fca9e3aac26792c8eee40f33bf6b843d9cdb /static | |
| parent | 6a9a1ae47e758afb9a747a619b5665cb5908834a (diff) | |
| download | deck-it-ed5ff682efbefd3e90d21ea618473af2844b774d.tar.gz deck-it-ed5ff682efbefd3e90d21ea618473af2844b774d.zip | |
feat(sleep): tell the tablet when the PC shuts down or reboots
The delay inhibitor now covers shutdown too, and dbus-monitor also
watches PrepareForShutdown. X-Deckit-Sleep carries the reason
("asleep" or "shutting down") and the page shows "The PC is <reason>",
dropping the wake lock as on suspend.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Diffstat (limited to 'static')
| -rw-r--r-- | static/app.js | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/static/app.js b/static/app.js index c91876b..3e75a4b 100644 --- a/static/app.js +++ b/static/app.js @@ -113,7 +113,8 @@ function poll(name, seconds, update) { const tick = async () => { try { const r = await fetch(`/api/${name}`); - if (r.headers.get("X-Deckit-Sleep")) return goodnight("The PC is asleep"); + const why = r.headers.get("X-Deckit-Sleep"); + if (why) return goodnight(`The PC is ${why}`); awake(); if (r.ok) update(await r.json()); } catch { |
