Add real-time GPU usage column to cluster nodes page - displays live VRAM...

Add real-time GPU usage column to cluster nodes page - displays live VRAM usage and GPU utilization with visual progress bars between GPU Memory and Workers columns
parent ad06a6fa
...@@ -99,6 +99,7 @@ ...@@ -99,6 +99,7 @@
<th>Weight</th> <th>Weight</th>
<th>GPUs</th> <th>GPUs</th>
<th>GPU Memory</th> <th>GPU Memory</th>
<th>GPU Usage</th>
<th>Workers</th> <th>Workers</th>
<th>IP Address</th> <th>IP Address</th>
<th>Uptime</th> <th>Uptime</th>
...@@ -109,7 +110,7 @@ ...@@ -109,7 +110,7 @@
</thead> </thead>
<tbody id="nodesTableBody"> <tbody id="nodesTableBody">
<tr> <tr>
<td colspan="12" style="text-align: center; color: #6b7280;">Loading cluster nodes...</td> <td colspan="13" style="text-align: center; color: #6b7280;">Loading cluster nodes...</td>
</tr> </tr>
</tbody> </tbody>
</table> </table>
...@@ -167,7 +168,7 @@ function updateNodesTable() { ...@@ -167,7 +168,7 @@ function updateNodesTable() {
.catch(error => { .catch(error => {
console.error('Error fetching nodes:', error); console.error('Error fetching nodes:', error);
document.getElementById('nodesTableBody').innerHTML = document.getElementById('nodesTableBody').innerHTML =
'<tr><td colspan="11" style="text-align: center; color: #dc2626;">Error loading cluster nodes</td></tr>'; '<tr><td colspan="12" style="text-align: center; color: #dc2626;">Error loading cluster nodes</td></tr>';
}); });
} }
...@@ -175,7 +176,7 @@ function renderNodesTable() { ...@@ -175,7 +176,7 @@ function renderNodesTable() {
const tbody = document.getElementById('nodesTableBody'); const tbody = document.getElementById('nodesTableBody');
if (nodesData.length === 0) { if (nodesData.length === 0) {
tbody.innerHTML = '<tr><td colspan="11" style="text-align: center; color: #6b7280;">No cluster nodes found</td></tr>'; tbody.innerHTML = '<tr><td colspan="12" style="text-align: center; color: #6b7280;">No cluster nodes found</td></tr>';
return; return;
} }
...@@ -185,6 +186,10 @@ function renderNodesTable() { ...@@ -185,6 +186,10 @@ function renderNodesTable() {
<td>${node.hostname}</td> <td>${node.hostname}</td>
<td>${node.weight || 100}</td> <td>${node.weight || 100}</td>
<td>${node.gpus}</td> <td>${node.gpus}</td>
<td>
${node.gpu_memory.length > 0 ? node.gpu_memory.join('<br>') : 'No GPU info'}
${node.total_memory > 0 ? `<br><strong>Total: ${node.total_memory}GB</strong>` : ''}
</td>
<td> <td>
${node.gpu_usage_info && node.gpu_usage_info.length > 0 ? node.gpu_usage_info.map(gpu => ` ${node.gpu_usage_info && node.gpu_usage_info.length > 0 ? node.gpu_usage_info.map(gpu => `
<div class="gpu-info" style="margin-bottom: 0.5rem;"> <div class="gpu-info" style="margin-bottom: 0.5rem;">
...@@ -199,8 +204,7 @@ function renderNodesTable() { ...@@ -199,8 +204,7 @@ function renderNodesTable() {
</span> </span>
</div> </div>
</div> </div>
`).join('') : node.gpu_memory.length > 0 ? node.gpu_memory.join('<br>') : 'No GPU info'} `).join('') : 'No real-time data'}
${node.total_memory > 0 ? `<br><strong>Total: ${node.total_memory}GB</strong>` : ''}
</td> </td>
<td> <td>
<strong>${node.workers_available}</strong> workers<br> <strong>${node.workers_available}</strong> workers<br>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment