     })
                .catch(error => {
                    console.error('Error:', error);
                    alert('Error resetting event time: ' + error);
                });
            }
        }

        function restartServer() {
            if (confirm('Are you sure you want to restart the server?')) {
                fetch('/api/server/restart', { 
                    method: 'POST',
                    headers: {
                        'Content-Type': 'application/json'
                    }
