diff --git a/packages/frontend/src/locales/en.json b/packages/frontend/src/locales/en.json index 473c7c7..576c0ba 100644 --- a/packages/frontend/src/locales/en.json +++ b/packages/frontend/src/locales/en.json @@ -571,6 +571,36 @@ "error": { "sidebarPersistentSaveFailed": "Failed to save sidebar setting." } + }, + "ipBlacklist": { + "title": "IP Blacklist Management", + "description": "Configure login attempt limits and automatic ban duration. Local addresses (127.0.0.1, ::1) will not be banned.", + "maxAttemptsLabel": "Max Failed Attempts:", + "banDurationLabel": "Ban Duration (seconds):", + "saveConfigButton": "Save Configuration", + "currentBannedTitle": "Currently Banned IP Addresses", + "loadingList": "Loading blacklist...", + "noBannedIps": "No IP addresses are currently in the blacklist.", + "confirmRemoveIp": "Are you sure you want to remove the IP address \"{ip}\" from the blacklist?", + "table": { + "ipAddress": "IP Address", + "attempts": "Attempts", + "lastAttempt": "Last Attempt", + "bannedUntil": "Banned Until", + "actions": "Actions", + "removeButton": "Remove", + "deleting": "Deleting..." + }, + "success": { + "configUpdated": "Blacklist configuration updated successfully." + }, + "error": { + "fetchFailed": "Failed to fetch blacklist", + "deleteFailed": "Failed to delete", + "invalidMaxAttempts": "Max failed attempts must be a positive integer.", + "invalidBanDuration": "Ban duration must be a positive integer (seconds).", + "updateConfigFailed": "Failed to update blacklist configuration" + } } }, "common": { diff --git a/packages/frontend/src/locales/zh.json b/packages/frontend/src/locales/zh.json index 1373c95..b714c63 100644 --- a/packages/frontend/src/locales/zh.json +++ b/packages/frontend/src/locales/zh.json @@ -571,6 +571,36 @@ "error": { "sidebarPersistentSaveFailed": "保存侧边栏设置失败。" } + }, + "ipBlacklist": { + "title": "IP 黑名单管理", + "description": "配置登录失败次数限制和自动封禁时长。本地地址 (127.0.0.1, ::1) 不会被封禁。", + "maxAttemptsLabel": "最大失败次数:", + "banDurationLabel": "封禁时长 (秒):", + "saveConfigButton": "保存配置", + "currentBannedTitle": "当前已封禁的 IP 地址", + "loadingList": "正在加载黑名单...", + "noBannedIps": "当前没有 IP 地址在黑名单中。", + "confirmRemoveIp": "确定要从黑名单中移除 IP 地址 \"{ip}\" 吗?", + "table": { + "ipAddress": "IP 地址", + "attempts": "失败次数", + "lastAttempt": "最后尝试时间", + "bannedUntil": "封禁截止时间", + "actions": "操作", + "removeButton": "移除", + "deleting": "删除中..." + }, + "success": { + "configUpdated": "黑名单配置已成功更新。" + }, + "error": { + "fetchFailed": "获取黑名单失败", + "deleteFailed": "删除失败", + "invalidMaxAttempts": "最大失败次数必须是正整数。", + "invalidBanDuration": "封禁时长必须是正整数(秒)。", + "updateConfigFailed": "更新黑名单配置失败" + } } }, "common": { diff --git a/packages/frontend/src/views/SettingsView.vue b/packages/frontend/src/views/SettingsView.vue index fd3641a..634a628 100644 --- a/packages/frontend/src/views/SettingsView.vue +++ b/packages/frontend/src/views/SettingsView.vue @@ -146,44 +146,44 @@
配置登录失败次数限制和自动封禁时长。本地地址 (127.0.0.1, ::1) 不会被封禁。
+{{ $t('settings.ipBlacklist.description') }}
| IP 地址 | -失败次数 | -最后尝试时间 | -封禁截止时间 | -操作 | +{{ $t('settings.ipBlacklist.table.ipAddress') }} | +{{ $t('settings.ipBlacklist.table.attempts') }} | +{{ $t('settings.ipBlacklist.table.lastAttempt') }} | +{{ $t('settings.ipBlacklist.table.bannedUntil') }} | +{{ $t('settings.ipBlacklist.table.actions') }} | {{ entry.ip }} | {{ entry.attempts }} | {{ new Date(entry.last_attempt_at * 1000).toLocaleString() }} | -{{ entry.blocked_until ? new Date(entry.blocked_until * 1000).toLocaleString() : 'N/A' }} | +{{ entry.blocked_until ? new Date(entry.blocked_until * 1000).toLocaleString() : $t('statusMonitor.notAvailable') }} |
|---|
当前没有 IP 地址在黑名单中。
+{{ $t('settings.ipBlacklist.noBannedIps') }}
{{ blacklistDeleteError }}