{% extends "console/base.html" %} {% load static ostium_ui %} {% block title %}总览{% endblock %} {% block breadcrumb %}总览{% endblock %} {% block page_header %}
{% icon "zap" "w-3.5 h-3.5" %} 服务器脉搏

今天的服务器,一眼看清

实时掌握数据面状态、在线用户、流量走势与需要处理的事项。

{% icon "terminal" %} 查看日志 {% icon "plus" %} 新增用户
{% csrf_token %}
{% endblock %} {% block content %}
{% if state.worker_alive and state.singbox_running %}运行中{% elif state.worker_alive %}降级运行{% else %}已停止{% endif %} {% if pending_apply %}配置待应用{% endif %} {% if maintenance_mode %}维护模式{% endif %}

{% if state.worker_alive and state.singbox_running %} 数据面正在顺畅运行 {% elif state.worker_alive %} 数据面部分降级 {% else %} 数据面需要处理 {% endif %}

{% if state.last_error %} {{ state.last_error|truncatechars:160 }} {% else %} sing-box 由 worker 直接监督,所有线路与用户来自数据库的单一事实源。最近一次成功应用:{{ state.updated_at|ago }}。 {% endif %}

{% icon "up" "w-3 h-3" %} 上行速率
{{ total_uplink_rate|bps }}
{% icon "down" "w-3 h-3" %} 下行速率
{{ total_downlink_rate|bps }}
{% icon "activity" "w-3 h-3" %} 今日流量
{{ today_total|bytes }}
{% icon "clock" "w-3 h-3" %} 运行时长
{{ uptime_seconds|duration }}
{{ online_count }}
在线用户
当前连接 基于最近 60 秒流量 配置 {{ state.config_sha256|shorthash }}
Worker
{% if state.worker_alive %}健康{% else %}离线{% endif %}
sing-box
{% if state.singbox_running %}PID {{ state.singbox_pid }}{% else %}未运行{% endif %}
已应用版本
{{ state.applied_revision }}
期望版本
{{ state.desired_revision }}
{% if onboarding_incomplete %}
{% icon "check" %} 部署检查清单
{{ onboarding_done }} / {{ onboarding_total }} 完成
{% for item in onboarding %} {% if item.done %} {% icon "check" "w-3.5 h-3.5" %} {% endif %} {{ item.title }} {{ item.detail }} {% if not item.done %}去处理{% endif %} {% endfor %}
{% endif %}
用户总数 {% icon "users" %}
{{ users_total }}人
{{ users_enabled }} 已启用 · {{ online_count }} 在线
今日流量 {% icon "chart" %}
{{ today_total|bytes }}
↑ {{ today_uplink|bytes }} · ↓ {{ today_downlink|bytes }}
核心状态 {% icon "server" %}
{% if state.singbox_running %}正常{% else %}停止{% endif %}
{% if state.singbox_running %}已运行 {{ uptime_seconds|duration }}{% else %}等待 worker 恢复{% endif %}
最近到期证书 {% icon "certificate" %}
{% if certificates_soon %} {% with cert=certificates_soon.0 %}
{{ cert.days_remaining }}天
{{ cert.domain }}
{% endwith %} {% else %}
—
30 天内无到期证书
{% endif %}
{% icon "chart" %} 流量走势
最近 7 天,按日聚合的上行与下行
上行 下行
{% icon "gauge" %} 健康检查
详情
{% for item in health %}
{{ item.name }} {{ item.detail }}
{% endfor %}
统计接口 {% if usage.stats_ok %}正常{% else %}不可用{% endif %}
{% icon "wifi" %} 在线用户 Top 5
全部在线
{% if top_online %}
{% for item in top_online %} {% endfor %}
用户 上行 下行 配额 最近在线
{{ item.user.name|first|upper }}{{ item.user.name }} {{ item.uplink_rate|bps }} {{ item.downlink_rate|bps }} {% if item.user.quota_percent is not None %} {{ item.user.quota_percent|floatformat:0 }}% {% else %}不限{% endif %} {{ item.user.last_seen_at|ago }}
{% else %}
{% icon "wifi" %}
当前没有在线用户
当客户端通过订阅连接并产生流量后,会在这里显示。
去发订阅
{% endif %}
{% icon "bell" %} 最近告警
{{ unack_alerts_count }} 未确认
{% if alerts %}
{% for alert in alerts %}
{{ alert.message|truncatechars:90 }}
{{ alert.code }} · {{ alert.last_seen_at|ago }}
{% csrf_token %}
{% endfor %}
{% else %}
{% icon "check" %}
一切正常
没有未确认的告警。
{% endif %}
{% icon "clock" %} 最近任务
全部任务
{% if jobs %}
{% for job in jobs %} {% endfor %}
任务 状态 开始 耗时
{{ job.name|default:job.func }} {% if job.success %}成功{% else %}失败{% endif %} {{ job.started|ago }} {{ job.time_taken|floatformat:1 }}s
{% else %}
{% icon "clock" %}
还没有后台任务
备份、证书同步等任务会显示在这里。
{% endif %}
{% icon "zap" %} 快捷操作
{{ series|json_script:"traffic-data" }} {% endblock %} {% block scripts %} {% endblock %}