Show WireGuard QR, full .conf and ZIP download after 3x-ui client create
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -271,6 +271,11 @@ async def xui_add_client(
|
||||
"privateKey": result.get("privateKey"),
|
||||
"publicKey": result.get("publicKey"),
|
||||
"allowedIPs": result.get("allowedIPs") or [],
|
||||
"address": result.get("address"),
|
||||
"endpoint": result.get("endpoint"),
|
||||
"dns": result.get("dns"),
|
||||
"mtu": result.get("mtu"),
|
||||
"config_text": result.get("config_text"),
|
||||
"links": result.get("links") or [],
|
||||
"inbound": result.get("inbound"),
|
||||
"expiry_days": result.get("expiry_days"),
|
||||
@@ -278,6 +283,12 @@ async def xui_add_client(
|
||||
"expiryTime": result.get("expiryTime"),
|
||||
}
|
||||
payload = quote(json.dumps(slim, ensure_ascii=False))
|
||||
site_id = result.get("site_client_id")
|
||||
if site_id and result.get("protocol") == "wireguard" and result.get("config_text"):
|
||||
return RedirectResponse(
|
||||
f"/admin/clients/xui/{site_id}?flash=created",
|
||||
status_code=status.HTTP_303_SEE_OTHER,
|
||||
)
|
||||
return RedirectResponse(
|
||||
f"/admin/xui/{panel_id}?flash=client_created&created={payload}",
|
||||
status_code=status.HTTP_303_SEE_OTHER,
|
||||
|
||||
Reference in New Issue
Block a user