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:
@@ -540,11 +540,10 @@ unresolved - every step still needs `default.step` merged in), and the
|
|||||||
`StepPlate`/`_update_step_plates()`/`update_status_step_label()` logic
|
`StepPlate`/`_update_step_plates()`/`update_status_step_label()` logic
|
||||||
behind the Progress tab and status line. New/Load/Save (a plain
|
behind the Progress tab and status line. New/Load/Save (a plain
|
||||||
`<input type="file">`/`FileReader` and a `Blob`/`<a download>` standing in
|
`<input type="file">`/`FileReader` and a `Blob`/`<a download>` standing in
|
||||||
for the desktop app's native file dialogs), Start/Stop, and Confirm (a
|
for the desktop app's native file dialogs), Start/Pause/Stop, and Confirm
|
||||||
plain `<dialog>` pops with the step's message on `WAIT_USER` and sends
|
(a plain `<dialog>` pops with the step's message on `WAIT_USER` and sends
|
||||||
Confirm when dismissed) are all wired up too - see `web/TODO.md` for
|
Confirm when dismissed) are all wired up too - see `web/TODO.md` for
|
||||||
what's still missing (Pause, and more). Deliberately deferred rather than
|
what's still missing. Deliberately deferred rather than stubbed: the
|
||||||
stubbed: the
|
|
||||||
Automatic tab's forecast-vs-actual plot and the live Plot tab's strip
|
Automatic tab's forecast-vs-actual plot and the live Plot tab's strip
|
||||||
charts - both need a charting approach, revisit once Manual + Progress are
|
charts - both need a charting approach, revisit once Manual + Progress are
|
||||||
validated.
|
validated.
|
||||||
|
|||||||
+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.
|
and checked against the Qt source side by side.
|
||||||
|
|
||||||
- [x] **No way to actually run a brew.** ~~There's no Start/Pause/Stop/
|
- [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
|
Confirm anywhere in `web/index.html`~~ Start/Pause/Stop/Confirm are all
|
||||||
up (`btn-sud-start`/`btn-sud-stop` in `app.js`, gated by
|
wired up (`btn-sud-start`/`btn-sud-pause`/`btn-sud-stop` in `app.js`,
|
||||||
`updateSudActions()` mirroring `update_sud_actions()`'s
|
gated by `updateSudActions()` mirroring `update_sud_actions()`'s
|
||||||
enabled/disabled logic; Confirm via the `#sud-message-dialog` below).
|
enabled/disabled logic - Pause only enabled while actually running,
|
||||||
Still missing: Pause - trivial to add the same way as Start/Stop
|
same as the desktop client's `actionPause`; Confirm via the
|
||||||
whenever it's actually needed.
|
`#sud-message-dialog` below).
|
||||||
|
|
||||||
- [x] **`WAIT_USER` never surfaces to the user.** `showUserMessage()`
|
- [x] **`WAIT_USER` never surfaces to the user.** `showUserMessage()`
|
||||||
pops `#sud-message-dialog` (a plain `<dialog>`, no library) the instant
|
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 running = canRun && RUNNING_STATES.has(sudState);
|
||||||
const paused = canRun && sudState === PAUSED_STATE;
|
const paused = canRun && sudState === PAUSED_STATE;
|
||||||
document.getElementById('btn-sud-start').disabled = !(canRun && !running);
|
document.getElementById('btn-sud-start').disabled = !(canRun && !running);
|
||||||
|
document.getElementById('btn-sud-pause').disabled = !running;
|
||||||
document.getElementById('btn-sud-stop').disabled = !(running || paused);
|
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', () => {
|
document.getElementById('btn-sud-start').addEventListener('click', () => {
|
||||||
sendMsg('Sud', {Start: true});
|
sendMsg('Sud', {Start: true});
|
||||||
});
|
});
|
||||||
|
document.getElementById('btn-sud-pause').addEventListener('click', () => {
|
||||||
|
sendMsg('Sud', {Pause: true});
|
||||||
|
});
|
||||||
document.getElementById('btn-sud-stop').addEventListener('click', () => {
|
document.getElementById('btn-sud-stop').addEventListener('click', () => {
|
||||||
sendMsg('Sud', {Stop: true});
|
sendMsg('Sud', {Stop: true});
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -17,6 +17,7 @@
|
|||||||
<input type="file" id="sud-file-input" accept="application/json" class="hidden">
|
<input type="file" id="sud-file-input" accept="application/json" class="hidden">
|
||||||
<button id="btn-sud-save">Save…</button>
|
<button id="btn-sud-save">Save…</button>
|
||||||
<button id="btn-sud-start">Start</button>
|
<button id="btn-sud-start">Start</button>
|
||||||
|
<button id="btn-sud-pause">Pause</button>
|
||||||
<button id="btn-sud-stop">Stop</button>
|
<button id="btn-sud-stop">Stop</button>
|
||||||
</span>
|
</span>
|
||||||
</header>
|
</header>
|
||||||
|
|||||||
Reference in New Issue
Block a user