Persist device details by hostname and enhance UI

This commit is contained in:
2025-08-13 00:37:43 -06:00
parent f1fe831911
commit 10c024ddd7
6 changed files with 936 additions and 4 deletions

View File

@@ -35,7 +35,7 @@ function statusFromHeartbeat(tsSec, offlineAfter = 15) {
return now - tsSec <= offlineAfter ? "Online" : "Offline";
}
export default function DeviceList() {
export default function DeviceList({ onSelectDevice }) {
const [rows, setRows] = useState([]);
const [orderBy, setOrderBy] = useState("status");
const [order, setOrder] = useState("desc");
@@ -165,7 +165,12 @@ export default function DeviceList() {
</TableHead>
<TableBody>
{sorted.map((r, i) => (
<TableRow key={r.id || i} hover>
<TableRow
key={r.id || i}
hover
onClick={() => onSelectDevice && onSelectDevice(r)}
sx={{ cursor: onSelectDevice ? "pointer" : "default" }}
>
<TableCell>
<span
style={{