3x-ui: add expiry days and start-after-first-use for clients

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-07-25 22:18:37 +03:00
co-authored by Cursor
parent 1626c16df0
commit 1b2fea4539
4 changed files with 68 additions and 9 deletions
+26
View File
@@ -36,6 +36,12 @@
<p style="margin:0"><strong>{{ created.email }}</strong> → inbound #{{ created.inbound_id }}</p>
{% if created.protocol == 'vless' %}
{% if created.uuid %}<p class="muted" style="margin:0">UUID: <code>{{ created.uuid }}</code>{% if created.flow %} · flow: {{ created.flow }}{% endif %}</p>{% endif %}
{% if created.expiry_days %}
<p class="muted" style="margin:0">
Срок: {{ created.expiry_days }} дн.
{% if created.start_after_first_use %}· старт после первого использования{% else %}· с момента создания{% endif %}
</p>
{% endif %}
{% if created.links %}
{% for link in created.links %}
<pre class="mono">{{ link }}</pre>
@@ -44,6 +50,12 @@
<p class="muted">Ссылка vless:// появится в 3x-ui (Clients → Copy URL).</p>
{% endif %}
{% elif created.protocol == 'wireguard' %}
{% if created.expiry_days %}
<p class="muted" style="margin:0">
Срок: {{ created.expiry_days }} дн.
{% if created.start_after_first_use %}· старт после первого использования{% else %}· с момента создания{% endif %}
</p>
{% endif %}
<p class="muted" style="margin:0">Ключи клиента (конфиг соберите в 3x-ui или ниже):</p>
<pre class="mono">PrivateKey = {{ created.privateKey }}
PublicKey = {{ created.publicKey }}
@@ -91,6 +103,9 @@ PublicKey = {{ created.publicKey }}
<input name="flow" placeholder="xtls-rprx-vision" />
</label>
<div class="form-grid-2">
<label>Срок действия (дни, 0 = безлимит)
<input type="number" name="expiry_days" value="30" min="0" />
</label>
<label>Лимит GB
<input type="number" name="total_gb" value="0" min="0" />
</label>
@@ -98,6 +113,10 @@ PublicKey = {{ created.publicKey }}
<input type="number" name="limit_ip" value="0" min="0" />
</label>
</div>
<label class="check">
<input type="checkbox" name="start_after_first_use" value="1" checked />
Старт после первого использования
</label>
<label>Комментарий
<input name="comment" />
</label>
@@ -124,6 +143,9 @@ PublicKey = {{ created.publicKey }}
</select>
</label>
<div class="form-grid-2">
<label>Срок действия (дни, 0 = безлимит)
<input type="number" name="expiry_days" value="30" min="0" />
</label>
<label>Лимит GB
<input type="number" name="total_gb" value="0" min="0" />
</label>
@@ -131,6 +153,10 @@ PublicKey = {{ created.publicKey }}
<input type="number" name="limit_ip" value="0" min="0" />
</label>
</div>
<label class="check">
<input type="checkbox" name="start_after_first_use" value="1" checked />
Старт после первого использования
</label>
<label>Комментарий
<input name="comment" />
</label>