n.reload();
            } else {
                throw new Error('Failed to update cable');
            }
        })
        .catch(error => {
            console.error('Error updating cable:', error);
            alert('Error updating cable');
        });
    });

    // Close modals on Escape key
    document.addEventListener('keydown', function(e) {
        if (e.key === 'Escape') {
            closeAddCableModal();
            closeViewCableModal();
            closeEditCableModal();
            closeSe