{% extends "base.html" %} {% block title %}仪表盘 - Squid Manager{% endblock %} {% block head %} {% endblock %} {% block content %} {% if active_alerts %}

🚨 当前活跃告警 ({{ active_alerts | length }})

{% endif %} {% if entries_count == 0 %}
📭

暂无日志数据

请检查访问日志路径是否正确,或 手动导入日志进行分析。

当前路径: {{ cfg.access_log_path }}

如需修改,请前往 路径设置

{% else %}
总请求数
{{ stats.total_requests | thousands }}
{{ stats.unique_clients }} 个客户端 · {{ stats.unique_hosts }} 个目标主机
缓存命中率
{{ '%.1f' % (stats.hit_ratio * 100) }}%
命中 {{ stats.hits }} · 未命中 {{ stats.misses }}
总流量
{{ format_bytes(stats.total_bytes) }}
平均 {{ format_bytes(stats.avg_size_bytes) }}/请求
平均响应时间
{{ format_duration(stats.avg_elapsed_ms) }}
总耗时 {{ format_duration(stats.total_elapsed_ms) }}
拒绝率
{{ '%.2f' % (stats.denied_rate * 100) }}%
{{ stats.denied }} 条被 ACL 拒绝
中断率
{{ '%.2f' % (stats.aborted_rate * 100) }}%
{{ stats.aborted }} 条客户端中断
4xx 错误率
{{ '%.2f' % (stats.errors_4xx_rate * 100) }}%
{{ stats.errors_4xx_count }} 条
5xx 错误率
{{ '%.2f' % (stats.errors_5xx_rate * 100) }}%
{{ stats.errors_5xx_count }} 条

📈 每小时请求量与流量

🏷️ Squid 结果码分布

结果码含义 {% for code, desc in stats.result_code_legend.items() %} {% endfor %}
代码含义
{{ code }}{{ desc }}

🌐 HTTP 状态码分布

{% if stats.by_http %} {% for code, n in stats.by_http[:10] %} {% endfor %}
状态码次数占比
{{ code }} {{ n | thousands }} {{ '%.1f' % (n / stats.total_requests * 100) }}%
{% endif %}

🚀 HTTP 方法分布

📂 请求分类

Hit=缓存命中, Miss=未命中, Tunnel=CONNECT隧道, Denied=被拒, Aborted=中断, Error=错误

👥 Top 客户端 (按请求数)

{% for c in stats.top_clients[:20] %} {% endfor %}
#客户端 IP请求数流量占比
{{ loop.index }} {{ c.client }} {{ c.count | thousands }} {{ format_bytes(c.bytes) }} {{ '%.1f' % (c.count / stats.total_requests * 100) }}%

🌍 Top 目标主机 (按请求数)

{% for h in stats.top_hosts[:20] %} {% endfor %}
#目标主机请求数流量占比
{{ loop.index }} {{ h.host }} {{ h.count | thousands }} {{ format_bytes(h.bytes) }} {{ '%.1f' % (h.count / stats.total_requests * 100) }}%

🔗 层级代码分布 (Hierarchy)

{% for hier, n in stats.by_hierarchy[:15] %} {% endfor %}
层级代码次数含义
{{ hier }} {{ n | thousands }} {{ stats.hierarchy_legend.get(hier, '-') }}

📦 Content-Type 分布

{% for ct, n in stats.by_ctype[:15] %} {% endfor %}
Content-Type次数占比
{{ ct }} {{ n | thousands }} {{ '%.1f' % (n / stats.total_requests * 100) }}%

🔗 Top URL (访问最多的资源)

{% for u in stats.top_urls[:20] %} {% endfor %}
#URL访问次数
{{ loop.index }} {{ u.url }} {{ u.count | thousands }}
{% endif %} {% endblock %} {% block scripts %} {% endblock %}