diff --git a/docs/hardware/index.md b/docs/hardware/index.md index 032af47..54725e4 100644 --- a/docs/hardware/index.md +++ b/docs/hardware/index.md @@ -2,15 +2,12 @@ _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 | 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](makerfloss.md) | Hetzner CX22 | Hetzner HEL1 (cloud) | AMD EPYC (shared vCPU) · 2c | 4 GB | 40 GB NVME | 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 | +| [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 | diff --git a/docs/hardware/makerfloss.md b/docs/hardware/makerfloss.eu.md similarity index 100% rename from docs/hardware/makerfloss.md rename to docs/hardware/makerfloss.eu.md diff --git a/scripts/gen_overview.py b/scripts/gen_overview.py index 7538e0b..b235d88 100755 --- a/scripts/gen_overview.py +++ b/scripts/gen_overview.py @@ -75,27 +75,49 @@ def fmt_ram(fm: dict) -> str: 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: + 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") t = fm.get("storage_type", "").upper() if fm.get("storage_type") else "" if not isinstance(n, int): return t # type alone if no capacity - if n >= 1000 and n % 1000 == 0: - size = f"{n // 1000} TB" - elif n >= 1000: - size = f"{n / 1000:.1f} TB" - else: - size = f"{n} GB" - return f"{size} {t}".strip() + return f"{_fmt_size_gb(n)} {t}".strip() def fmt_nic(fm: dict) -> str: g = fm.get("nic_gbps") if g is None: return "" - if isinstance(g, float) and not g.is_integer(): - return f"{g} GbE" - return f"{int(g)} GbE" + + def one(v: float | int) -> str: + 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: diff --git a/scripts/overview_config.yml b/scripts/overview_config.yml index 97346e4..f5e92c7 100644 --- a/scripts/overview_config.yml +++ b/scripts/overview_config.yml @@ -14,7 +14,7 @@ hardware: - status enums: 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] group_by: kind # Human-friendly H2 names per group_by value. Anything missing falls back