Fix Set Driver modal functionality

- Added workers array to local node API response for modal population
- Fixed table colspan values to match 13 columns
- Removed debug console.log statements
- Modal should now open and show worker driver selection options
parent 314a1125
...@@ -109,7 +109,7 @@ ...@@ -109,7 +109,7 @@
</thead> </thead>
<tbody id="nodesTableBody"> <tbody id="nodesTableBody">
<tr> <tr>
<td colspan="8" 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 +167,7 @@ function updateNodesTable() { ...@@ -167,7 +167,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="13" style="text-align: center; color: #dc2626;">Error loading cluster nodes</td></tr>';
}); });
} }
......
...@@ -563,6 +563,17 @@ def api_cluster_nodes(): ...@@ -563,6 +563,17 @@ def api_cluster_nodes():
# Use the longest uptime as representative # Use the longest uptime as representative
max_uptime = max((w.get('uptime_seconds', 0) for w in local_workers), default=0) max_uptime = max((w.get('uptime_seconds', 0) for w in local_workers), default=0)
# Create worker info for local workers
local_worker_info = []
for worker in local_workers:
local_worker_info.append({
'type': worker['type'],
'backend': worker['backend'],
'weight': worker.get('weight', 10),
'model': 'default',
'status': 'active'
})
local_node = { local_node = {
'token': 'local', 'token': 'local',
'token_name': 'Local Master Node', 'token_name': 'Local Master Node',
...@@ -573,6 +584,7 @@ def api_cluster_nodes(): ...@@ -573,6 +584,7 @@ def api_cluster_nodes():
'workers_available': len(local_workers), 'workers_available': len(local_workers),
'worker_types': worker_types, 'worker_types': worker_types,
'workers_summary': ', '.join(worker_types) if worker_types else 'No workers', 'workers_summary': ', '.join(worker_types) if worker_types else 'No workers',
'workers': local_worker_info, # Add workers array for modal
'ip_address': '127.0.0.1', 'ip_address': '127.0.0.1',
'connected': True, 'connected': True,
'last_seen': current_time, 'last_seen': current_time,
......
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