
<div class="w-full" style="font-size:14px;">
    <div class="flex w-full flex-col gap-3.5">

        
        <?php if (isset($component)) { $__componentOriginal2544aeb3df80db4e8cf42f27632fe7f3 = $component; } ?>
<?php if (isset($attributes)) { $__attributesOriginal2544aeb3df80db4e8cf42f27632fe7f3 = $attributes; } ?>
<?php $component = Illuminate\View\AnonymousComponent::resolve(['view' => 'components.cabecera','data' => ['rotulo' => 'Monitorización','titulo' => 'Monitorización']] + (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag ? $attributes->all() : [])); ?>
<?php $component->withName('cabecera'); ?>
<?php if ($component->shouldRender()): ?>
<?php $__env->startComponent($component->resolveView(), $component->data()); ?>
<?php if (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag): ?>
<?php $attributes = $attributes->except(\Illuminate\View\AnonymousComponent::ignoredParameterNames()); ?>
<?php endif; ?>
<?php $component->withAttributes(['rotulo' => 'Monitorización','titulo' => 'Monitorización']); ?>

             <?php $__env->slot('icono', null, []); ?> 
                <?php if (isset($component)) { $__componentOriginalb86967db162ccc0bceeb1ac50f169b8f = $component; } ?>
<?php if (isset($attributes)) { $__attributesOriginalb86967db162ccc0bceeb1ac50f169b8f = $attributes; } ?>
<?php $component = Illuminate\View\AnonymousComponent::resolve(['view' => 'components.nav-icon','data' => ['name' => 'clipboard','tint' => 'orange']] + (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag ? $attributes->all() : [])); ?>
<?php $component->withName('nav-icon'); ?>
<?php if ($component->shouldRender()): ?>
<?php $__env->startComponent($component->resolveView(), $component->data()); ?>
<?php if (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag): ?>
<?php $attributes = $attributes->except(\Illuminate\View\AnonymousComponent::ignoredParameterNames()); ?>
<?php endif; ?>
<?php $component->withAttributes(['name' => 'clipboard','tint' => 'orange']); ?>
<?php echo $__env->renderComponent(); ?>
<?php endif; ?>
<?php if (isset($__attributesOriginalb86967db162ccc0bceeb1ac50f169b8f)): ?>
<?php $attributes = $__attributesOriginalb86967db162ccc0bceeb1ac50f169b8f; ?>
<?php unset($__attributesOriginalb86967db162ccc0bceeb1ac50f169b8f); ?>
<?php endif; ?>
<?php if (isset($__componentOriginalb86967db162ccc0bceeb1ac50f169b8f)): ?>
<?php $component = $__componentOriginalb86967db162ccc0bceeb1ac50f169b8f; ?>
<?php unset($__componentOriginalb86967db162ccc0bceeb1ac50f169b8f); ?>
<?php endif; ?>
             <?php $__env->endSlot(); ?>

             <?php $__env->slot('descripcion', null, []); ?> 
            Aquí se mira cuando algo va mal y se demuestra qué pasó: qué pidió cada Moodle,
            qué se le respondió, a quién estamos cortando y qué avisos han salido.
            <span class="mt-0.5 block">
                Esta sección <strong class="font-semibold">solo mira</strong>. Los umbrales, los destinatarios de los avisos y
                cuánto histórico se guarda se configuran en
                <?php if (app(\Illuminate\Contracts\Auth\Access\Gate::class)->check('admin.configs.index')): ?>
                    <a href="<?php echo e(route('configurations.manager.index')); ?>" wire:navigate
                       class="font-semibold" style="color:var(--text-link);">Ajustes del Manager</a>.
                <?php else: ?>
                    Ajustes del Manager.
                <?php endif; ?>
            </span>
             <?php $__env->endSlot(); ?>

             <?php $__env->slot('pie', null, []); ?> 
                <?php echo $__env->make("livewire.monitoring.components.menu", ["selected" => "resumen"], array_diff_key(get_defined_vars(), ['__data' => 1, '__path' => 1]))->render(); ?>
             <?php $__env->endSlot(); ?>
         <?php echo $__env->renderComponent(); ?>
<?php endif; ?>
<?php if (isset($__attributesOriginal2544aeb3df80db4e8cf42f27632fe7f3)): ?>
<?php $attributes = $__attributesOriginal2544aeb3df80db4e8cf42f27632fe7f3; ?>
<?php unset($__attributesOriginal2544aeb3df80db4e8cf42f27632fe7f3); ?>
<?php endif; ?>
<?php if (isset($__componentOriginal2544aeb3df80db4e8cf42f27632fe7f3)): ?>
<?php $component = $__componentOriginal2544aeb3df80db4e8cf42f27632fe7f3; ?>
<?php unset($__componentOriginal2544aeb3df80db4e8cf42f27632fe7f3); ?>
<?php endif; ?>

        
        
        <div class="cfg-bloques-grid">

            
            <a href="<?php echo e(route('monitoring.traffic')); ?>" wire:navigate
               class="cfg-bloque" style="background:var(--surface-card); border:1px solid var(--border-subtle);">
                <span class="flex h-[38px] w-[38px] items-center justify-center rounded-[10px]"
                      style="background:var(--danger-50); color:var(--danger-500);">
                    <svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round"><path d="M18 6 6 18"/><path d="m6 6 12 12"/><circle cx="12" cy="12" r="10"/></svg>
                </span>

                <div class="flex flex-wrap items-center gap-2">
                    <span style="font-family:'Plus Jakarta Sans',sans-serif; font-size:15px; font-weight:700; color:var(--text-strong);">
                        Tráfico y cortes
                    </span>

                    
                    <?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if BLOCK]><![endif]--><?php endif; ?><?php if($n['cortando'] > 0): ?>
                        <span class="rounded-full px-2 py-px text-[10.5px] font-bold"
                              style="color:#fff; background:var(--danger-500);">
                            <?php echo e($n['cortando']); ?> cortando
                        </span>
                    <?php elseif($n['observando'] > 0): ?>
                        <span class="rounded-full px-2 py-px text-[10.5px] font-bold"
                              style="color:var(--info-500); background:var(--info-50);">
                            <?php echo e($n['observando']); ?> en observación
                        </span>
                    <?php else: ?>
                        <span class="rounded-full px-2 py-px text-[10.5px] font-bold"
                              style="color:var(--success-500); background:var(--success-50);">
                            sin cortes
                        </span>
                    <?php endif; ?><?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if ENDBLOCK]><![endif]--><?php endif; ?>
                </div>

                <div class="flex-1 text-[12.5px] leading-[1.5]" style="color:var(--text-muted);">
                    Quién está llamando de más y a quién le estamos cortando el servicio. Se
                    puede bloquear una IP a mano y levantar un corte.
                    <strong class="font-semibold">«En observación» no corta a nadie</strong>: se
                    apunta lo que se habría cortado y la petición sigue adelante.
                </div>

                <span class="text-[12.5px] font-semibold" style="color:var(--text-link);">
                    <?php echo e($n['cortesGuardados']); ?> <?php echo e($n['cortesGuardados'] === 1 ? 'registro' : 'registros'); ?> guardados →
                </span>
            </a>

            
            <?php if (app(\Illuminate\Contracts\Auth\Access\Gate::class)->check('admin.api-logs.index')): ?>
                <a href="<?php echo e(route('api-logs.index')); ?>" wire:navigate
                   class="cfg-bloque" style="background:var(--surface-card); border:1px solid var(--border-subtle);">
                    <span class="flex h-[38px] w-[38px] items-center justify-center rounded-[10px]"
                          style="background:var(--orange-100); color:var(--orange-600);">
                        <svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round"><path d="M4 17V9"/><path d="M10 17V5"/><path d="M16 17v-6"/><path d="M22 17V3"/></svg>
                    </span>

                    <div class="flex flex-wrap items-center gap-2">
                        <span style="font-family:'Plus Jakarta Sans',sans-serif; font-size:15px; font-weight:700; color:var(--text-strong);">
                            Peticiones API
                        </span>

                        <?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if BLOCK]><![endif]--><?php endif; ?><?php if($n['erroresSinRevisar'] > 0): ?>
                            <span class="rounded-full px-2 py-px text-[10.5px] font-bold"
                                  style="color:#fff; background:var(--danger-500);">
                                <?php echo e($n['erroresSinRevisar']); ?> por revisar
                            </span>
                        <?php else: ?>
                            <span class="rounded-full px-2 py-px text-[10.5px] font-bold"
                                  style="color:var(--success-500); background:var(--success-50);">
                                nada que arreglar
                            </span>
                        <?php endif; ?><?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if ENDBLOCK]><![endif]--><?php endif; ?>
                    </div>

                    <div class="flex-1 text-[12.5px] leading-[1.5]" style="color:var(--text-muted);">
                        Una fila por llamada de cada Moodle: qué pidió, qué se le respondió y
                        <strong class="font-semibold">por qué falló</strong> si falló. Es la única
                        fuente de lo que pasó de verdad — el resto del panel dice lo que
                        <em>debería</em> recibir cada sitio.
                    </div>

                    <span class="text-[12.5px] font-semibold" style="color:var(--text-link);">
                        <?php echo e(number_format($n['peticiones'], 0, ',', '.')); ?> en <?php echo e($dias); ?> días →
                    </span>
                </a>
            <?php endif; ?>

            
            <a href="<?php echo e(route('monitoring.expirations')); ?>" wire:navigate
               class="cfg-bloque" style="background:var(--surface-card); border:1px solid var(--border-subtle);">
                <span class="flex h-[38px] w-[38px] items-center justify-center rounded-[10px]"
                      style="background:var(--warning-50); color:var(--warning-500);">
                    <svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round"><path d="M8 2v4"/><path d="M16 2v4"/><rect width="18" height="18" x="3" y="4" rx="2"/><path d="M3 10h18"/></svg>
                </span>

                <div class="flex flex-wrap items-center gap-2">
                    <span style="font-family:'Plus Jakarta Sans',sans-serif; font-size:15px; font-weight:700; color:var(--text-strong);">
                        Caducidades
                    </span>

                    <?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if BLOCK]><![endif]--><?php endif; ?><?php if($n['caducaPronto'] > 0): ?>
                        <span class="rounded-full px-2 py-px text-[10.5px] font-bold"
                              style="color:var(--warning-500); background:var(--warning-50);">
                            <?php echo e($n['caducaPronto']); ?> en 30 días
                        </span>
                    <?php else: ?>
                        <span class="rounded-full px-2 py-px text-[10.5px] font-bold"
                              style="color:var(--success-500); background:var(--success-50);">
                            nada cerca
                        </span>
                    <?php endif; ?><?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if ENDBLOCK]><![endif]--><?php endif; ?>
                </div>

                <div class="flex-1 text-[12.5px] leading-[1.5]" style="color:var(--text-muted);">
                    Licencias y soportes que se acaban. Una licencia caducada
                    <strong class="font-semibold">deja al sitio sin servicio</strong>; un soporte
                    caducado no corta nada — es un acuerdo comercial.
                </div>

                <span class="text-[12.5px] font-semibold" style="color:var(--text-link);">
                    Ver el calendario →
                </span>
            </a>

            
            <a href="<?php echo e(route('monitoring.notices')); ?>" wire:navigate
               class="cfg-bloque" style="background:var(--surface-card); border:1px solid var(--border-subtle);">
                <span class="flex h-[38px] w-[38px] items-center justify-center rounded-[10px]"
                      style="background:var(--info-50); color:var(--info-500);">
                    <svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round"><path d="M10.268 21a2 2 0 0 0 3.464 0"/><path d="M3.262 15.326A1 1 0 0 0 4 17h16a1 1 0 0 0 .74-1.673C19.41 13.956 18 12.499 18 8A6 6 0 0 0 6 8c0 4.499-1.411 5.956-2.738 7.326"/></svg>
                </span>

                <div class="flex flex-wrap items-center gap-2">
                    <span style="font-family:'Plus Jakarta Sans',sans-serif; font-size:15px; font-weight:700; color:var(--text-strong);">
                        Avisos
                    </span>

                    <?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if BLOCK]><![endif]--><?php endif; ?><?php if($n['avisosSinEntregar'] > 0): ?>
                        <span class="rounded-full px-2 py-px text-[10.5px] font-bold"
                              style="color:var(--warning-500); background:var(--warning-50);">
                            <?php echo e($n['avisosSinEntregar']); ?> sin entregar
                        </span>
                    <?php else: ?>
                        <span class="rounded-full px-2 py-px text-[10.5px] font-bold"
                              style="color:var(--success-500); background:var(--success-50);">
                            todos entregados
                        </span>
                    <?php endif; ?><?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if ENDBLOCK]><![endif]--><?php endif; ?>
                </div>

                <div class="flex-1 text-[12.5px] leading-[1.5]" style="color:var(--text-muted);">
                    Los correos que el Manager manda solo: licencias por caducar, soportes,
                    cortes de la API. <strong class="font-semibold">Un aviso sin entregar es un
                    aviso que nadie ha leído</strong>, y esa es la única pantalla donde se ve.
                </div>

                <span class="text-[12.5px] font-semibold" style="color:var(--text-link);">
                    Ver los avisos →
                </span>
            </a>

            
            <?php if (app(\Illuminate\Contracts\Auth\Access\Gate::class)->check('admin.logs.index')): ?>
                <a href="<?php echo e(route('monitoring.system-log')); ?>" wire:navigate
                   class="cfg-bloque" style="background:var(--surface-card); border:1px solid var(--border-subtle);">
                    <span class="flex h-[38px] w-[38px] items-center justify-center rounded-[10px]"
                          style="background:var(--teal-100); color:var(--teal-700);">
                        <svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round"><path d="M14 2v4a2 2 0 0 0 2 2h4"/><path d="M15 18a3 3 0 1 0-6 0"/><path d="M4 22h14a2 2 0 0 0 2-2V7.5L14.5 2H6a2 2 0 0 0-2 2v4"/><circle cx="12" cy="13" r="2"/></svg>
                    </span>

                    <div style="font-family:'Plus Jakarta Sans',sans-serif; font-size:15px; font-weight:700; color:var(--text-strong);">
                        Acciones del panel
                    </div>

                    <div class="flex-1 text-[12.5px] leading-[1.5]" style="color:var(--text-muted);">
                        Quién hizo qué desde el panel: apagar un entorno, borrar una versión,
                        cambiar un dominio. <strong class="font-semibold">No son peticiones de
                        Moodle</strong>, son las nuestras — y es donde se contesta «¿quién tocó
                        esto?».
                    </div>

                    <span class="text-[12.5px] font-semibold" style="color:var(--text-link);">
                        Ver el rastro →
                    </span>
                </a>
            <?php endif; ?>

            
            <a href="<?php echo e(route('monitoring.tamano')); ?>" wire:navigate
               class="cfg-bloque" style="background:var(--surface-card); border:1px solid var(--border-subtle);">
                <span class="flex h-[38px] w-[38px] items-center justify-center rounded-[10px]"
                      style="background:var(--surface-sunken); color:var(--text-body);">
                    <svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round"><ellipse cx="12" cy="5" rx="9" ry="3"/><path d="M3 5v14a9 3 0 0 0 18 0V5"/><path d="M3 12a9 3 0 0 0 18 0"/></svg>
                </span>

                <div style="font-family:'Plus Jakarta Sans',sans-serif; font-size:15px; font-weight:700; color:var(--text-strong);">
                    Tamaño de la base
                </div>

                <div class="flex-1 text-[12.5px] leading-[1.5]" style="color:var(--text-muted);">
                    Cuántas filas tiene cada tabla y <strong class="font-semibold">qué se las
                    lleva</strong>. Para decidir una retención, estimar cuánto va a tardar una
                    migración, o ver que algo pequeño ha crecido porque una tarea no corre.
                </div>

                <span class="text-[12.5px] font-semibold" style="color:var(--text-link);">
                    Ver el tamaño →
                </span>
            </a>
        </div>

        
        
        <section class="rounded-xl border px-5 py-3.5"
                 style="background:var(--surface-card); border-color:var(--border-subtle);">
            <div class="text-[11px] font-semibold uppercase tracking-[0.06em]" style="color:var(--text-muted);">
                Lo que se está guardando
            </div>

            <div class="mt-1.5 flex flex-wrap items-baseline gap-x-6 gap-y-1 text-[12.5px]"
                 style="color:var(--text-muted);">
                <span>
                    <strong class="font-bold" style="color:var(--text-strong);"><?php echo e(number_format($n['cortesGuardados'], 0, ',', '.')); ?></strong>
                    cortes registrados
                </span>
                <span>
                    <strong class="font-bold" style="color:var(--text-strong);"><?php echo e(number_format($n['ventanasGuardadas'], 0, ',', '.')); ?></strong>
                    ventanas del limitador
                </span>
            </div>

            <p class="mt-1.5 max-w-[720px] text-[12px] leading-relaxed" style="color:var(--text-subtle);">
                Las dos caducan solas: los episodios revisados a los 180 días y las ventanas del
                limitador a los 30, con una tarea que corre cada noche. <strong class="font-semibold">Los
                cortes pendientes no caducan nunca</strong> —sin revisar es algo que nadie ha
                mirado— y se quitan revisándolos y borrándolos desde Tráfico y cortes.
                <a href="<?php echo e(route('monitoring.tamano')); ?>" wire:navigate
                   class="font-semibold" style="color:var(--text-link);">Ver el tamaño de todas las tablas</a>.
            </p>
        </section>
    </div>
</div><?php /**PATH /var/www/html/resources/views/livewire/monitoring/index.blade.php ENDPATH**/ ?>