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
 
(Uma revisão intermediária pelo mesmo usuário não está sendo mostrada)
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;
    transform: translateY(-4px);
}


            } else {
.server-name {
 
    font-weight: 600;
                html = "🟡 Indefinido";
}
            }


            el.innerHTML = html;
/* Bolinha padrão */
 
.status-dot {
        })
    width: 12px;
        .catch(function() {
    height: 12px;
            var el = document.getElementById(elementId);
    border-radius: 50%;
            if (el) {
    display: inline-block;
                el.innerHTML = "🟡 Erro";
    margin-right: 6px;
            }
        });
}
}


function formatUptime(seconds) {
/* Cores */
.status-green { background: #22c55e; }
.status-yellow { background: #facc15; }
.status-red { background: #ef4444; }


    if (!seconds || seconds <= 0) return '-';
/* Piscar somente offline */
 
.status-blink {
    var days = Math.floor(seconds / 86400);
     animation: blink 1s infinite;
    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.2; }
     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 atual tal como às 19h12min 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;
}

/* Bolinha padrão */
.status-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    display: inline-block;
    margin-right: 6px;
}

/* Cores */
.status-green { background: #22c55e; }
.status-yellow { background: #facc15; }
.status-red { background: #ef4444; }

/* Piscar somente offline */
.status-blink {
    animation: blink 1s infinite;
}

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