







jQuery(document).ready(function($) {
    // 评论显示/隐藏切换
    $('#toggle-comments').on('click', function() {
        $('#comments-container').toggle();
        $(this).text(function(i, text) {
            return text === "显示评论" ? "隐藏评论" : "显示评论";
        });
    });
});


document.addEventListener('DOMContentLoaded', function() {
    // 添加可折叠功能
    const infoSections = document.querySelectorAll('.info-section');
    
    infoSections.forEach(section => {
        const heading = section.querySelector('h3');
        const content = section.querySelector('table, ul');
        
        // 初始状态
        content.style.display = 'block';
        section.classList.add('active');
        
        heading.addEventListener('click', () => {
            section.classList.toggle('active');
            if (content.style.display === 'none') {
                content.style.display = 'block';
            } else {
                content.style.display = 'none';
            }
        });
    });
    
    // 添加状态指示器
    const tables = document.querySelectorAll('.wp-server-info-table');
    
    tables.forEach(table => {
        const rows = table.querySelectorAll('tr');
        
        rows.forEach(row => {
            const cells = row.querySelectorAll('td');
            if (cells.length > 0) {
                const value = cells[cells.length - 1].textContent;
                
                // 对特定值添加状态指示
                if (/error|disabled|false|0MB/i.test(value)) {
                    cells[cells.length - 1].innerHTML = 
                        `<span class="status-indicator status-critical"></span>${value}`;
                } else if (/warning|limited/i.test(value)) {
                    cells[cells.length - 1].innerHTML = 
                        `<span class="status-indicator status-warning"></span>${value}`;
                } else if (/ok|enabled|true/i.test(value)) {
                    cells[cells.length - 1].innerHTML = 
                        `<span class="status-indicator status-good"></span>${value}`;
                }
            }
        });
    });
});
