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

De WIKI Netnews
Ir para navegação Ir para pesquisar
Sem resumo de edição
Sem resumo de edição
Linha 1: Linha 1:
function atualizarStatus(host, elementId) {
/* ============================= */
/* WIKI NETNEWS - ESTILO NOC */
/* ============================= */


     fetch('/noc/status.php?host=' + host)
body {
        .then(function(response) {
     font-family: 'Segoe UI', Arial, sans-serif;
            return response.json();
}
        })
        .then(function(data) {


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


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


            if (data.status === "online") {
.hero p {
    font-size: 18px;
    opacity: 0.9;
}


                html = "🟢 Operacional<br>" +
/* PAINEL NOC */
                      "<small>Uptime: " + formatUptime(data.uptime) + "</small><br>" +
.noc-panel {
                      "<small>Último check: " + (data.lastcheck ? data.lastcheck : '-') + "</small>";
    background: #0f172a;
    padding: 40px;
    border-radius: 22px;
    color: white;
    margin-bottom: 60px;
}


                el.classList.remove("blink");
.noc-title {
    font-size: 24px;
    margin-bottom: 30px;
    font-weight: 600;
}


            } else if (data.status === "offline") {
.noc-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 25px;
}


                html = "🔴 Offline<br>" +
.server-box {
                      "<small>Último check: " + (data.lastcheck ? data.lastcheck : '-') + "</small>";
    background: #1e293b;
    padding: 22px;
    border-radius: 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.3s ease;
    color: white !important;
}


                el.classList.add("blink");
.server-box:hover {
 
    background: #334155;
            } else {
    transform: translateY(-4px);
 
}
                html = "🟡 Indefinido";
            }
 
            el.innerHTML = html;


        })
.server-name {
        .catch(function() {
    font-weight: 600;
            var el = document.getElementById(elementId);
            if (el) {
                el.innerHTML = "🟡 Erro";
            }
        });
}
}


function formatUptime(seconds) {
/* STATUS */
 
.blink {
    if (!seconds || seconds <= 0) return '-';
     animation: blink 1s infinite;
 
    var days = Math.floor(seconds / 86400);
    var hours = Math.floor((seconds % 86400) / 3600);
    var minutes = Math.floor((seconds % 3600) / 60);
 
     return days + "d " + hours + "h " + minutes + "m";
}
}


function atualizarTodos() {
@keyframes blink {
     atualizarStatus("web01", "web01-status");
     0% { opacity: 1; }
     atualizarStatus("web02", "web02-status");
     50% { opacity: 0.3; }
     atualizarStatus("web03", "web03-status");
     100% { opacity: 1; }
    atualizarStatus("web04", "web04-status");
    atualizarStatus("ns1", "ns1-status");
    atualizarStatus("ns2", "ns2-status");
}
}
document.addEventListener("DOMContentLoaded", function () {
    atualizarTodos();
    setInterval(atualizarTodos, 30000);
});

Edição das 17h26min de 18 de fevereiro de 2026

/* ============================= */
/* WIKI NETNEWS - ESTILO NOC */
/* ============================= */

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;
}

/* 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;
    color: white !important;
}

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

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

/* STATUS */
.blink {
    animation: blink 1s infinite;
}

@keyframes blink {
    0% { opacity: 1; }
    50% { opacity: 0.3; }
    100% { opacity: 1; }
}