Skip to main content

Module jobs_centre

Module jobs_centre 

Source
Expand description

The jobs centre: every job the host runs, as a panel (Jobs, closed until asked for) and as a popover from the status bar’s jobs item, the same list in both.

Experimental: may change in any release (docs/stability.md).

Each job shows its badge (a registry symbol, its tooltip its accessible name), its title, its state, a bar of its estimated overall percentage (stacked with its failed and skipped items), “n of m”, the current step and item, the time left, the reason it failed, and buttons that ask the host (pause, resume, cancel, retry) or forget it (dismiss). A batch’s children fold under it. Finished jobs go to the history, cleared by hand.

An application adds rows of its own as row sources (promises it waits on, links to other machines; egui_pop_model::job_rows), kept on the bus (pop.jobs.rows, crate::jobs): each source’s rows show under its title, by group, each with its symbol, state, bar, detail and actions (cancel, retry, open, each a command). Once a source is declared, a filter bar shows or hides each source (egui-pop’s own jobs among them) and picks the states shown (all, active, done, failed). Each row is a list item named “title, state”, each action a button named “action: title”.

A small chevron before each job opens its log console: the lines of its job.log events. The state is remembered per job (JobsService::expanded), so the panel, the popover and the toast agree. egui-pop’s application layer draws the lines as plain text; egui-pop-editors gives a pseudo-terminal console (its Terminal over a Console source: colours, scrollback, selection, copy) by providing JOB_LOG_VIEW (JobConsolesPlugin, which the facade offers with its editors feature). The layering keeps the application API below the editors: the console is a service the upper layer provides, not a dependency.

Structs§

JobLogView
How a job’s log console is drawn.

Constants§

JOB_LOG_VIEW
The log console, provided by an upper layer (egui-pop-editors’s pseudo-terminal); without it, plain lines.
LOG_HEIGHT
How tall a log console is, in points.
PANEL_JOBS
The jobs panel.

Functions§

detail_text
What a job’s line under its bar says: n of m, the step, the item, the time left.
eta_text
Time left as people say it: seconds under a minute (by fives), minutes otherwise.
job_row
Draws one job, its log console when open, and its children.
popover_id
The popover’s id.
popover_open
Whether the jobs popover is open.
row_state_text
An application row’s state as words.
show
The list: the filter bar (when an application declared a row source), the jobs going on, each source’s rows, then the history. Without a source it is the jobs alone, unfiltered.
source_row
Draws one row of an application’s source: its symbol, title, state and actions, then its bar (when it knows its progress) and its detail, also its tooltip. A list item named “title, state”.
state_text
A job’s state as words.
toggle_popover
Opens or closes the jobs popover.
tone
The tone a job’s bar takes.

Type Aliases§

DrawLog
Draws a job’s log console: f(ui, app, job).