Types, types, types...
This commit is contained in:
@ -72,16 +72,30 @@ document.addEventListener('DOMContentLoaded', () => {
|
||||
<p><strong>UUID:</strong> ${rowNode.uuid}</p>
|
||||
<p><strong>IP:</strong> ${rowNode.ip}</p>
|
||||
<p><strong>Last Seen:</strong> ${new Date(rowNode.last_seen).toLocaleTimeString()}</p>
|
||||
<p><strong>Uptime:</strong> ${rowNode.uptime_seconds ? formatUptime(rowNode.uptime_seconds) : 'N/A'}</p>
|
||||
<p><strong>Load Avg (1m, 5m, 15m):</strong> ${rowNode.load_avg ? rowNode.load_avg.map(l => l.toFixed(2)).join(', ') : 'N/A'}</p>
|
||||
<p><strong>Memory Usage:</strong> ${rowNode.memory_usage_percent ? rowNode.memory_usage_percent.toFixed(2) + '%' : 'N/A'}</p>
|
||||
<p><strong>Uptime:</strong> ${rowNode.uptime_seconds =! null ? formatUptime(rowNode.uptime_seconds) : 'N/A'}</p>
|
||||
<p><strong>Load Avg (1m, 5m, 15m):</strong> ${
|
||||
Array.isArray(rowNode.load_avg)
|
||||
? rowNode.load_avg.map(l => l.toFixed(2)).join(', ')
|
||||
: 'N/A'
|
||||
}</p>
|
||||
<p><strong>Memory Usage:</strong> ${
|
||||
rowNode.memory_usage_percent != null
|
||||
? rowNode.memory_usage_percent.toFixed(2) + '%'
|
||||
: 'N/A'
|
||||
}</p>
|
||||
</div>
|
||||
`;
|
||||
} else {
|
||||
// Off-diagonal: show ping latency
|
||||
const latency = rowNode.connections && colNode.uuid in rowNode.connections && rowNode.connections[colNode.uuid] !== null ? rowNode.connections[colNode.uuid] : null;
|
||||
const displayLatency = latency !== null && !isNaN(latency) ? `${latency.toFixed(1)} ms` : 'N/A';
|
||||
const latencyClass = latency !== null && !isNaN(latency) ? getLatencyClass(latency) : 'latency-unavailable';
|
||||
const latency = (
|
||||
rowNode.connections &&
|
||||
colNode.uuid in rowNode.connections &&
|
||||
rowNode.connections[colNode.uuid] !== null
|
||||
) ? rowNode.connections[colNode.uuid] : null;
|
||||
|
||||
const displayLatency = (latency != null && !isNaN(latency)) ? `${latency.toFixed(1)} ms` : 'N/A';
|
||||
const latencyClass = (latency != null && !isNaN(latency)) ? getLatencyClass(latency) : 'latency-unavailable';
|
||||
|
||||
cell.classList.add(latencyClass);
|
||||
cell.innerHTML = `
|
||||
<div class="conn-status-text">Ping: ${displayLatency}</div>
|
||||
|
Reference in New Issue
Block a user