Web: update for extraction of status change requests to struct

See recent OpenAPI change.
This commit is contained in:
Sybren A. Stüvel 2022-06-02 12:33:32 +02:00
parent 9ed6b6d931
commit bc33f55b3c
2 changed files with 8 additions and 8 deletions

View File

@ -114,14 +114,14 @@ export default {
let promise; let promise;
if (existingRow) { if (existingRow) {
// Tabbulator doesn't update ommitted fields, but if `status_requested` // Tabbulator doesn't update ommitted fields, but if `status_change`
// is ommitted it means "no status change requested"; this should still // is ommitted it means "no status change requested"; this should still
// force an update. // force an update of the `status_change` field.
if (!workerUpdate.status_requested) { if (!workerUpdate.status_change) {
workerUpdate.status_requested = undefined; workerUpdate.status_change = null;
} }
promise = this.tabulator.updateData([workerUpdate]); promise = this.tabulator.updateData([workerUpdate]);
// Tabulator doesn't know we're using 'status_requested' in the 'status' // Tabulator doesn't know we're using 'status_change' in the 'status'
// column, so it also won't know to redraw when that field changes. // column, so it also won't know to redraw when that field changes.
promise.then(() => existingRow.reinitialize(true)); promise.then(() => existingRow.reinitialize(true));
} else { } else {

View File

@ -25,16 +25,16 @@ export function indicator(status, classNamePrefix) {
* @returns the HTML for the worker status. * @returns the HTML for the worker status.
*/ */
export function workerStatus(worker) { export function workerStatus(worker) {
if (!worker.status_requested) { if (!worker.status_change) {
return `${worker.status}`; return `${worker.status}`;
} }
let arrow; let arrow;
if (worker.lazy_status_request) { if (worker.status_change.is_lazy) {
arrow = `<span class='state-transition-arrow lazy' title='lazy status transition'>➠</span>` arrow = `<span class='state-transition-arrow lazy' title='lazy status transition'>➠</span>`
} else { } else {
arrow = `<span class='state-transition-arrow forced' title='forced status transition'>➜</span>` arrow = `<span class='state-transition-arrow forced' title='forced status transition'>➜</span>`
} }
return `${worker.status} ${arrow} ${worker.status_requested}`; return `${worker.status} ${arrow} ${worker.status_change.status}`;
} }