{% extends "ui/_layout.html" %}
{% block title %}{% if section == "downloads" %}Downloads{% elif section == "hashes" %}Hashes{% else %}Images{% endif %} - bty-web{% endblock %}
{% block subnav %}
{# In-page jump links to the page's two tables (the main list + the
activity table), separated by a vertical rule. The List anchor points
at whichever table this section shows (catalog / downloads / hashes);
Activity points at the shared image-catalog activity table. #}
{% endblock %}
{% block intro %}
{% from "ui/_intro_box.html" import render as intro_box %}
{% call intro_box() %}
{% if section == "downloads" %}
Add a single image (upload a local file, or add one by
http(s):// / oras:// URL) and watch the live fetch jobs below.
Reach this page any time from the downloads
indicator in the navbar, right of Settings.
{% elif section == "hashes" %}
Background SHA-256 hashing of files under
{{ image_root }}: dropped-in images are hashed
automatically (one at a time by default, so small hardware stays
responsive). Reach this page from the hashes
indicator in the navbar.
{% else %}
Pre-built system images bty flashes onto target disks, content-
addressed by sha256. This is the merged catalog (dir scan +
catalog entries): its header carries Fetch latest catalog
(pull the bty release catalog) and Upload catalog
(a catalog.toml). Files dropped into {{ image_root }}
are picked up and hashed automatically; add individual images from
the Downloads page.
{% endif %}
{% endcall %}
{% endblock %}
{% block content %}
{% if section == "downloads" %}
{# Downloads: the two add-image controls (add by URL, upload a local
file) live inline in the table header, split by a vertical rule; the
live download-jobs table is below. #}
| Name | Status | Progress | Bytes | Action |
|---|---|---|---|---|
| No downloads yet. | ||||
| Name | Status | Progress | Bytes | Action |
|---|---|---|---|---|
| No hashes yet. | ||||
| Name(s) | {# Observed content sha (``disk_image_sha`` on the catalog row). Machines bind via ``bty_image_ref`` -- shown in the machine- detail picker, not here. #}Content SHA | Format | Sources | Cached | Action |
|---|---|---|---|---|---|
{% for n in u.names %}
{{ n }}{% if not loop.last %}, {% endif %}
{% endfor %}
|
{% if u.sha256 %}
{{ u.sha256[:12] }}...
{% else %}
unhashed
{% endif %}
|
{{ u.format or "?" }} |
{% for s in u.sources %}
{% if s.kind == "local" %}
{{ s.location }}
{% elif s.kind == "url" %}
{{ s.location }}
{% else %}
{{ s.location }}
{% endif %}
{% if not loop.last %}{% endif %} {% endfor %} |
{% if u.cached %} cached {% else %} available {% endif %} |
{# Dispatch by source shape, not just sha presence:
- Has a ``local`` source and no sha -> the file is
on disk and just needs hashing. Hash button.
- No local source -> bytes need fetching. Fetch
button. Works for un-sha'd URL / oras entries
(the DownloadManager downloads + computes sha +
back-fills catalog_entries.disk_image_sha) AND
for sha-pinned entries not yet in cache.
Previously every un-sha'd entry rendered the
Hash button, which 404'd on URL-only rows
because HashManager requires a local file. #}
{% set has_local = u.sources|selectattr('kind','equalto','local')|list|length > 0 %}
{% if not u.sha256 and has_local %}
{% elif not u.cached %}
{% endif %}
{# Evict cached bytes. Available for any entry
whose bytes are in the cache dir
(``$BTY_STATE_DIR/cache/ |
No images yet. Use Fetch latest or
Upload above, or drop a
.qcow2 / .img /
.img.zst / .img.xz /
.img.gz / .img.bz2 file into
{{ image_root }}.
| |||||