diff --git a/.research/frontend-refactor/detection.tsx b/.research/frontend-refactor/detection.tsx index 1ca2a76..c89acd9 100644 --- a/.research/frontend-refactor/detection.tsx +++ b/.research/frontend-refactor/detection.tsx @@ -57,13 +57,13 @@ const SOURCE_CONFIG = { icon: faBrain, }, Rule: { - label: '規則', + label: 'Rule', color: '#2563eb', bgColor: 'rgba(37,99,235,0.10)', icon: faScroll, }, Fusion: { - label: '融合', + label: 'Fusion', color: '#dc2626', bgColor: 'rgba(220,38,38,0.10)', icon: faLayerGroup, @@ -72,13 +72,13 @@ const SOURCE_CONFIG = { const SEVERITY_CONFIG = { Critical: { - label: '嚴重', + label: 'Critical', color: '#dc2626', bgColor: 'rgba(220,38,38,0.10)', icon: faExclamationTriangle, }, High: { - label: '高', + label: 'High', color: '#d97706', bgColor: 'rgba(217,119,6,0.10)', icon: faExclamationTriangle, @@ -97,7 +97,7 @@ const formatProtocol = (proto: number): string => PROTOCOL_MAP[proto] ?? `Proto(${proto})` const formatTimestamp = (unix: number): string => - new Date(unix * 1000).toLocaleString('zh-TW', { + new Date(unix * 1000).toLocaleString('en-US', { month: '2-digit', day: '2-digit', hour: '2-digit', @@ -266,8 +266,8 @@ const AlertDetails: React.FC = ({ alert, onClose, showNotific putData( url, `${formatted}:${portStr}`, - () => showNotification(`已成功添加到黑名單: ${ip}:${blockAll ? '*' : port}`, 'success'), - (err: any) => showNotification(`添加到黑名單失敗: ${err.message}`, 'error') + () => showNotification(`Added to blocklist: ${ip}:${blockAll ? '*' : port}`, 'success'), + (err: any) => showNotification(`Failed to add to blocklist: ${err.message}`, 'error') ) }, [isIPv6Src, isIPv6Dst, showNotification] @@ -284,8 +284,8 @@ const AlertDetails: React.FC = ({ alert, onClose, showNotific putData( url, `${formatted}:${portStr}`, - () => showNotification(`已成功添加到白名單: ${ip}:${allowAll ? '*' : port}`, 'success'), - (err: any) => showNotification(`添加到白名單失敗: ${err.message}`, 'error') + () => showNotification(`Added to allowlist: ${ip}:${allowAll ? '*' : port}`, 'success'), + (err: any) => showNotification(`Failed to add to allowlist: ${err.message}`, 'error') ) }, [isIPv6Src, isIPv6Dst, showNotification] @@ -302,28 +302,28 @@ const AlertDetails: React.FC = ({ alert, onClose, showNotific onClick={() => handleBlockIP(ip, port, isSource)} > - 封鎖 :{port} + Block :{port} @@ -340,7 +340,7 @@ const AlertDetails: React.FC = ({ alert, onClose, showNotific

- 警報詳情 + Alert Details

{/* Live indicator */} @@ -643,7 +643,7 @@ const Detection: React.FC = () => { }`} /> - {isPaused ? '已暫停' : '監控中'} + {isPaused ? 'Paused' : 'Live'}
@@ -651,7 +651,7 @@ const Detection: React.FC = () => { {/* Source filter */}
- 來源: + Source: {(['all', 'Ml', 'Rule', 'Fusion'] as const).map(s => ( { : '#dc2626' } > - {s === 'all' ? '全部' : SOURCE_CONFIG[s].label} + {s === 'all' ? 'All' : SOURCE_CONFIG[s].label} ))}
@@ -673,7 +673,7 @@ const Detection: React.FC = () => { {/* Severity filter */}
- 嚴重度: + Severity: {(['all', 'Critical', 'High'] as const).map(s => ( { s === 'all' ? '#374151' : s === 'Critical' ? '#dc2626' : '#d97706' } > - {s === 'all' ? '全部' : SEVERITY_CONFIG[s].label} + {s === 'all' ? 'All' : SEVERITY_CONFIG[s].label} ))}
- {filteredAlerts.length} / {alerts.length} 筆 + {filteredAlerts.length} / {alerts.length} alerts
@@ -706,9 +706,9 @@ const Detection: React.FC = () => {

- 安全警報 + Security Alerts

- {filteredAlerts.length} 條 + {filteredAlerts.length} alerts
@@ -716,12 +716,12 @@ const Detection: React.FC = () => {

- {alerts.length === 0 ? '尚無警報' : '無符合條件的警報'} + {alerts.length === 0 ? 'No alerts' : 'No matching alerts'}

{alerts.length === 0 - ? '系統偵測到威脅時將在此顯示' - : '請調整過濾條件'} + ? 'Alerts will appear here when threats are detected' + : 'Try adjusting the filters'}

) : (