Skip to content

feat(storage): a ZFS tab with the pools, datasets and snapshots (read only) - #157

Merged
inkly merged 1 commit into
mainfrom
feat/zfs-panel
Nov 9, 2026
Merged

inkly merged 1 commit into
mainfrom
feat/zfs-panel

Conversation

@inkly

@inkly inkly commented Nov 9, 2026

Copy link
Copy Markdown
Collaborator

A "ZFS" tab in the Storage manager, first step, read only (design: docs/superpowers/specs/2026-11-09-zfs-storage-design.md in ReCasaOS/CasaOS; request: ReCasaOS/CasaOS discussion 66). Needs ReCasaOS/CasaOS-LocalStorage#27 for GET /v1/disks/zfs, /zfs/snapshots and /zfs/io; without it the tab simply does not appear.

  • The tab is added last (the places of the other tabs do not move) and only when the box answers available with at least one pool. No ZFS, no tab, no message.
  • A card per pool: health tag (green with a check only for ONLINE; DEGRADED orange; the other states and any unknown one red; a pool whose state could not be read is grey "State unknown", never green), layout, drives with the disk they are on, last scan (scrub or resilver, errors count as a problem), data errors, capacity bar (orange from 80 %, red from 90 %), allocated / free / total / fragmentation, live read/write rates, and a "Details" fold with ZFS's own status: / action: lines (English, as ZFS prints them) and the tree of vdevs with their error counters.
  • Datasets as a tree: used bar (used / (used + available), as ZFS counts it with quotas), mount point or why not (not mounted, locked, mounted by the system, volume), available, referenced, space held by snapshots.
  • Snapshots of a dataset are asked for when its list is opened, once.
  • Live rates are the difference between two readings of the pool counters every 3 s; the first reading shows nothing, never "0 B/s".
  • Asks the box only while the tab is on show and the page visible: the list every 15 s, the counters every 3 s; nothing once the tab is left or the panel unmounted.
  • Texts in en_US.json and fr_FR.json, with a test that every key the ZFS code uses is in both and keeps its placeholders.

Tests: ZfsPanel.spec.js (healthy, degraded, unknown state, ZFS not answering, snapshots on demand, rates, polling stops when the tab is left, keys) and zfs.spec.js (tags, thresholds, tree order, mount text, scan sentences, rates, vdev tree). Full suite green (182 files), eslint 0 errors on the changed files, Node 22 + pnpm.

Not checked: the layout in a browser (no box with ZFS here, and the mock server has no ZFS route); the accompanying LocalStorage fixtures are partly written from the OpenZFS docs, see that PR.

… only)

Shows on a box that has ZFS with at least one pool, last in the Storage
manager. Per pool: health (green only for ONLINE, grey when the state could
not be read), drives, last scan, capacity, live read/write rates; the
datasets as a tree with a used bar and mount point; the snapshots of a
dataset when its list is opened. Asks the box only while the tab is on
show. Needs CasaOS-LocalStorage#27; silent without it.
@inkly
inkly merged commit b1a37de into main Nov 9, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant