Publish reviewed history-free open-source snapshot (2026-10-12)
This commit is contained in:
@@ -0,0 +1,110 @@
|
||||
{% extends "base.html" %}
|
||||
{% load vpn_tags static %}
|
||||
{% block title %}用户中心 · {{ PLATFORM_NAME }}{% endblock %}
|
||||
{% block content %}
|
||||
<section class="hero-row">
|
||||
<div>
|
||||
<span class="eyebrow">个人中心</span>
|
||||
<h1>{{ user.display_name|default:user.username }},你好</h1>
|
||||
<div class="account-meta"><span>账号:{{ user.username }}</span><span class="identity-badge">{{ user.get_identity_type_display }}</span></div>
|
||||
</div>
|
||||
<div class="account-status">账户状态 <span class="status-pill {{ user.account_status|status_class }}">{{ user.get_account_status_display }}</span></div>
|
||||
</section>
|
||||
|
||||
{% include 'includes/lifecycle.html' %}
|
||||
{% if user_teams %}<div class="account-meta team-shortcuts"><span>我的团队:</span>{% for team in user_teams %}<a href="{% url 'team-detail' team.pk %}">{{ team.name }}</a>{% endfor %}</div>{% endif %}
|
||||
|
||||
{% if subscription %}
|
||||
<section class="dashboard-grid">
|
||||
<article class="card span-2">
|
||||
<div class="card-head">
|
||||
<div class="heading-icon"><span class="icon-tile">{% include 'includes/icon.html' with name='plan' %}</span><div><span class="card-kicker">当前订阅</span><h2>{{ subscription.plan.name }}</h2></div></div>
|
||||
<span class="status-pill {{ subscription.status|status_class }}">{{ subscription.get_status_display }}</span>
|
||||
</div>
|
||||
<div class="metrics">
|
||||
<div><small>本期已用代理流量</small><strong>{{ subscription.used_bytes|bytes_human }}</strong></div>
|
||||
<div><small>流量额度</small><strong>{% if subscription.traffic_limit_bytes %}{{ subscription.traffic_limit_bytes|bytes_human }}{% else %}不限{% endif %}</strong></div>
|
||||
<div><small>设备数量</small><strong>{{ subscription.devices.count }} / {{ subscription.device_limit }}</strong></div>
|
||||
<div><small>到期时间</small><strong>{% if subscription.expires_at %}{{ subscription.expires_at|date:"Y-m-d H:i" }}{% else %}长期有效{% endif %}</strong></div>
|
||||
</div>
|
||||
{% if subscription.traffic_limit_bytes %}
|
||||
<div class="progress"><span style="width: {{ subscription.usage_percent }}%"></span></div>
|
||||
{% endif %}
|
||||
{% if subscription.state_reason %}<p class="notice-line">{{ subscription.state_reason }}</p>{% endif %}
|
||||
</article>
|
||||
|
||||
<article class="card">
|
||||
<div class="heading-icon"><span class="icon-tile">{% include 'includes/icon.html' with name='network' %}</span><span class="card-kicker">线路策略</span></div>
|
||||
<h2>{{ subscription.get_route_mode_display }}</h2>
|
||||
<p class="muted">{% if subscription.effective_routing_policy %}{{ subscription.effective_routing_policy.name }}{% else %}尚未设置全局策略{% endif %}</p>
|
||||
<dl class="detail-list">
|
||||
<div><dt>节点下发</dt><dd>{{ subscription.get_provisioning_state_display }}</dd></div>
|
||||
<div><dt>可用节点</dt><dd>{{ subscription.nodes_for_subscription.count }}</dd></div>
|
||||
</dl>
|
||||
<p class="section-subtitle">这里展示订阅配置,实际连接状态请在客户端查看。</p>
|
||||
</article>
|
||||
</section>
|
||||
|
||||
<section class="card subscription-card">
|
||||
<div>
|
||||
<span class="card-kicker">Mihomo / Clash Meta 订阅</span>
|
||||
<h2>专属订阅地址</h2>
|
||||
<p class="muted">这是个人凭据,请勿转发。重置后旧地址立即失效。</p>
|
||||
</div>
|
||||
{% if subscription.status == "active" %}
|
||||
<div class="copy-row">
|
||||
<input id="subscription-url" readonly value="{{ subscription.subscription_url }}" aria-label="订阅地址">
|
||||
<button class="button secondary" type="button" data-copy-target="subscription-url">复制地址</button>
|
||||
</div>
|
||||
<p id="copy-feedback" class="copy-feedback" role="status" aria-live="polite"></p>
|
||||
{% else %}
|
||||
<div class="empty-note">订阅当前不可用:{{ subscription.get_status_display }}</div>
|
||||
{% endif %}
|
||||
</section>
|
||||
{% else %}
|
||||
<section class="empty-state">
|
||||
<div>
|
||||
<span class="icon-tile">{% include 'includes/icon.html' with name='shield' %}</span>
|
||||
<h2>开启你的专属网络服务</h2>
|
||||
<p>还没有可用订阅。选择适合的套餐,提交申请后可在这里查看审核进度和订阅信息。</p>
|
||||
<a class="button primary" href="{% url 'apply-plan' %}">申请套餐 {% include 'includes/icon.html' with name='arrow' %}</a>
|
||||
</div>
|
||||
<ol class="setup-steps" aria-label="开通流程">
|
||||
<li><span class="step-number">01</span><div><strong>选择套餐</strong><small>内部员工核实身份后免费,外部人员按套餐计费</small></div></li>
|
||||
<li><span class="step-number">02</span><div><strong>提交申请 · 等待审核</strong><small>暂未开放付款的套餐只登记申请,不扣款</small></div></li>
|
||||
<li><span class="step-number">03</span><div><strong>获取订阅 · 开始使用</strong><small>满足开通条件并审核后,系统自动关联订阅</small></div></li>
|
||||
</ol>
|
||||
</section>
|
||||
{% endif %}
|
||||
|
||||
{% if plan_cards %}
|
||||
<section class="section-block">
|
||||
<div class="section-title"><div><div class="heading-icon">{% include 'includes/icon.html' with name='plan' %}<h2>可申请套餐</h2></div><p class="section-subtitle">按需选择 · 审核后自动关联订阅 · 仅计代理流量</p></div></div>
|
||||
<div class="plan-grid">
|
||||
{% for card in plan_cards %}
|
||||
<article class="card plan-card">
|
||||
<h2>{{ card.plan.name }}</h2>
|
||||
<p class="plan-label">{{ card.label }}</p>
|
||||
<p class="muted">仅计代理流量 · 设备上限 {{ card.plan.device_limit }} 台{% if card.plan.billing_months %} · 从开通日起按月计,到期不自动扣款{% endif %}</p>
|
||||
{% if card.payment_pending %}<p class="notice-line">暂未开放付款:可登记申请,不扣款、不立即开通付费服务。</p>{% else %}<p class="muted">提交申请后由管理员审核,批准后自动关联订阅。</p>{% endif %}
|
||||
<a class="button secondary" href="{% url 'apply-plan' %}">选择并申请</a>
|
||||
</article>
|
||||
{% endfor %}
|
||||
</div>
|
||||
</section>
|
||||
{% endif %}
|
||||
|
||||
<section class="section-block">
|
||||
<div class="section-title"><div class="heading-icon">{% include 'includes/icon.html' with name='history' %}<h2>套餐申请记录</h2></div><a class="button secondary" href="{% url 'apply-plan' %}">{% if subscription %}申请更换套餐{% else %}新申请{% endif %}</a></div>
|
||||
{% if applications %}
|
||||
<div class="table-wrap"><table><thead><tr><th>申请时间</th><th>套餐</th><th>处理状态</th><th>付款状态</th></tr></thead><tbody>
|
||||
{% for application in applications %}<tr><td>{{ application.created_at|date:"Y-m-d H:i" }}</td><td>{{ application.plan.name }}</td><td><span class="status-pill {{ application.status|status_class }}">{{ application.get_status_display }}</span></td><td>{% if application.plan.online_payment_required and application.payment_status == 'unpaid' %}暂未开放付款{% else %}{{ application.get_payment_status_display }}{% endif %}</td></tr>{% endfor %}
|
||||
</tbody></table></div>
|
||||
{% else %}
|
||||
<div class="card records-empty"><span class="icon-tile">{% include 'includes/icon.html' with name='history' %}</span><div><strong>暂无申请记录</strong><p class="muted">提交套餐申请后,处理进度会显示在这里。</p></div></div>
|
||||
{% endif %}
|
||||
</section>
|
||||
{% endblock %}
|
||||
{% block scripts %}
|
||||
<script src="{% static 'js/portal.js' %}" defer></script>
|
||||
{% endblock %}
|
||||
Reference in New Issue
Block a user