feat(admin): 封禁列表管理页(/admin/banned + Banned.vue)
- 后端新增 8 个接口:GET/POST /admin/banned、PUT/DELETE /admin/banned/{ip}、
GET /admin/banned/history、DELETE /admin/banned/history[/{hid}]、DELETE /admin/banned
- 配置新增 server.auth_fail_ban_seconds(默认 3600,0=只限流不拉黑):
同一 IP 每分钟鉴权失败超限即自动封禁,被封期间该 IP 的 API 请求返回 429
- 前端新增「封禁列表」页(仅管理员可见)+ 中英文文案,
支持单个解封 / 全部解封 / 删除历史记录 / 查看解封时间与剩余时长
This commit is contained in:
1 parent
83ecea482f
commit
f3255b4d73
8 files changed
+927
-9
No files matched your search
@@ -1,5 +1,69 @@
|
||||
// English locale resource
|
||||
export default {
|
||||
banned: {
|
||||
title: 'Banned IPs',
|
||||
count: '{n} IP(s) banned',
|
||||
rule: 'An IP is auto-banned for {mins} min after {n} auth failures within a minute. While banned, every API request from it returns 429; other sources are unaffected.',
|
||||
remaining: '{mins} min left',
|
||||
until: 'Unban at',
|
||||
unban: 'Unban',
|
||||
empty: 'No banned IPs',
|
||||
unbanned: 'Unbanned {ip}',
|
||||
clearAll: 'Unban all',
|
||||
clearTitle: 'Clear all bans',
|
||||
clearConfirm: 'Clear all bans? Those IPs can access immediately afterwards.',
|
||||
cleared: 'Cleared {n} ban(s)',
|
||||
manualTitle: 'Manual ban',
|
||||
manualSub: 'Ban an IP right away instead of waiting for the auto rule',
|
||||
manualHint: 'Public IPs only. Loopback and private ranges (10./192.168./172.) cannot be banned, so the local reverse proxy and your own LAN devices stay reachable.',
|
||||
ipPlaceholder: 'IP address, e.g. 1.2.3.4',
|
||||
notePlaceholder: 'Note (optional, e.g. "brute force")',
|
||||
doBan: 'Ban',
|
||||
ipRequired: 'Please enter an IP address',
|
||||
banned: 'Banned {ip} for {mins} min',
|
||||
bannedForever: 'Permanently banned {ip}',
|
||||
extend: 'Extend',
|
||||
extended: 'Extended {ip} by {mins} min',
|
||||
extendedForever: '{ip} is now banned permanently',
|
||||
toPermanent: 'Make permanent',
|
||||
permanentTag: 'permanent',
|
||||
neverExpire: 'Permanent — will not expire automatically',
|
||||
historyTitle: 'Ban history',
|
||||
historySub: 'Recent actions (ban / unban / extend)',
|
||||
historyEmpty: 'No ban actions yet',
|
||||
unitDay: '{n} day(s)',
|
||||
unitHour: '{n} hour(s)',
|
||||
unitMin: '{n} min',
|
||||
hisOps: 'Action',
|
||||
hisDelete: 'Delete',
|
||||
hisDeleted: 'History entry deleted',
|
||||
hisClearAll: 'Clear history',
|
||||
hisClearConfirm: 'Clear all ban history? This cannot be undone (active bans are not affected).',
|
||||
hisCleared: 'Cleared {n} history entries',
|
||||
hisTime: 'Time',
|
||||
hisAction: 'Action',
|
||||
hisIp: 'IP',
|
||||
hisDuration: 'Duration',
|
||||
hisActor: 'By',
|
||||
hisNote: 'Note',
|
||||
act: {
|
||||
manual_ban: 'manual ban',
|
||||
auto_ban: 'auto ban',
|
||||
extend: 'extend',
|
||||
unban: 'unban',
|
||||
unban_all: 'clear all',
|
||||
},
|
||||
dur: {
|
||||
m10: '10 minutes',
|
||||
m30: '30 minutes',
|
||||
h1: '1 hour',
|
||||
h6: '6 hours',
|
||||
d1: '1 day',
|
||||
d30: '30 days',
|
||||
forever: 'permanent',
|
||||
},
|
||||
},
|
||||
|
||||
nav: {
|
||||
title: 'API Gateway',
|
||||
connected: 'Connected to api.wangjinding.com',
|
||||
@@ -16,6 +80,7 @@ export default {
|
||||
menulogs: 'Logs',
|
||||
menufeedback: 'Feedback',
|
||||
menufeedbackinbox: 'User feedback',
|
||||
menubanned: 'Banned IPs',
|
||||
feedbackTodoTip: '{n} pending (open + in progress)',
|
||||
menusettings: 'Settings',
|
||||
control: 'Console',
|
||||
|
||||
Reference in new issue
Block a user