feat: add user creation and ban/unban for agent backend

- Backend: POST /agent/users - create user with optional card recharge
- Backend: PUT /agent/users/:id/status - ban/unban user
- Frontend: add create user page for agent (select app, card type)
- Frontend: add ban/unban action in user list with confirm dialog
- Frontend: add actions dropdown column in user data table
- Fix: cloud variables records page i18n key (agent.finance.to -> agent.cloudVariables.records.to)
- Add i18n keys for agent user management (create, ban, unban)
This commit is contained in:
2026-05-11 08:24:30 +08:00
parent 3cea807353
commit 57e1d10689
9 changed files with 793 additions and 7 deletions
+45 -1
View File
@@ -2767,8 +2767,15 @@
"lastLogin": "Last Login",
"active": "Active",
"totalUsers": "Total Users",
"addUser": "Add User",
"searchPlaceholder": "Search username or email...",
"select": "Select",
"banUser": "Ban User",
"unbanUser": "Unban User",
"banConfirm": "Are you sure you want to ban user {username}?",
"unbanConfirm": "Are you sure you want to unban user {username}?",
"statusUpdateSuccess": "User status updated successfully",
"statusUpdateFailed": "Failed to update user status",
"columns": {
"username": "Username",
"email": "Email",
@@ -2780,6 +2787,42 @@
"active": "Active",
"disabled": "Disabled",
"banned": "Banned"
},
"create": {
"title": "Create User",
"description": "Create a new user under your application",
"basicInfo": "Basic Information",
"basicInfoDesc": "Fill in user basic information",
"application": "Application",
"selectApplication": "Select application",
"username": "Username",
"usernamePlaceholder": "Enter username",
"usernameRequired": "Username is required",
"password": "Password",
"passwordPlaceholder": "Enter password",
"passwordRequired": "Password is required",
"email": "Email",
"emailPlaceholder": "Enter email (optional)",
"applicationRequired": "Please select an application",
"rechargeCard": "Recharge Card",
"rechargeCardDesc": "Recharge with card on creation (optional)",
"cardType": "Card Type",
"selectCardType": "Select card type",
"selectApplicationFirst": "Select application first",
"noRecharge": "No Recharge",
"cardQuantity": "Card Quantity",
"cardValue": "Card Value",
"permanent": "Permanent",
"days": "days",
"points": "points",
"preview": "Preview",
"app": "Application",
"usernameLabel": "Username",
"emailLabel": "Email",
"submit": "Create User",
"cancel": "Cancel",
"success": "User created successfully",
"failed": "Failed to create user"
}
},
"apps": {
@@ -2929,7 +2972,8 @@
"createdAt": "Created At",
"searchPlaceholder": "Search records...",
"startDate": "Start Date",
"endDate": "End Date"
"endDate": "End Date",
"to": "to"
}
}
},
+46 -1
View File
@@ -2117,6 +2117,7 @@
"searchPlaceholder": "搜索记录...",
"startDate": "开始日期",
"endDate": "结束日期",
"to": "至",
"total": "共 {count} 条记录",
"totalRecords": "总记录数",
"maxRecords": "最大 {count} 条",
@@ -2768,8 +2769,15 @@
"lastLogin": "最后登录",
"active": "正常",
"totalUsers": "用户总数",
"addUser": "添加用户",
"searchPlaceholder": "搜索用户名或邮箱...",
"select": "选择",
"banUser": "封禁用户",
"unbanUser": "解封用户",
"banConfirm": "确定要封禁用户 {username} 吗?",
"unbanConfirm": "确定要解封用户 {username} 吗?",
"statusUpdateSuccess": "用户状态更新成功",
"statusUpdateFailed": "用户状态更新失败",
"columns": {
"username": "用户名",
"email": "邮箱",
@@ -2781,6 +2789,42 @@
"active": "正常",
"disabled": "禁用",
"banned": "封禁"
},
"create": {
"title": "创建用户",
"description": "在您的应用下创建新用户",
"basicInfo": "基本信息",
"basicInfoDesc": "填写用户基本信息",
"application": "所属应用",
"selectApplication": "请选择应用",
"username": "用户名",
"usernamePlaceholder": "请输入用户名",
"usernameRequired": "用户名不能为空",
"password": "密码",
"passwordPlaceholder": "请输入密码",
"passwordRequired": "密码不能为空",
"email": "邮箱",
"emailPlaceholder": "请输入邮箱(选填)",
"applicationRequired": "请选择所属应用",
"rechargeCard": "充值卡密",
"rechargeCardDesc": "创建时同时充值卡密(选填)",
"cardType": "卡密类型",
"selectCardType": "请选择卡密类型",
"selectApplicationFirst": "请先选择应用",
"noRecharge": "不充值",
"cardQuantity": "卡密数量",
"cardValue": "卡密面值",
"permanent": "永久",
"days": "天",
"points": "点数",
"preview": "预览",
"app": "应用",
"usernameLabel": "用户名",
"emailLabel": "邮箱",
"submit": "创建用户",
"cancel": "取消",
"success": "用户创建成功",
"failed": "用户创建失败"
}
},
"apps": {
@@ -2930,7 +2974,8 @@
"createdAt": "创建时间",
"searchPlaceholder": "搜索记录...",
"startDate": "开始日期",
"endDate": "结束日期"
"endDate": "结束日期",
"to": "至"
}
}
},