Skip to main content

Crate schedr_ui

Crate schedr_ui 

Source
Expand description

The web UI: server-rendered HTML pages over webservers’ REST APIs (see archive/PROJECT.md, Web UI).

It is schedr ui, a role of its own talking only to webservers’ JSON APIs (decision 21B), one per deployment in its list (one the common case); schedr standalone serves it too, calling its own API in process. Pages are askama templates (checked at compile time) with one stylesheet of our own, light and dark (decision 26A and the user’s style); times show in UTC and in the browser’s zone (a cookie its inline script sets); links follow X-Forwarded-Prefix; the documentation is served at /docs from the image (28A).

Modules§

chart
Charts drawn by the server as SVG (decision 466): bars (a task’s attempts, decision 467), lines over time, an “others” band, dashed limits, axes, and a hover strip per point whose <title> gives every value there. No JavaScript; the colours are the stylesheet’s series tokens (--series-1 to --series-8), light and dark.
deployments
The Deployments page (M4.4b, decisions 121-129): one graph of everything the UI shows. The UI on top (in standalone inside its process), linked by HTTP to each deployment’s webserver; in each deployment’s frame its webserver, linked by the database to its masters, and its workers, each linked by gRPC to the master it registered with. Each rectangle around nodes is a process. A node with a problem is yellow (a warning) or red (an error). Clicking a node opens its panel: its facts, its problems and its configuration, as TOML. Every configuration was masked by the node it belongs to before it left that node’s process, and is masked again before it is shown.
graph
The run graph’s layout: a layered (Sugiyama) layout of our own (decision 22A), top to bottom.
live
Live pages (M3.3, decisions 34A and 23A): what changed in each deployment, relayed to the browsers, and a running attempt’s log as it grows.
page
What every page needs from its request: the path prefix links start with, and the browser’s time zone (from the cookie the page’s script sets).

Structs§

Deployment
One deployment the UI shows: a webserver’s API, by the name the UI gives it.
Ui
What the UI serves.

Functions§

router
The UI’s routes: / (the DAGs), /d/<deployment>/dags/<dag>, /runs, /d/<deployment>/runs/<run> (and its tasks’ panels and log tails), /deployments, /metrics, /workers, /connections (and its checks and tests), the actions (POSTs, see actions), /events, /time, /assets/..., /docs/.... Every answer varies with X-Forwarded-Prefix (its links do), so a cache keeps them apart.