| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273 |
- <div class="w-full space-y-6">
- <div class="flex border-b mb-6">
- <button id="dashboardTab" class="main-tab-btn active relative overflow-hidden py-3 px-6 font-medium text-blue-600">
- <i class="fas fa-tachometer-alt mr-2"></i>{{ _("Sistema") }}
- </button>
- <button id="cacheTab"
- class="main-tab-btn relative overflow-hidden py-3 px-6 font-medium text-gray-500 hover:text-blue-600">
- <i class="fas fa-database mr-2"></i>{{ _("Caché") }}
- </button>
- <button id="networkTab" class="main-tab-btn relative overflow-hidden py-3 px-6 font-medium text-gray-500 hover:text-blue-600">
- <i class="fas fa-network-wired mr-2"></i>{{ _("Red") }}
- </button>
- </div>
- <div id="dashboardContent" class="main-tab-content active">
- <section class="mb-12">
- <div class="grid grid-cols-1 lg:grid-cols-2 gap-8">
- <div class="bg-white rounded-xl shadow-lg p-6">
- <div class="flex items-center mb-6">
- <i class="fas fa-chart-pie text-2xl text-blue-600 mr-3"></i>
- <h2 class="text-xl font-bold text-gray-800">
- {{ _("Estadísticas del Sistema") }}
- </h2>
- </div>
- <div class="grid grid-cols-1 md:grid-cols-3 gap-6 items-center justify-center">
- <div class="flex flex-col items-center justify-center">
- <div class="relative w-36 h-36">
- <svg viewBox="0 0 36 36" class="block mx-auto">
- <path class="fill-none stroke-red-100 stroke-[3.5]" d="M18 2.0845 a 15.9155 15.9155 0 0 1 0 31.831 a 15.9155 15.9155 0 0 1 0 -31.831"/>
- <path id="cpu-ring" class="circle-animation fill-none stroke-linecap-round stroke-red-500 stroke-[3.5]" stroke-dasharray="0,100" d="M18 2.0845 a 15.9155 15.9155 0 0 1 0 31.831 a 15.9155 15.9155 0 0 1 0 -31.831"/>
- <text id="cpu-value" x="18" y="18" class="text-[0.5rem] fill-gray-500" text-anchor="middle" dominant-baseline="middle">0%</text>
- </svg>
- </div>
- <h3 class="mt-2 font-semibold text-gray-700">{{ _("CPU") }}</h3>
- <p class="text-xs mt-1 bg-red-500 text-white px-2 py-0.5 rounded-full font-medium">
- {{ system_info.cpu.physical_cores }} {{ _("núcleos") }}
- </p>
- </div>
- <div class="flex flex-col items-center justify-center">
- <div class="relative w-36 h-36">
- <svg viewBox="0 0 36 36" class="block mx-auto">
- <path class="fill-none stroke-blue-100 stroke-[3.5]" d="M18 2.0845 a 15.9155 15.9155 0 0 1 0 31.831 a 15.9155 15.9155 0 0 1 0 -31.831"/>
- <path id="ram-ring" class="circle-animation fill-none stroke-linecap-round stroke-blue-600 stroke-[3.5]" stroke-dasharray="0,100" d="M18 2.0845 a 15.9155 15.9155 0 0 1 0 31.831 a 15.9155 15.9155 0 0 1 0 -31.831"/>
- <text id="ram-used" x="18" y="18" class="text-[0.5rem] fill-gray-500" text-anchor="middle" dominant-baseline="middle">{{ _("0G") }}</text>
- </svg>
- </div>
- <h3 class="mt-2 font-semibold text-gray-700">{{ _("RAM") }}</h3>
- <p class="text-xs mt-1 bg-blue-500 text-white px-2 py-0.5 rounded-full font-medium">
- {{ system_info.ram.total }}
- </p>
- </div>
- <div class="flex flex-col items-center justify-center">
- <div class="relative w-36 h-36">
- <svg viewBox="0 0 36 36" class="block mx-auto">
- <path class="fill-none stroke-emerald-100 stroke-[3.5]" d="M18 2.0845 a 15.9155 15.9155 0 0 1 0 31.831 a 15.9155 15.9155 0 0 1 0 -31.831"/>
- <path id="swap-ring" class="circle-animation fill-none stroke-linecap-round stroke-emerald-500 stroke-[3.5]" stroke-dasharray="0,100" d="M18 2.0845 a 15.9155 15.9155 0 0 1 0 31.831 a 15.9155 15.9155 0 0 1 0 -31.831"/>
- <text id="swap-used" x="18" y="18" class="text-[0.5rem] fill-gray-500" text-anchor="middle" dominant-baseline="middle">{{ _("0G") }}</text>
- </svg>
- </div>
- <h3 class="mt-2 font-semibold text-gray-700">{{ _("SWAP") }}</h3>
- <p class="text-xs mt-1 bg-emerald-500 text-white px-2 py-0.5 rounded-full font-medium">
- {{ system_info.swap.total }}
- </p>
- </div>
- </div>
- </div>
- <div class="bg-white rounded-xl shadow-lg p-6">
- <div class="flex items-center mb-6">
- <i class="fas fa-info-circle text-2xl text-blue-600 mr-3"></i>
- <h2 class="text-xl font-bold text-gray-800">
- {{ _("Información del Sistema") }}
- </h2>
- </div>
- <div class="grid grid-cols-1 md:grid-cols-2 gap-4">
- <div class="flex items-start">
- <i class="fas fa-server text-gray-500 mt-1 mr-3"></i>
- <div>
- <h3 class="text-sm font-semibold text-gray-600">
- {{ _("Nombre del Host") }}
- </h3>
- <p id="hostname" class="text-gray-800">
- {{ system_info.hostname }}
- </p>
- </div>
- </div>
- <div class="flex items-start">
- <i class="fas fa-network-wired text-gray-500 mt-1 mr-3"></i>
- <div>
- <h3 class="text-sm font-semibold text-gray-600">
- {{ _("Direcciones IP") }}
- </h3>
- <p id="ip-addresses" class="text-gray-800">
- {% for ip in system_info.ips %}{{ ip.ip }}<br />{% endfor
- %}
- </p>
- </div>
- </div>
- <div class="flex items-start">
- <i class="fab fa-linux text-gray-500 mt-1 mr-3"></i>
- <div>
- <h3 class="text-sm font-semibold text-gray-600">
- {{ _("Sistema Operativo") }}
- </h3>
- <p id="os-info" class="text-gray-800">
- {{ system_info.os }}
- </p>
- </div>
- </div>
- <div class="flex items-start">
- <i class="fas fa-clock text-gray-500 mt-1 mr-3"></i>
- <div>
- <h3 class="text-sm font-semibold text-gray-600">
- {{ _("Tiempo Encendido") }}
- </h3>
- <p id="uptime" class="text-gray-800">
- {{ system_info.uptime }}
- </p>
- </div>
- </div>
- <div class="flex items-start">
- <i class="fas fa-globe text-gray-500 mt-1 mr-3"></i>
- <div>
- <h3 class="text-sm font-semibold text-gray-600">
- {{ _("Zona Horaria") }}
- </h3>
- <p id="timezone" class="text-gray-800">
- {{ system_info.timezone }}
- </p>
- </div>
- </div>
- <div class="flex items-start">
- <i class="fas fa-clock text-gray-500 mt-1 mr-3"></i>
- <div>
- <h3 class="text-sm font-semibold text-gray-600">
- {{ _("Hora Local") }}
- </h3>
- <p id="local-time" class="text-gray-800">
- {{ system_info.local_time }}
- </p>
- </div>
- </div>
- </div>
- </div>
- </div>
- </section>
- <section class="bg-white rounded-xl shadow-lg p-6 mb-12">
- <div class="flex items-center justify-between mb-6">
- <h2 class="text-xl font-bold text-gray-800">
- {{ _("Gráficas del Sistema") }}
- </h2>
- <div class="flex bg-gray-100 rounded-lg p-1">
- <button
- id="todayBtn"
- class="time-range-btn active px-4 py-2 rounded-md text-sm font-medium text-blue-600 bg-white shadow"
- >
- {{ _("Hoy") }}
- </button>
- <button
- id="24hoursBtn"
- class="time-range-btn px-4 py-2 rounded-md text-sm font-medium text-gray-500 hover:text-blue-600"
- >
- {{ _("24 Horas") }}
- </button>
- </div>
- </div>
- <div class="flex border-b mb-6">
- <button
- class="tab-btn active py-3 px-6 font-medium border-b-2 border-blue-600 text-blue-600 transition-all duration-300 ease-in-out hover:bg-slate-100"
- >
- {{ _("CPU") }}
- </button>
- <button
- class="tab-btn py-3 px-6 font-medium text-gray-500 hover:text-blue-600 transition-all duration-300 ease-in-out hover:bg-slate-100"
- >
- {{ _("RAM") }}
- </button>
- <button
- class="tab-btn py-3 px-6 font-medium text-gray-500 hover:text-blue-600 transition-all duration-300 ease-in-out hover:bg-slate-100"
- >
- {{ _("SWAP") }}
- </button>
- </div>
- <div class="tab-content active">
- <div class="h-80"><canvas id="cpuChart"></canvas></div>
- </div>
- <div class="tab-content">
- <div class="h-80"><canvas id="ramChart"></canvas></div>
- </div>
- <div class="tab-content">
- <div class="h-80"><canvas id="swapChart"></canvas></div>
- </div>
- </section>
- </div>
- <div id="cacheContent" class="main-tab-content">
- <section class="cache-stats">
- <div class="bg-white rounded-xl shadow-lg p-6 mb-8">
- <div class="flex items-center mb-6">
- <i class="fas fa-database text-2xl text-blue-600 mr-3"></i>
- <h2 class="text-2xl font-bold text-gray-800">
- {{ _("Estadísticas de Caché") }}
- </h2>
- </div>
- <div
- class="grid grid-cols-1 sm:grid-cols-2 md:grid-cols-3 gap-8 max-w-[1000px] mx-auto"
- >
- {{ flip_card(icon='fas fa-database', title=_('Entradas almacenadas'),
- value=cache_stats.store_entries, back_title=_('Entradas almacenadas'),
- description=_('Número de objetos actualmente en la caché de Squid.'),
- stat_id='entradas_almacenadas') }}
- {{ flip_card(icon='fas fa-chart-pie', title=_('Uso de capacidad'),
- value=cache_stats.capacity_used, back_title=_('Uso de capacidad'),
- description=_('Porcentaje del almacenamiento de caché en uso actualmente.'),
- stat_id='uso_de_capacidad') }}
- {% if
- cache_stats.fs_space_total and cache_stats.fs_space_total > 0 %}
- {% set total_space_html %}{% if (cache_stats.fs_space_total /
- 1024) < 1024 %}
- <p class="text-xl text-blue-800" data-stat="espacio_total">
- {{ (cache_stats.fs_space_total / 1024)|int }} {{ _("MB") }}
- </p>
- {% else %}
- <p class="text-xl text-blue-800" data-stat="espacio_total">
- {{ (cache_stats.fs_space_total / 1024 / 1024)|round(2) }} {{ _("GB") }}
- </p>
- {% endif %}{% endset %} {{ flip_card(icon='fas fa-hdd',
- title=_('Espacio total'), back_title=_('Espacio total'),
- description=_('Tamaño total del disco asignado a la caché de Squid.'), extra_html=total_space_html) }}
- {% else %}
- {% set no_space_html %}
- <p class="text-xl text-red-600">{{ _('No disponible') }}</p>
- {% endset %}
- {{ flip_card(icon='fas fa-hdd', title=_('Espacio total'),
- back_title=_('Espacio total'),
- description=_('Tamaño total del disco asignado a la caché de Squid.'), extra_html=no_space_html) }}
- {% endif %} {% set used_space_html %}{% if
- (cache_stats.fs_space_used / 1024) < 1024 %}
- <p class="text-xl text-blue-800" data-stat="espacio_usado">
- {{ (cache_stats.fs_space_used / 1024)|int }} {{ _("MB") }}
- </p>
- {% else %}
- <p class="text-xl text-blue-800" data-stat="espacio_usado">
- {{ (cache_stats.fs_space_used / 1024 / 1024)|round(2) }} {{ _("GB") }}
- </p>
- {% endif %}{% endset %}{{ flip_card(icon='fas fa-folder-open',
- title=_('Espacio usado'), back_title=_('Espacio usado'),
- description=_('Cantidad de espacio de disco ya ocupado por objetos en caché.'), extra_html=used_space_html) }}
- {{ flip_card(icon='fas fa-recycle', title=_('Eliminación'),
- value=cache_stats.removal_policy, back_title=_('Política de eliminación'),
- description=_('Método que Squid usa para eliminar objetos antiguos de la caché.'),
- stat_id='eliminación') }}
- {{ flip_card(icon='fas fa-clock', title=_('Edad LRU'),
- value=cache_stats.lru_age_days ~ ' ' ~ _('días'),
- back_title=_('Edad LRU'),
- description=_('Tiempo desde que el objeto menos usado fue accedido por última vez.'),
- stat_id='edad_lru') }}
- </div>
- </div>
- </section>
- </div>
- <div id="networkContent" class="main-tab-content">
- <section class="bg-white rounded-xl shadow-lg p-6">
- <div class="flex items-center mb-6">
- <i class="fas fa-network-wired text-2xl text-blue-600 mr-3"></i>
- <h2 class="text-xl font-bold text-gray-800">{{ _("Tráfico de Red") }}</h2>
- </div>
- <div class="h-80"><canvas id="networkChart"></canvas></div>
- </section>
- </div>
- </div>
|