feature: Add editable hostname and operating system
Release / Build and Push Docker Image (push) Successful in 4m56s

This commit is contained in:
Keith Solomon
2026-04-14 07:42:39 -05:00
parent 1d9e98872c
commit d10e533793
8 changed files with 192 additions and 7 deletions
+13
View File
@@ -19,6 +19,7 @@ from .service import (
fetch_scans,
mark_missing_devices,
scan_state,
update_device_identity,
upsert_host,
)
@@ -60,6 +61,18 @@ def api_device(device_id: int) -> dict:
return device
@app.patch("/api/devices/{device_id}")
def api_update_device(device_id: int, payload: dict[str, Any]) -> dict:
device = update_device_identity(
device_id,
str(payload.get("hostname") or ""),
str(payload.get("os_name") or ""),
)
if not device:
raise HTTPException(status_code=404, detail="Device not found")
return device
@app.get("/api/scans")
def api_scans(limit: int = 20) -> list[dict]:
return fetch_scans(limit=limit)