   xhr.onerror = function () {
                    alert('Error clearing log.');
                };
                xhr.send();
            }

            function toggleRefresh() {
                var refreshButton = document.querySelector("input[onclick='toggleRefresh()']");
                if (refreshInterval) {
                    clearInterval(refreshInterval);
                    refreshInterval = null;
                    refreshButton.value = '开始刷新';
                } else {
                