()
| 21351 | // Update button states |
| 21352 | document.querySelectorAll('.process-sort-btn').forEach(btn => { |
| 21353 | if (btn.dataset.sort === sortBy) { |
| 21354 | btn.classList.remove('bg-gray-600'); |
| 21355 | btn.classList.add('bg-Ragnar-600'); |
| 21356 | } else { |
| 21357 | btn.classList.remove('bg-Ragnar-600'); |
| 21358 | btn.classList.add('bg-gray-600'); |
| 21359 | } |
| 21360 | }); |
| 21361 | |
| 21362 | // Fetch processes with new sort order |
| 21363 | networkAwareFetch(`/api/system/processes?sort=${sortBy}`) |
| 21364 | .then(response => response.json()) |
| 21365 | .then(processes => { |
| 21366 | updateProcessList(processes); |
| 21367 | }) |
| 21368 | .catch(error => { |
| 21369 | console.error('Error sorting processes:', error); |
| 21370 | }); |
| 21371 | } |
| 21372 | |
| 21373 | function refreshSystemStatus() { |
| 21374 | fetchSystemStatus(); |
| 21375 | fetchNetworkStats(); |
| 21376 | showSystemSuccess('System status refreshed'); |
| 21377 | } |
| 21378 | |
| 21379 | function showSystemSuccess(message) { |
no test coverage detected