Add Pause to the browser client's Sud controls
Mirrors client/brewpi_gui.py's actionPause: btn-sud-pause sends
{"Sud": {"Pause": true}} and is only enabled while actually running
(not idle, not already paused), matching update_sud_actions()'s
enabled/disabled logic - Start already doubles as Resume while paused,
so no separate Resume control is needed.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0189FkmyJkY77HqsNomr1DwV
This commit is contained in:
+6
-6
@@ -7,12 +7,12 @@ flagged as deferred in the plan, or only noticed once the port was done
|
||||
and checked against the Qt source side by side.
|
||||
|
||||
- [x] **No way to actually run a brew.** ~~There's no Start/Pause/Stop/
|
||||
Confirm anywhere in `web/index.html`~~ Start/Stop/Confirm are now wired
|
||||
up (`btn-sud-start`/`btn-sud-stop` in `app.js`, gated by
|
||||
`updateSudActions()` mirroring `update_sud_actions()`'s
|
||||
enabled/disabled logic; Confirm via the `#sud-message-dialog` below).
|
||||
Still missing: Pause - trivial to add the same way as Start/Stop
|
||||
whenever it's actually needed.
|
||||
Confirm anywhere in `web/index.html`~~ Start/Pause/Stop/Confirm are all
|
||||
wired up (`btn-sud-start`/`btn-sud-pause`/`btn-sud-stop` in `app.js`,
|
||||
gated by `updateSudActions()` mirroring `update_sud_actions()`'s
|
||||
enabled/disabled logic - Pause only enabled while actually running,
|
||||
same as the desktop client's `actionPause`; Confirm via the
|
||||
`#sud-message-dialog` below).
|
||||
|
||||
- [x] **`WAIT_USER` never surfaces to the user.** `showUserMessage()`
|
||||
pops `#sud-message-dialog` (a plain `<dialog>`, no library) the instant
|
||||
|
||||
@@ -304,6 +304,7 @@ function updateSudActions() {
|
||||
const running = canRun && RUNNING_STATES.has(sudState);
|
||||
const paused = canRun && sudState === PAUSED_STATE;
|
||||
document.getElementById('btn-sud-start').disabled = !(canRun && !running);
|
||||
document.getElementById('btn-sud-pause').disabled = !running;
|
||||
document.getElementById('btn-sud-stop').disabled = !(running || paused);
|
||||
}
|
||||
|
||||
@@ -671,6 +672,9 @@ document.getElementById('btn-sud-save').addEventListener('click', () => {
|
||||
document.getElementById('btn-sud-start').addEventListener('click', () => {
|
||||
sendMsg('Sud', {Start: true});
|
||||
});
|
||||
document.getElementById('btn-sud-pause').addEventListener('click', () => {
|
||||
sendMsg('Sud', {Pause: true});
|
||||
});
|
||||
document.getElementById('btn-sud-stop').addEventListener('click', () => {
|
||||
sendMsg('Sud', {Stop: true});
|
||||
});
|
||||
|
||||
@@ -17,6 +17,7 @@
|
||||
<input type="file" id="sud-file-input" accept="application/json" class="hidden">
|
||||
<button id="btn-sud-save">Save…</button>
|
||||
<button id="btn-sud-start">Start</button>
|
||||
<button id="btn-sud-pause">Pause</button>
|
||||
<button id="btn-sud-stop">Stop</button>
|
||||
</span>
|
||||
</header>
|
||||
|
||||
Reference in New Issue
Block a user