import type { SuppressionFormData } from './types'

/**
 * 页面标题
 */
export const PAGE_TITLE = '告警抑制规则（降噪）管理'

/**
 * 默认表单数据
 */
export const DEFAULT_FORM_DATA: SuppressionFormData = {
  name: '',
  type: 'dedup',
  enabled: true,
  priority: 100,
  policy_id: 0,
  description: '',
  matchers: '{}',
  dedup_window: 300,
  dedup_keys: '',
  aggregate_window: 300,
  group_by: '',
  aggregate_count: 5,
  source_matchers: '{}',
  target_matchers: '{}',
  throttle_count: 1,
  throttle_window: 300,
  schedule: '{}',
}

/**
 * 表单校验规则
 */
export const FORM_RULES = {
  name: [{ required: true, message: '请输入规则名称' }],
  type: [{ required: true, message: '请选择抑制类型' }],
}

/**
 * 默认分页配置
 */
export const DEFAULT_PAGINATION = {
  current: 1,
  pageSize: 20,
  total: 0,
  showTotal: true,
  showJumper: true,
  showPageSize: true,
}

/**
 * 默认筛选表单
 */
export const DEFAULT_SEARCH_FORM = {
  keyword: '',
  type: '',
  policy_id: '',
  enabled: '',
}
