3x-ui: add expiry days and start-after-first-use for clients
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
+7
-1
@@ -169,6 +169,8 @@ async def xui_add_client(
|
||||
inbound_id: int = Form(...),
|
||||
total_gb: int = Form(0),
|
||||
limit_ip: int = Form(0),
|
||||
expiry_days: int = Form(0),
|
||||
start_after_first_use: str = Form(""),
|
||||
flow: str = Form(""),
|
||||
comment: str = Form(""),
|
||||
db: AsyncSession = Depends(get_db),
|
||||
@@ -187,10 +189,11 @@ async def xui_add_client(
|
||||
inbound_id=inbound_id,
|
||||
total_gb=total_gb,
|
||||
limit_ip=limit_ip,
|
||||
expiry_days=expiry_days,
|
||||
start_after_first_use=start_after_first_use == "1",
|
||||
flow=flow.strip(),
|
||||
comment=comment.strip(),
|
||||
)
|
||||
# Keep redirect short: store essentials only
|
||||
slim = {
|
||||
"protocol": result.get("protocol"),
|
||||
"email": result.get("email"),
|
||||
@@ -201,6 +204,9 @@ async def xui_add_client(
|
||||
"publicKey": result.get("publicKey"),
|
||||
"links": result.get("links") or [],
|
||||
"inbound": result.get("inbound"),
|
||||
"expiry_days": result.get("expiry_days"),
|
||||
"start_after_first_use": result.get("start_after_first_use"),
|
||||
"expiryTime": result.get("expiryTime"),
|
||||
}
|
||||
payload = quote(json.dumps(slim, ensure_ascii=False))
|
||||
return RedirectResponse(
|
||||
|
||||
Reference in New Issue
Block a user