diff --git a/docs/ARCHITECTURE.md b/docs/ARCHITECTURE.md index e5e771af..69c2804f 100644 --- a/docs/ARCHITECTURE.md +++ b/docs/ARCHITECTURE.md @@ -433,9 +433,13 @@ Pages, routes and what each page shows or triggers are specified in the component tree, at the cost of `ApplicationViewService` being a fairly wide surface (one method per page/section). - **`Components\Common`** holds cross-page building blocks: loading - skeletons and the vulnerability widgets shared between the + skeletons (the detail page skeleton among them) and the vulnerability + widgets shared between the Vulnerabilities page and image/container detail pages, the - `ContainerActionConfirmation` dialog, and the status chip, scan status + `ContainerActionConfirmation` dialog, the resource history chart (SVG paths + from one path builder shared with the Runtime Containers list, + [decision 0083](decisions/0083-resource-histories-are-drawn-as-svg-sparklines-from-one-shared-path-builder.md)), + and the status chip, scan status indicator, severity bar, page header and section panel, which take their tone from `UI\StatusToneFormatter` ([decision 0079](decisions/0079-statuses-map-to-tones-in-one-mapping-beside-the-chip-colors-of-unconverted-pages.md)). diff --git a/docs/areas/README.md b/docs/areas/README.md index 2dbc11a7..916a7eeb 100644 --- a/docs/areas/README.md +++ b/docs/areas/README.md @@ -40,5 +40,6 @@ operator or another component can rely on — formats, limits, error behavior, g | [Container actions](container-actions.md) | Portainer endpoints and authentication, insecure HTTP opt-in, start/stop/restart of containers, when they are offered, and their recorded runs | Container discovery (Docker instances) | | [Scan engine](scan-engine.md) | Background jobs and their intervals, dynamic own-image interval, overlap rules, scan runs, crash recovery, retention and cleanup, single-instance assumption | What a scan evaluates (the feature areas) | | [Web UI](web-ui.md) | Pages and routes, what each page shows and triggers, dashboard refresh, error and not-found pages, theme | How the shown values are computed (the feature areas) | +| [Detail pages](detail-pages.md) | Layout and contents of the detail pages: header, details column, panels in order, resource history charts | Routes, actions table, shared display and errors (Web UI); how values are computed (the feature areas) | | [Telemetry](telemetry.md) | Logs, traces and metrics, OTLP export, activity and instrument names, inventory gauges, what never reaches telemetry | Deployment of the observability stack (`INSTALL.md`) | diff --git a/docs/areas/detail-pages.md b/docs/areas/detail-pages.md new file mode 100644 index 00000000..6cd9c868 --- /dev/null +++ b/docs/areas/detail-pages.md @@ -0,0 +1,107 @@ +# Detail pages + +## Scope + +The layout and contents of the detail pages, so far the Runtime Container detail: its header, the details column, the +panels of the main column in order and the resource history charts. Operators rely on it to find a container's state +at a glance. + +## Behavior + +### Runtime Container detail header + +- The header shows the breadcrumb `Runtime Containers / {container name}`, the first part linking to + `/runtime-containers`, and the container name as the page title. Beside the title stand two status chips: the + runtime status and the update state, the latter as `{state} · {available version}` when an available version is + known and as the state alone otherwise. Both take their tone from the shared mapping + ([Web UI](web-ui.md#shared-display)), so a status without a tone, such as `Exited` or `Not evaluated`, is neutral. +- Under the title, the line `{instance name} · observed {date and time}` links the instance name to its page. + The browser tab reads `Runtime Container Detail`. +- A page whose container is unknown or whose load failed shows the title `Runtime Container Detail` and the + breadcrumb link `Runtime Containers` only, with the not-found note of [Web UI](web-ui.md#general) or the load alert of [Web UI](web-ui.md#limits-and-errors), no chips, + no description line and no columns. While loading, the page shows a skeleton of the header and of both columns. + +### Layout + +- Below 960 px the page is one column, the *Details* panel directly after the header and before every other panel. + From 960 px the main column stands left and the *Details* panel right, 320 px wide and top-aligned, 24 px apart; the + main column is at least 560 px wide. In the markup the *Details* panel always precedes the main column. Both columns + may shrink below their content, so wide values wrap instead of overflowing the page. +- Below 960 px the tables show as cards and the three usage cells stack. + +### Details panel + +The panel lists these entries in order, each with a muted label, a semibold value and muted lines, separated by +hairlines: + +1. *Runtime image*: the image reference; for an alias tag `{tag} · {resolved version}`; the short digest + `@sha256:…` in a monospace font, with the full digest as its tooltip. +2. *Compose project and service*, only when the project, stack or service is known: + `{project, else stack, else Standalone} · {service, else No service label}`. +3. *Observed own image*: a link to the own image, else `No linked own image`. +4. *Update assessment*: the update state like the header chip, and the update message when there is one. +5. *Base runtime*, only with a base runtime alert: the chip `Runtime warning` (warning tone) for a container linked to + an own image, else `Runtime hint` (info tone), then the summary and the details when present. +6. *Vulnerabilities*: the vulnerability assessment as [Vulnerabilities](vulnerabilities.md) defines it, with one + `Checked {date and time}` line when the image was checked and none otherwise, and the text button `Rescan`, + announced as `Rescan vulnerabilities`. A rescan refreshes the container's current image version and reloads the page; + a failure shows `Vulnerability rescan failed: {reason}` under the assessment. +7. *Base image vulnerabilities*, only when base images have active findings: the chip `Findings detected` in the + warning tone and the summary. + +### Main column + +The panels follow in this order, without description lines except where stated: + +1. *Container actions*, only when [Web UI](web-ui.md#container-actions-section) shows it, with its description as a + muted line. +2. *Resource usage*, meta text `Current value and the last 24 hours`: three cells `CPU`, `Memory` and `Network`, each + with the current value (`n/a` without a current sample) in 24 px type and, with samples, a chart. Without samples + the cells show no chart and the panel says `No resource history is currently stored for this container.` +3. *Available tag candidates*: a muted line `Manual tag preference: none.` or `Manual tag preference: {image}, saved + {date and time}.` followed by `Selecting a tag stores a preference; it does not change or redeploy the container.`; + `Clear selection` in the panel header with a stored preference; the info chip `Updating may resolve up to {n} of + {m} active findings` when updating can fix findings; the table `Tag`, `Digest`, `Reason`, `Published` (`—` when + unknown) and `Action`. A candidate the update assessment recommends carries the chip `Recommended` (success + tone), the stored preference the chip `Selected` (info tone) and the button `Saved` instead of `Select`. +4. *Update findings*. +5. *Vulnerability findings*, meta text `{n} active · checked {date and time}`, or `{n} active` when never checked, with + the findings table flush in the panel. +6. *Base image chain* with `Depth`, `Base image`, `Source` and `Vulnerabilities` (status chip, severity chips and + `{n} active · {source}`). +7. *Scan history*, the scans of the 20 most recent snapshots, the status as the scan status indicator. + +Without candidates, update findings or base image chain the panel says `No tag candidates are currently stored for this container.`, `No update findings are currently stored for this container.` or `No base image chain is currently stored for this runtime image.` + +### Resource history charts + +- A chart shows the stored samples of the last 24 hours, at most 48, oldest at the left, 72 px high and without axes. + CPU and memory draw a line over an area fill, network two lines (received, sent) on one scale. Each chart is + announced as an image named `CPU history, last 24 hours`, `Memory history, last 24 hours` or `Network history, last + 24 hours`. +- One sample, or samples that are all equal, draw a flat line at mid-height; the same holds for the sparklines of the + Runtime Containers list, whose series keep their own scales. The stroke is 1.5 px wide whatever the chart's width, and + the colors come from the chart tokens of both themes. +- Under each chart one muted line gives the range of the period: `Min {cpu} · max {cpu}`, `Min {memory} · max {memory}` + (memory used, without the limit) and `Max {received} ↓ / {sent} ↑`. + +## Limits and errors + +- Saving or clearing a tag preference and the container actions report failures as [Web UI](web-ui.md) states; a + result or error of an earlier route is not shown on a new one. +- The page shows the 20 most recent scan snapshots and the 20 most recent action runs, and at most 48 samples per chart. + +## Related decisions + +- [`decisions/0083-resource-histories-are-drawn-as-svg-sparklines-from-one-shared-path-builder.md`](../decisions/0083-resource-histories-are-drawn-as-svg-sparklines-from-one-shared-path-builder.md) + — the charts and the list's sparklines share one path builder. +- [`decisions/0059-a-detail-page-shows-a-missing-record-or-a-failed-load-inline.md`](../decisions/0059-a-detail-page-shows-a-missing-record-or-a-failed-load-inline.md) + — a missing record or a failed load shows inline under the page header. + +## Not here + +- Routes, the actions table, shared display and error behavior in [Web UI](web-ui.md). +- How update states, tag candidates, vulnerability values and resource values are computed in + [Update detection](update-detection.md), [Vulnerabilities](vulnerabilities.md) and + [Docker instances](docker-instances.md). +- The other detail pages, which join this area when they are converted. diff --git a/docs/areas/vulnerabilities.md b/docs/areas/vulnerabilities.md index 059b7a52..6c4f08eb 100644 --- a/docs/areas/vulnerabilities.md +++ b/docs/areas/vulnerabilities.md @@ -45,7 +45,7 @@ All keys live under `DockerUpdateGuard:Vulnerabilities`: - A full refresh runs on the schedule `DockerUpdateGuard:Scanning:VulnerabilityRefreshIntervalMinutes` (default `180`, range `1`–`10080`, see [Scan engine](scan-engine.md)) and can be started manually from the scan history page. - A **manual rescan** of a single image version can be started from the observed image, own image and runtime - container lists. It follows the same rules for that one image version. An image version that does not exist is + container lists and from the runtime container detail page. It follows the same rules for that one image version. An image version that does not exist is ignored without a scan run. - Every refresh is recorded as one scan run of type *vulnerability* with trigger *scheduled* or *manual*, also when it covers no image version. diff --git a/docs/areas/web-ui.md b/docs/areas/web-ui.md index 646b647b..1ef07170 100644 --- a/docs/areas/web-ui.md +++ b/docs/areas/web-ui.md @@ -37,7 +37,7 @@ to read the state the other areas compute and to start manual scans; it computes - Timestamps are shown in UTC as `yyyy-MM-dd HH:mm UTC`, the same for every browser and independent of the time zone and culture of the server process. The resource chart labels are UTC too: the first and the last label read `MM-dd HH:mm UTC`, the visible labels between them `HH:mm`. -- The scan status chips of the scan history, observed image, My Images, runtime container and image detail +- The scan status chips of the scan history, observed image, My Images and image detail pages share one color mapping: `Succeeded` green, `Partial` and `Pending` orange, `Failed` red, `Running` blue; any other value, such as `NotSet` or `NotScanned`, stays neutral. The chip text is the status name. - While a page loads its data it shows placeholder skeletons; a list without data shows an explanatory empty state. A @@ -55,7 +55,7 @@ to read the state the other areas compute and to start manual scans; it computes ### Shared display - The shared components show a status as a chip in the tone of its text, compared ignoring letter case: green for - `Succeeded`, `Up to date` and `No findings`; orange for `Partial`, `Update available`, `Paused` and `Restarting`; + `Succeeded`, `Up to date` and `No findings`; orange for `Partial`, `Requested`, `Update available`, `Paused` and `Restarting`; red for `Failed`; blue for `Running` and `Manual review required`; every other text, an unknown, empty or missing one included, is neutral. A status chip takes its colors from the theme's chip color pairs; the scan status indicator shows a dot in the tone's color beside the status text, which alone carries the meaning. @@ -81,7 +81,7 @@ to read the state the other areas compute and to start manual scans; it computes | `/observed-images` | Observed Images | The registration form and the manually registered images with latest scan, active update findings, derived-runtime hint and vulnerability status | | `/observed-images/{id}` | Observed Image detail | One observed image: reference, latest scan, whether it is an own or a manual image, derived-runtime hint, running containers (own images only), base image chain, vulnerability findings and update findings with tag candidates; no scan history | | `/runtime-containers` | Runtime Containers | A panel `Container inventory` with the meta text `{n} containers on {m} Docker instances`; seven columns: container (name, tag with the version an alias resolves to, link to the own image), instance, CPU, memory and network usage with a trend of up to the 12 latest samples, update state with the available version, and vulnerabilities (chip, count line, last check, rescan, base image warning); [0082](../decisions/0082-the-runtime-container-list-names-the-highest-active-severity-and-keeps-a-failed-checks-status-beside-it.md) | -| `/runtime-containers/{instanceId}/{containerId}` | Runtime Container detail | One container: image and digest, Compose project, linked own image, update state and message, derived-runtime hint, base image chain, resource usage history, manual tag preference, available tag candidates, update findings, vulnerability findings and the scans of its 20 most recent snapshots; for a container of a Docker instance with Portainer enabled, the *Container actions* section with the 20 most recent action runs of the container | +| `/runtime-containers/{instanceId}/{containerId}` | Runtime Container detail | One container, laid out as [Detail pages](detail-pages.md) describes; with Portainer enabled for its Docker instance, a *Container actions* panel with the 20 most recent action runs of the container | | `/docker-instances` | Docker Instances | Configured Docker instances with endpoint, connection kind, latest runtime scan status and time, current resource usage and number of containers; with exactly one instance its current usage and usage history are shown on this page directly | | `/docker-instances/{id}` | Docker Instance detail | The containers currently observed on one instance with linked own image and resource usage | | `/base-images` | Shared Base Images | Base images used by two or more enabled images or containers, with the images built on them, the containers and number of enabled observed images that use them, and their vulnerability status | @@ -107,7 +107,7 @@ to read the state the other areas compute and to start manual scans; it computes | Register and scan | Observed Images | Registers an image from name (trimmed), image reference and optional description ([Image catalog](image-catalog.md)), scans it immediately as a manual observed-image scan and opens its detail page; a reference already tracked as an enabled own image is rejected with an `Open own image` link to that image and starts no scan | | Check image updates | Runtime Containers | Runs a manual runtime container scan of all enabled Docker instances | | Refresh vulnerabilities | Scan History, shown only when vulnerability scanning is enabled | Runs a manual vulnerability refresh of all live images; the page also shows when the next scheduled refresh is expected | -| Rescan (per image) | Observed Images, My Images, Runtime Containers | Runs a manual vulnerability refresh of that one image version; with it the time of the last check or "Never scanned"; the button is announced as `Rescan vulnerabilities` | +| Rescan (per image) | Observed Images, My Images, Runtime Containers, Runtime Container detail (text button `Rescan`, without its own last-check line) | Runs a manual vulnerability refresh of that one image version; with it the time of the last check or "Never scanned"; the button is announced as `Rescan vulnerabilities` | | Select / Clear selection | Runtime Container detail | Stores or removes a manual tag preference for that container ([Update detection](update-detection.md)); it does not change or redeploy the container | | Start / Stop / Restart | Runtime Container detail, *Container actions* section | Starts, stops or restarts that container through Portainer after a confirmation, and records the action as an action run ([Container actions](container-actions.md)) | @@ -129,15 +129,15 @@ to read the state the other areas compute and to start manual scans; it computes ### Container actions section -- The runtime container detail page shows a *Container actions* section directly after the container summary when +- The runtime container detail page shows a *Container actions* panel, the first of the main column ([Detail pages](detail-pages.md)), when [Container actions](container-actions.md#container-availability) says it is shown. The page asks only once it is interactive, never while the server renders it first (the check contacts Portainer), and again when the route changes to another container; until the answer arrives, and for a Docker instance that is disabled or has Portainer disabled, no section appears. If the question itself fails, the section stays hidden and the failure is logged as user action `LoadContainerActions`. - The section holds, in this order: - 1. the heading `Container actions` with the description `Start, stop or restart this container through Portainer. - Every action asks for confirmation and is recorded.`; + 1. the panel title `Container actions` with the description `Start, stop or restart this container through Portainer. + Every action asks for confirmation and is recorded.` as a muted line; 2. the note `Runtime status as of the last runtime scan (