export default {
  common: {
    appName: 'xSight',
    save: '保存',
    cancel: '取消',
    delete: '删除',
    edit: '编辑',
    create: '创建',
    search: '搜索',
    confirm: '确认',
    actions: '操作',
    enabled: '已启用',
    disabled: '已禁用',
    status: '状态',
    type: '类型',
    description: '描述',
    name: '名称',
    id: 'ID',
    createdAt: '创建时间',
    yes: '是',
    no: '否',
    loading: '加载中...',
    noData: '暂无数据',
    showing: '显示',
    more: '更多',
    collapse: '收起',
    success: '成功',
    error: '错误',
    duplicate: '复制',
    theme: '主题',
    language: '语言',
    logout: '退出登录',
    classic: '经典',
    amber: '琥珀',
    refresh: '刷新',
    close: '关闭',
    updated: '已更新',
    created: '已创建',
    deleted: '已删除',
    failed: '操作失败',
    monitoring: '监控',
    infrastructure: '基础设施',
    detection: '检测',
    settings: '设置',
  },
  login: {
    title: '登录 xSight',
    subtitle: 'DDoS 检测与响应平台',
    username: '用户名',
    password: '密码',
    signIn: '登录',
    invalidCredentials: '用户名或密码错误',
  },
  nav: {
    dashboard: '仪表盘',
    nodes: '节点管理',
    templates: '阈值模板',
    prefixes: '监控前缀',
    thresholds: '阈值规则',
    responses: '响应配置',
    webhooks: 'Webhook',
    attacks: '攻击记录',
    mitigations: '活跃缓解',
    users: '用户管理',
    auditLog: '审计日志',
    trafficOverview: '流量总览',
    dynamicDetection: '动态检测',
    settings: '设置',
    webhookConnectors: 'Webhook 连接器',
    xdropConnectors: 'xDrop 连接器',
    shellConnectors: 'Shell 脚本',
    bgpConnectors: 'BGP 连接器',
  },
  nodes: {
    lastAckTip: '节点最后一次成功应用配置推送的时间',
    title: '节点管理',
    addNode: '添加节点',
    nodeId: '节点 ID',
    apiKey: 'API 密钥',
    mode: '运行模式',
    online: '在线',
    offline: '离线',
    configStatus: '配置状态',
    synced: '已同步',
    pending: '待同步',
    failed: '同步失败',
    deliveryVersion: '配置版本',
    current: '当前版本',
    applied: '已应用版本',
    drift: '版本偏差',
    lastAck: '最后确认',
  },
  prefixes: {
    title: '监控前缀管理',
    addPrefix: '添加前缀',
    prefix: '前缀 (CIDR)',
    parent: '父级前缀',
    ipGroup: 'IP 分组',
  },
  thresholds: {
    title: '阈值规则',
    addThreshold: '添加规则',
    domain: '域',
    direction: '方向',
    decoder: '解码器',
    unit: '单位',
    comparison: '比较',
    value: '阈值',
    inheritable: '可继承',
    pctRange: '有效范围：1–100',
    pctWarning: 'pct 阈值必须在 1–100 之间',
    response: '响应',
    templates: '阈值模板',
    usedBy: '使用者',
    addRule: '添加规则',
    globalSubnetOnly: '全局前缀 (0.0.0.0/0) 仅支持 subnet 级别规则',
    defaultResponse: '默认响应',
    noResponse: '无',
    useDefault: '—（使用默认）',
    receives: '接收',
    sends: '发送',
    over: '超过',
    under: '低于',
  },
  responses: {
    periodicExplanation: '随攻击更新执行，约每 5 分钟一次。',
    conditionsReadOnly: '条件加载失败，本次保存不会修改条件。',
    conditionIncomplete: '第 {row} 行前置条件未填完，请填完或删除。',
    actionSavedDisabled: '动作已以停用状态保存。',
    title: '响应配置',
    addResponse: '添加响应',
    actions: '动作列表',
    addAction: '添加动作',
    editAction: '编辑动作',
    actionType: '动作类型',
    executionPolicy: '执行策略',
    priority: '优先级',
    config: '配置 (JSON)',
    preconditions: '前置条件',
    preconditionsComingSoon: '前置条件：即将推出',
    addCondition: '添加条件',
    boundTemplates: '绑定模板',
    onDetected: '攻击检测时',
    onExpired: '攻击结束时',
    connector: '连接器',
    connectorName: '连接器',
    selectConnector: '选择连接器',
    runMode: '运行模式',
    periodSeconds: '周期（秒）',
    execution: '执行方式',
    xdropAction: 'xDrop 动作',
    xdropDecoderScope: 'Decoder 适用范围',
    xdropDecoderScopeBody: 'xDrop 调度会根据攻击的 decoder 做限制。只有 decoder = tcp / tcp_syn / tcp_ack / tcp_rst / tcp_fin / udp / icmp / fragment / gre / esp / igmp / bad_fragment / invalid 的 threshold 触发时，本动作才会 fire。对于 ip / ip_other 聚合 decoder 规则，xSight 会跳过本动作 (skip_reason=decoder_not_xdrop_compatible)，请改配 BGP action 做 L3 缓解。异常类（bad_fragment / invalid）经 xDrop v3 异常位匹配，drop 与 rate_limit 均可；IPv6 bad_fragment 由 xDrop 拒绝。',
    filterFields: '匹配字段',
    filterFieldsHint: '勾选且适用于该攻击类型的字段作为规则条件；空值不下发。',
    filterFieldsRequired: '请至少选择一个匹配字段',
    rateLimitPPS: '限速 (PPS)',
    rateLimitRequired: '限速值必须大于 0',
    targetNodes: '目标节点',
    targetNodesHint: '留空 = 所有节点',
    shellExtraArgs: '额外参数',
    shellExtraArgsPlaceholder: '附加命令参数',
    unblockDelay: '规则保持（分钟）',
    unblockDelayHint: '攻击结束后本 xSight 继续持有规则的时长。0 = 立即释放。最后一个持有方释放后，XDrop 才删除规则。',
    withdrawDelay: '路由保持（分钟）',
    withdrawDelayHint: '攻击结束后，BGP 路由额外保持多久再撤回。0 = 立即撤回。',
    protocolPinnedTip: '协议由攻击类型确定，勾选与否结果相同；异常类规则不带协议字段。',
  },
  webhooks: {
    title: 'Webhook 管理',
    addWebhook: '添加 Webhook',
    url: 'URL',
    events: '事件',
    headers: 'Headers (JSON)',
  },
  attacks: {
    expiredNotHeld: '攻击 #{id} 已结束，但未压制：该攻击不在实时检测中（例如 controller 重启后）',
    expiredGlobal: '攻击 #{id} 已结束，已按全局设置请求压制',
    expiredNoHold: '攻击 #{id} 已结束，本次未请求压制',
    expiredHeld: '攻击 #{id} 已结束，已请求最长压制 {n} 秒',
    expireHoldInvalid: '请输入 0–86400 的整数，或留空',
    expireHoldPlaceholder: '压制秒数，如 600（留空 = 使用全局设置，0 = 不压制，最大 86400）',
    expireConfirm: '确定结束攻击 #{id}（{target}）？压制期内，{target} 同方向、同 decoder 的新告警会被压住；检测不再看到这次攻击时压制提前解除，controller 重启也会清除压制。',
    expireTitle: '手动结束攻击',
    title: '攻击记录',
    active: '活跃攻击',
    all: '全部攻击',
    dstIp: '目标 IP',
    srcIpLabel: '源 IP（出站）',
    direction: '方向',
    decoder: '解码器',
    attackType: '攻击类型',
    severity: '严重程度',
    peakPps: '峰值 PPS',
    peakBps: '峰值 BPS',
    peak: '峰值',
    timer: '计时器',
    breaching: '超阈值',
    expiringIn: '剩余',
    triggerRule: '触发规则',
    bgpRouting: 'BGP 路由',
    xdropFiltering: 'xDrop 过滤',
    forceWithdraw: '强制撤回',
    forceUnblock: '强制解除',
    forceRemoved: '已强制移除',
    confirmForceWithdraw: '确定强制撤回此路由？',
    confirmForceUnblock: '确定强制解除此规则？',
    confirmDetachFromShared: '该路由还与另外 {remaining} 个攻击共享。强制移除会撤回整条路由，这些攻击也将失去保护。是否继续？',
    announcedAt: '公告时间',
    statusActive: '活跃',
    statusDelayed: '延迟中',
    statusPending: '待执行',
    statusFailed: '失败',
    startedAt: '开始时间',
    endedAt: '结束时间',
    duration: '持续时间',
    nodeSources: '报告节点',
    reasonCodes: '判定原因',
    confidence: '置信度',
    expire: '手动结束',
    actionsLog: '动作日志',
    triggerPhase: '触发阶段',
    statusCode: '状态码',
    durationMs: '耗时 (ms)',
    bgpRole: 'BGP 角色',
    bgpRoleTriggered: '触发',
    bgpRoleAttached: '附加',
    viewDetail: '详情',
    actionDetail: '动作详情',
    sensorLogs: '流量日志',
    sensorLogsNote: '采样 Top-N 流量摘要（每秒按 packets 取 top-100，受采样率影响）',
    srcIp: '源 IP',
    srcPort: '源端口',
    dstPort: '目标端口',
    protocol: '协议',
    tcpFlags: 'TCP 标志',
    packets: '包数',
    bytes: '字节数',
    topSrcIps: 'Top 源 IP',
    topSrcPorts: 'Top 源端口',
    topDstPorts: 'Top 目标端口',
    flowPercent: '占比',
    noFlowData: '该攻击暂无流量数据',
    flowDataExpired: '流量日志已过期（超出保留期限），仅保留最近 7 天的采样数据',
    globalNoFlowDetail: '全局攻击无流量明细 — 0.0.0.0/0 为虚拟全局前缀，涵盖 IPv4 + IPv6 全部监控流量',
    time: '时间',
    responseBody: '响应内容',
    showRaw: '显示原文',
    showFormatted: '显示美化',
    errorMessage: '错误信息',
    critical: '严重',
    high: '高',
    medium: '中',
    low: '低',
    subtitle: '检测事件与事件历史',
    showingTop: '显示峰值 PPS 前 {count} 条',
    totalActive: '总活跃数',
    global: '全局',
    outbound: '↑ 出站',
    inbound: '↓ 入站',
    confirmReleaseShared: '释放本攻击这个动作的持有？本 xSight 还有 {n} 个其他持有方，规则保留。',
    confirmReleaseLast: '释放本攻击这个动作的持有？其他系统可能仍持有该规则。',
    holdReleased: '已释放持有',
    logNote: '说明',
    logSkipReason: '跳过原因',
    logDetail: '详情',
  },
  users: {
    title: '用户管理',
    addUser: '添加用户',
    username: '用户名',
    password: '密码',
    role: '角色',
    admin: '管理员',
    operator: '操作员',
    viewer: '观察者',
    newPassword: '新密码',
    passwordPlaceholder: '留空保持当前密码',
    created: '用户已创建',
    updated: '已更新',
    deleted: '已删除',
    confirmDelete: '确定删除此用户？',
    createFailed: '创建失败',
    updateFailed: '更新失败',
    deleteFailed: '删除失败',
  },
  dynDetect: {
    title: '动态检测',
    infoTitle: '动态检测工作原理',
    infoDesc: '动态检测使用 EWMA（指数加权移动平均）为每个前缀构建流量画像。每周划分为 168 个小时槽位，通过多周学习建立预期流量基线。当实际流量偏离超过渐进阈值时触发告警。',
    infoEwma: 'EWMA 平滑历史流量 — 通过 alpha 参数控制近期数据的权重。',
    infoSlots: '每周 168 个槽位（24小时 x 7天）— 每个槽位独立追踪预期基线。',
    infoDeviation: '渐进偏差 — 新学习的画像使用更宽的容忍度，随着样本积累逐步收窄。',
    infoMinThreshold: '最低阈值确保低流量前缀不会触发误报。',
    configTitle: '配置',
    enabled: '启用动态检测',
    deviationMax: '最大偏差 (%)',
    deviationMaxTip: '样本不足的新画像允许的最大偏差（如 200 = 预期值的 2 倍）。',
    deviationMin: '最小偏差 (%)',
    deviationMinTip: '样本充足的成熟画像的最小偏差（如 50 = 预期值的 1.5 倍）。',
    stableWeeks: '稳定周数',
    stableWeeksTip: '画像被认为成熟、偏差收窄到最小值所需的数据周数。',
    minPps: '最低 PPS',
    minPpsTip: '最低包速率阈值，动态阈值不会低于此值。',
    minBps: '最低 BPS',
    minBpsTip: '最低比特速率阈值，动态阈值不会低于此值。',
    ewmaAlpha: 'EWMA Alpha',
    ewmaAlphaTip: '平滑因子（0.01-0.99）。值越大对近期流量变化反应越快，值越小越稳定。',
    profileTitle: '画像状态',
    refresh: '刷新',
    currentSlot: '当前槽位',
    totalPrefixes: '前缀总数',
    activated: '已激活',
    learning: '学习中',
    prefix: '前缀',
    currentPps: '当前 PPS',
    expectedPps: '预期 PPS',
    dynamicThreshold: '动态阈值',
    sampleWeeks: '样本周数',
    statusLearning: '学习中',
    statusNormal: '正常',
    statusExceeded: '超限',
  },
  flow: {
    title: 'Flow 配置',
    addListener: '添加 Listener',
    listenAddress: '监听地址',
    protocolMode: '协议模式',
    sources: '数据源',
    manageSources: '管理配置',
    addSource: '添加数据源',
    deviceIp: '设备 IP',
    sampleMode: '采样模式',
    sampleRate: '采样率',
    decodeErrors: '解码错误',
    unknownExporter: '未注册设备',
    templateMisses: '模板缺失',
    sourceStatus: '状态',
    recordsDecoded: '已解码记录',
    lastReport: '最后上报',
    uptime: '连接时长',
  },
  traffic: {
    prefixFilterTip: '只筛选本图；卡片与 Top 表不按前缀筛选',
    prefix: '前缀',
    allNodes: '全部节点',
    totalPps: '总 PPS',
    totalBps: '总 BPS',
    activeNodes: '活跃节点',
    activePrefixes: '活跃前缀',
    topPrefixes: 'Top 前缀排行',
    totalTrend: '总流量趋势',
  },
  mitigations: {
    subtitle: '活跃的 BGP 路由与 xDrop 过滤规则',
    prefix: '前缀',
    routeMap: '路由映射',
    bgpConnector: 'BGP 连接器',
    ruleId: '规则 ID',
    xdropConnector: 'xDrop 连接器',
    forceFailed: '强制移除失败',
    timer: '计时器',
    elapsed: '已持续',
    remaining: '剩余',
    detail: '缓解详情',
    bgpRoute: 'BGP 路由',
    xdropRule: 'xDrop 规则',
    attack: '攻击',
    targetIp: '目标 IP',
    connector: '连接器',
    configuration: '配置',
    timeline: '执行时间线',
    noTimeline: '暂无执行日志',
    action: '动作',
    // v1.2 PR-5 孤立路由 banner
    orphanBannerTitle: '发现 {count} 条孤立 BGP 路由',
    orphanBannerDesc: '这些 FRR 中的路由没有对应的活跃攻击，可能是旧版本残留或其他系统管理的路由。请审查后选择 Force Withdraw（从 FRR 移除）或 Dismiss（保留路由，xSight 不再跟踪）。',
    confirmForceWithdrawShared: '本路由当前有 {count} 条活跃 attack 关联。Force Withdraw 会同时 detach 所有关联 attack 并撤回 announcement，是否继续？',
    confirmOrphanForceWithdraw: '确定要从 FRR 中强制撤回这条孤立路由吗？',
    confirmOrphanDismiss: '确定要忽略这条孤立路由吗？路由将保留在 FRR 中，xSight 不再跟踪。',
    dismiss: '忽略',
    dismissed: '孤立路由已忽略',
    // View dismissed orphans (v1.2)
    attachedAttacks: '关联的 attack ({count})',
    attachedCurrent: '活跃中',
    viewDismissedOrphans: '查看已忽略的孤立路由 ({count})',
    noDismissedOrphans: '无已忽略的孤立路由',
    dismissedOnUpgrade: '升级时自动忽略',
    detectedAt: '发现时间',
    undismiss: '重新标记',
    undismissed: '已重新标记为孤立路由',
    confirmUndismiss: '将其重新标记为孤立路由，在 banner 中再次显示？',
    shared: '共用',
    sharedTip: '本 xSight 还有 {n} 个其他持有方。',
    createFailed: '创建失败',
    createFailedTip: '创建结果未知，攻击结束后自动收尾。内部编号：{id}',
    failedRetryTip: '撤销未完成，会自动重试。',
    connectorDisabled: '已停用',
    connectorDisabledTip: '连接器已停用：撤销等启用后再做，强制解除会被拒绝。',
    delivery: '下发',
    deliveryTip: 'Active 表示 XDrop 已收下规则。各节点状态在打开本面板时现查一次。',
    deliveryRefresh: '刷新',
    deliveryNotFound: 'XDrop 上不存在',
    deliveryUnavailable: '连接器不可用',
    deliveryFailed: '查询失败',
    deliveryTimeout: '查询超时',
    deliveryNone: '无节点',
    deliveryStateConfirmed: '已确认',
    deliveryStatePending: '待确认',
    deliveryStateDisabled: '已停用',
    deliveryStateOffline: '离线',
    deliveryStateIncompatible: '不兼容',
    deliveryStateOverloaded: '过载',
    deliveryStateRejected: '被拒',
    forceTimeout: '请求超时，后台可能仍在处理。',
  },
  webhookConnectors: {
    timeoutTip: '请求超时，单位毫秒（1–10000）；webhook 调用最长等待 10 秒',
    timeout: '超时',
    title: 'Webhook 连接器管理',
    add: '添加连接器',
    edit: '编辑连接器',
    url: 'URL',
    method: '方法',
    headers: 'Headers (JSON)',
    global: '全局',
    test: '测试',
    testSuccess: 'Webhook 测试成功',
    testFailed: 'Webhook 测试失败',
    confirmDelete: '确定删除此 Webhook 连接器？',
  },
  templates: {
    recommendInboundOnly: '基线只统计入向流量',
    prefixLevel: '（前缀级）',
  },
  xdropConnectors: {
    apiUrlHint: '请填写带版本的基础地址，例如 https://xdrop.example.com:8000/api/v1；系统会在其后拼接 /rules。',
    nameRequired: '请输入名称',
    apiUrlRequired: '请输入 API 地址',
    apiKeyRequired: '请输入 API 密钥',
    title: 'xDrop 连接器管理',
    add: '添加连接器',
    edit: '编辑连接器',
    apiUrl: 'API 地址',
    apiKey: 'API 密钥',
    apiKeyPlaceholder: '留空保持当前值',
    test: '测试',
    testSuccess: '连接成功，凭证：{name}',
    testFailed: '连接测试失败',
    confirmDelete: '确定删除此 xDrop 连接器？',
    decoderScopeTitle: 'xDrop Decoder 适用范围',
    decoderScopeBody: 'xDrop 动作对 decoder=tcp / tcp_syn / tcp_ack / tcp_rst / tcp_fin / udp / icmp / fragment / gre / esp / igmp / bad_fragment / invalid 的 threshold 规则生效。decoder=ip / ip_other（L3 聚合）的规则请改用 BGP null-route（在 response 里配 BGP action）。异常类（bad_fragment / invalid）经 xDrop v3 异常位匹配，drop 与 rate_limit 均可；IPv6 bad_fragment 由 xDrop 拒绝。',
    timeout: '超时',
    timeoutTip: '每次请求 XDrop 的等待上限，1–30000 毫秒（缺省 10000）。创建、撤销、强制解除、下发现查都按它等待；越大，强制解除和现查越慢。',
    apiKeyTip: 'XDrop 上为本 xSight 建的机器凭证的密钥。',
    deleteInUse: '仍有规则或动作在用，相关记录在缓解与响应页。',
    deleteFailed: '删除失败',
  },
  bgpConnectors: {
    title: 'BGP 连接器管理',
    add: '添加连接器',
    edit: '编辑连接器',
    test: '测试',
    routes: '路由表',
    bgpRoutes: 'BGP 路由表',
    bgpAsn: 'BGP ASN',
    vtyshPath: 'vtysh 路径',
    connectionOk: 'BGP 连接正常',
    testFailed: '测试失败',
    fetchRoutesFailed: '获取路由表失败',
    deleteConfirm: '确定删除此 BGP 连接器？',
  },
  shellConnectors: {
    timeoutTip: '执行超时，单位毫秒（1–30000）；每个动作总时长约 30 秒封顶',
    timeout: '超时',
    title: 'Shell 脚本连接器管理',
    add: '添加连接器',
    edit: '编辑连接器',
    command: '命令',
    defaultArgs: '默认参数',
    commandHint: '命令必须以绝对路径开头（例如 /usr/local/bin/script.sh）',
    commandValidation: '命令必须以 / 开头',
    nameRequired: '名称为必填项',
    commandRequired: '命令为必填项',
    confirmDelete: '确定删除此 Shell 连接器？',
  },
  audit: {
    page: '第 {n} 页',
    nextPage: '下一页',
    prevPage: '上一页',
    endTime: '结束时间',
    startTime: '开始时间',
    allUsers: '全部用户',
    entityTypePlaceholder: '实体类型，如 watch_prefix',
    title: '审计日志',
    entityType: '实体类型',
    entityId: '实体 ID',
    action: '操作',
    diff: '变更内容',
    deliveryVersion: '配置版本',
    user: '用户',
  },
}
