fix(docs-ci): unblock hardware index regeneration
All checks were successful
Build docs site / build (push) Successful in 31s
Build slides / build (push) Successful in 54s

- Add `staging` to allowed status enum so mfXX hosts validate.
- fmt_nic and fmt_storage now accept lists (mf00 has 3 NICs and 4 drives).
- Rename makerfloss.md -> makerfloss.eu.md so filename matches the FQDN.
- Regenerate docs/hardware/index.md.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
sjat 2026-05-18 15:14:46 +02:00
parent 70cb6759bd
commit 03b2430e7a
4 changed files with 38 additions and 19 deletions

View file

@ -2,15 +2,12 @@
_Auto-generated from `docs/hardware/*.md` — do not edit by hand. Run `make docs-index` after changing a file._ _Auto-generated from `docs/hardware/*.md` — do not edit by hand. Run `make docs-index` after changing a file._
## Laptops
| Hostname | Model | Location | CPU | RAM | Storage | NIC | Status |
|---|---|---|---|---|---|---|---|
| [tembo](tembo.md) | ThinkPad T480 | Orange Makerspace (kiosk) | Intel Core i5-8350U · 4c/8t | 16 GB | 512 GB NVME | 1 GbE | in-use |
## Servers ## Servers
| Hostname | Model | Location | CPU | RAM | Storage | NIC | Status | | Hostname | Model | Location | CPU | RAM | Storage | NIC | Status |
|---|---|---|---|---|---|---|---| |---|---|---|---|---|---|---|---|
| [fisi](fisi.md) | HP MicroServer Gen10 Plus | home rack | Xeon E-2226G · 6c/12t | 64 GB | 8 TB HDD | 1 GbE | in-use | | [makerfloss.eu](makerfloss.eu.md) | Hetzner CX22 | Hetzner HEL1 (cloud) | AMD EPYC (shared vCPU) · 2c | 4 GB | 40 GB NVME | 1 GbE | in-use |
| [makerfloss](makerfloss.md) | Hetzner CX22 | Hetzner HEL1 (cloud) | AMD EPYC (shared vCPU) · 2c | 4 GB | 40 GB NVME | 1 GbE | in-use | | [mf00](mf00.md) | Fractal | The pile | Intel Core i5-6600 @3.30GHz · 4c | 32 GB | 256 GB SSD + 1 TB HDD + 1 TB HDD + 1 TB NVME | 1/2.5/10 GbE | staging |
| [mf01](mf01.md) | HP Elitedesk 800 G4 TWR | The pile | Intel Core i5-8500 @ 3.00GHz · 6c | 8 GB | 40 GB NVME | 1 GbE | staging |
| [mf02](mf02.md) | HP Elitedesk 800 G4 TWR | The pile | Intel Core i5-8500 @ 3.00GHz · 6c | 8 GB | 40 GB NVME | 1 GbE | staging |
| [mf03](mf03.md) | VisionComputer | The pile | Intel Core i5-3570K @ 3.40GHz · 4c | 8 GB | 500 GB HDD | 1 GbE | staging |

View file

@ -75,27 +75,49 @@ def fmt_ram(fm: dict) -> str:
return f"{n} GB" if isinstance(n, int) else "" return f"{n} GB" if isinstance(n, int) else ""
def _fmt_size_gb(n: int) -> str:
if n >= 1000 and n % 1000 == 0:
return f"{n // 1000} TB"
if n >= 1000:
return f"{n / 1000:.1f} TB"
return f"{n} GB"
def fmt_storage(fm: dict) -> str: def fmt_storage(fm: dict) -> str:
drives = fm.get("storage")
if isinstance(drives, list) and drives:
parts = []
for d in drives:
gb = d.get("gb")
t = (d.get("type") or "").upper()
if isinstance(gb, int):
parts.append(f"{_fmt_size_gb(gb)} {t}".strip())
elif t:
parts.append(t)
return " + ".join(parts)
n = fm.get("storage_gb") n = fm.get("storage_gb")
t = fm.get("storage_type", "").upper() if fm.get("storage_type") else "" t = fm.get("storage_type", "").upper() if fm.get("storage_type") else ""
if not isinstance(n, int): if not isinstance(n, int):
return t # type alone if no capacity return t # type alone if no capacity
if n >= 1000 and n % 1000 == 0: return f"{_fmt_size_gb(n)} {t}".strip()
size = f"{n // 1000} TB"
elif n >= 1000:
size = f"{n / 1000:.1f} TB"
else:
size = f"{n} GB"
return f"{size} {t}".strip()
def fmt_nic(fm: dict) -> str: def fmt_nic(fm: dict) -> str:
g = fm.get("nic_gbps") g = fm.get("nic_gbps")
if g is None: if g is None:
return "" return ""
if isinstance(g, float) and not g.is_integer():
return f"{g} GbE" def one(v: float | int) -> str:
return f"{int(g)} GbE" if isinstance(v, float) and not v.is_integer():
return f"{v}"
return f"{int(v)}"
if isinstance(g, list):
if not g:
return ""
return "/".join(one(v) for v in g) + " GbE"
return f"{one(g)} GbE"
def cell(fm: dict, col: dict) -> str: def cell(fm: dict, col: dict) -> str:

View file

@ -14,7 +14,7 @@ hardware:
- status - status
enums: enums:
kind: [server, laptop, sbc, switch, ap, desktop] kind: [server, laptop, sbc, switch, ap, desktop]
status: [in-use, spare, broken, donated] status: [in-use, staging, spare, broken, donated]
storage_type: [nvme, ssd, hdd, mixed] storage_type: [nvme, ssd, hdd, mixed]
group_by: kind group_by: kind
# Human-friendly H2 names per group_by value. Anything missing falls back # Human-friendly H2 names per group_by value. Anything missing falls back