MediaWiki:Common.css: mudanças entre as edições

De WIKI Netnews
Ir para navegação Ir para pesquisar
Sem resumo de edição
Etiqueta: Revertido
Sem resumo de edição
Etiqueta: Revertido
Linha 178: Linha 178:


         if (data.status === "online") {
         if (data.status === "online") {
             el.innerHTML = '<span class="status-dot status-green"></span> Operacional';
             el.innerHTML = "🟢 Operacional";
         } else if (data.status === "offline") {
         } else if (data.status === "offline") {
             el.innerHTML = '<span class="status-dot status-red status-blink"></span> Offline';
             el.innerHTML = "🔴 Offline";
         } else {
         } else {
             el.innerHTML = '<span class="status-dot status-yellow"></span> Indefinido';
             el.innerHTML = "🟡 Indefinido";
         }
         }
     } catch (error) {
     } catch (error) {
         let el = document.getElementById(elementId);
         document.getElementById(elementId).innerHTML = "🟡 Erro";
        if (el) {
            el.innerHTML = '<span class="status-dot status-yellow"></span> Erro';
        }
     }
     }
}
}


function atualizarTodos() {
function atualizarTodos() {
     atualizarStatus("web01","web01-status");
     atualizarStatus("web01", "web01-status");
     atualizarStatus("web02","web02-status");
     atualizarStatus("web02", "web02-status");
     atualizarStatus("web03","web03-status");
     atualizarStatus("web03", "web03-status");
     atualizarStatus("web04","web04-status");
     atualizarStatus("web04", "web04-status");
     atualizarStatus("ns1","ns1-status");
     atualizarStatus("ns1", "ns1-status");
     atualizarStatus("ns2","ns2-status");
     atualizarStatus("ns2", "ns2-status");
}
}



Edição das 16h38min de 18 de fevereiro de 2026

/* ======================================================
   WIKI NETNEWS 3.1 - NOC Interativo
   ====================================================== */

body {
    font-family: 'Segoe UI', Arial, sans-serif;
}

/* HERO */
.hero {
    background: linear-gradient(90deg, #1e3c72, #2a5298);
    padding: 70px 40px;
    color: white;
    border-radius: 20px;
    text-align: center;
    margin-bottom: 50px;
}

.hero h1 {
    font-size: 40px;
    margin-bottom: 10px;
    font-weight: 600;
}

.hero p {
    font-size: 18px;
    opacity: 0.9;
}

/* GRID */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 30px;
    margin-bottom: 50px;
}

/* CARDS */
.card {
    padding: 35px;
    border-radius: 22px;
    color: white;
    transition: all 0.35s ease;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 220px;
}

.card h3 {
    margin-top: 0;
    font-size: 22px;
    font-weight: 600;
}

.card p {
    font-size: 15px;
    opacity: 0.9;
}

.card a {
    color: white !important;
    text-decoration: none;
    font-weight: bold;
    margin-top: 15px;
    display: inline-block;
}

.card:hover {
    transform: translateY(-10px);
    box-shadow: 0 25px 50px rgba(0,0,0,0.25);
}

/* CORES */
.blue { background: linear-gradient(135deg, #2980b9, #3498db); }
.green { background: linear-gradient(135deg, #27ae60, #2ecc71); }
.yellow { background: linear-gradient(135deg, #f39c12, #f1c40f); color: #000; }
.red { background: linear-gradient(135deg, #c0392b, #e74c3c); }

/* ========================= */
/* PAINEL NOC */
/* ========================= */

.noc-panel {
    background: #0f172a;
    padding: 40px;
    border-radius: 22px;
    color: white;
    margin-bottom: 60px;
}

.noc-title {
    font-size: 24px;
    margin-bottom: 30px;
    font-weight: 600;
}

.noc-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 25px;
}

.server-box {
    background: #1e293b;
    padding: 22px;
    border-radius: 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.3s ease;
    text-decoration: none;
    color: white !important;
}

.server-box:hover {
    background: #334155;
    transform: translateY(-4px);
}

.server-name {
    font-weight: 600;
}

/* STATUS DOT */
.status-dot {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    display: inline-block;
    margin-right: 8px;
}

/* STATUS COLORS */
.status-green {
    background: #22c55e;
}

.status-yellow {
    background: #facc15;
}

.status-red {
    background: #ef4444;
}

/* ALERTA PISCANDO */
@keyframes blink {
    0% { opacity: 1; }
    50% { opacity: 0.3; }
    100% { opacity: 1; }
}

.status-blink {
    animation: blink 1s infinite;
}

.btn-green {
    background: #2ecc71;
    color: white !important;
    padding: 10px 20px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: bold;
    display: inline-block;
}

.btn-green:hover {
    background: #27ae60;
}
async function atualizarStatus(host, elementId) {
    try {
        const response = await fetch('/noc/status.php?host=' + host);
        const data = await response.json();
        let el = document.getElementById(elementId);

        if (!el) return;

        if (data.status === "online") {
            el.innerHTML = "🟢 Operacional";
        } else if (data.status === "offline") {
            el.innerHTML = "🔴 Offline";
        } else {
            el.innerHTML = "🟡 Indefinido";
        }
    } catch (error) {
        document.getElementById(elementId).innerHTML = "🟡 Erro";
    }
}

function atualizarTodos() {
    atualizarStatus("web01", "web01-status");
    atualizarStatus("web02", "web02-status");
    atualizarStatus("web03", "web03-status");
    atualizarStatus("web04", "web04-status");
    atualizarStatus("ns1", "ns1-status");
    atualizarStatus("ns2", "ns2-status");
}

document.addEventListener("DOMContentLoaded", function() {
    atualizarTodos();
    setInterval(atualizarTodos, 30000);
});