
        const logContainer = document.getElementById('logContainer');

        function updateStatus(status, message) {
            connectionStatusDiv.className = `connection-status status-${status}`;
            connectionStatusDiv.textContent = `连接状态：${message}`;
        }

        function displayLog(data) {
            const item = document.createElement('div');
            item.className = `log-item log-type-${data.type}`;
            const timestamp = new Date().toLocaleTimeString('zh-CN',