diff --git a/docs/hardware/index.md b/docs/hardware/index.md index 54725e4..a3a2713 100644 --- a/docs/hardware/index.md +++ b/docs/hardware/index.md @@ -7,7 +7,8 @@ _Auto-generated from `docs/hardware/*.md` — do not edit by hand. Run `make doc | Hostname | Model | Location | CPU | RAM | Storage | NIC | Status | |---|---|---|---|---|---|---|---| | [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 | +| [mf00](mf00.md) | custom | The pile | ? | ? | ? | ? | 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 | +| [mf02](mf02.md) | HP Elitedesk 800 G4 TWR | The pile | Intel Core i5-8500 @ 3.00GHz · 6c | 16 GB | 40 GB NVME | 1 GbE | staging | +| [mf03](mf03.md) | custom | The pile | Intel Core i5-3570K @ 3.40GHz · 4c | 8 GB | 500 GB HDD | 1 GbE | staging | +| [mf04](mf04.md) | custom | The pile | Intel Core i5-3570K @ 3.40GHz · 4c | 8 GB | 500 GB HDD | 1 GbE | staging | diff --git a/docs/hardware/mf00.md b/docs/hardware/mf00.md index b6507d8..9c181a3 100644 --- a/docs/hardware/mf00.md +++ b/docs/hardware/mf00.md @@ -4,12 +4,12 @@ kind: server status: staging model: custom location: The pile -cpu: ? -cpu_cores: ? -cpu_threads: ? -ram_gb: ? -storage: ? -nic_gbps: ? +cpu: "?" +cpu_cores: "?" +cpu_threads: "?" +ram_gb: "?" +storage: "?" +nic_gbps: "?" --- ## Notes diff --git a/scripts/gen_overview.py b/scripts/gen_overview.py index 84a16f4..d4e86da 100755 --- a/scripts/gen_overview.py +++ b/scripts/gen_overview.py @@ -64,20 +64,24 @@ def validate(path: Path, fm: dict, cfg: dict) -> None: def fmt_cpu(fm: dict) -> str: - model = fm.get("cpu", "") + model = fm.get("cpu") or "" cores = fm.get("cpu_cores") threads = fm.get("cpu_threads") suffix = "" - if cores and threads and threads != cores: + if isinstance(cores, int) and isinstance(threads, int) and threads != cores: suffix = f" · {cores}c/{threads}t" - elif cores: + elif isinstance(cores, int): suffix = f" · {cores}c" - return (model + suffix).strip() + return (str(model) + suffix).strip() def fmt_ram(fm: dict) -> str: n = fm.get("ram_gb") - return f"{n} GB" if isinstance(n, int) else "" + if isinstance(n, int): + return f"{n} GB" + if isinstance(n, str) and n: + return n + return "" def _fmt_size_gb(n: int) -> str: @@ -100,6 +104,8 @@ def fmt_storage(fm: dict) -> str: elif t: parts.append(t) return " + ".join(parts) + if isinstance(drives, str) and drives: + return drives n = fm.get("storage_gb") t = fm.get("storage_type", "").upper() if fm.get("storage_type") else "" @@ -110,8 +116,10 @@ def fmt_storage(fm: dict) -> str: def fmt_nic(fm: dict) -> str: g = fm.get("nic_gbps") - if g is None: + if g is None or g == "": return "" + if isinstance(g, str): + return g def one(v: float | int) -> str: if isinstance(v, float) and not v.is_integer():