import type { FormItem } from '@/components/search-form/types'

export const subnetSearchForm: FormItem[] = [
  {
    field: 'keyword',
    label: '关键词',
    type: 'input',
    placeholder: '请输入子网CIDR、名称',
    span: 6,
  },
  {
    field: 'group_id',
    label: '分组',
    type: 'select',
    placeholder: '全部分组',
    options: [],
    span: 6,
  },
]

export const ipSearchForm: FormItem[] = [
  {
    field: 'keyword',
    label: '关键词',
    type: 'input',
    placeholder: '请输入IP地址、主机名',
    span: 6,
  },
  {
    field: 'subnet_id',
    label: '子网',
    type: 'select',
    placeholder: '全部子网',
    options: [],
    span: 6,
  },
  {
    field: 'allocation_status',
    label: '分配状态',
    type: 'select',
    placeholder: '全部状态',
    options: [
      { label: '已分配', value: 'allocated' },
      { label: '未分配', value: 'unallocated' },
      { label: '保留', value: 'reserved' },
    ],
    span: 6,
  },
  {
    field: 'status',
    label: '运行状态',
    type: 'select',
    placeholder: '全部状态',
    options: [
      { label: '在线', value: 'online' },
      { label: '离线', value: 'offline' },
      { label: '未知', value: 'unknown' },
    ],
    span: 6,
  },
  {
    field: 'usage_status',
    label: '使用状态',
    type: 'select',
    placeholder: '全部状态',
    options: [
      { label: '已使用', value: 'used' },
      { label: '未使用', value: 'unused' },
      { label: '30天内使用', value: 'used_within_30d' },
      { label: '30天前使用', value: 'used_before_30d' },
    ],
    span: 6,
  },
]

export const dhcpLeaseSearchForm: FormItem[] = [
  {
    field: 'keyword',
    label: '关键词',
    type: 'input',
    placeholder: '请输入IP地址、MAC地址',
    span: 8,
  },
  {
    field: 'subnet_id',
    label: '子网',
    type: 'select',
    placeholder: '全部子网',
    options: [],
    span: 8,
  },
]

export const conflictSearchForm: FormItem[] = [
  {
    field: 'keyword',
    label: '关键词',
    type: 'input',
    placeholder: '请输入IP地址',
    span: 8,
  },
  {
    field: 'subnet_id',
    label: '子网',
    type: 'select',
    placeholder: '全部子网',
    options: [],
    span: 8,
  },
  {
    field: 'status',
    label: '状态',
    type: 'select',
    placeholder: '全部状态',
    options: [
      { label: '未解决', value: 'unresolved' },
      { label: '已解决', value: 'resolved' },
    ],
    span: 8,
  },
]

export const changeSearchForm: FormItem[] = [
  {
    field: 'keyword',
    label: '关键词',
    type: 'input',
    placeholder: '请输入IP地址',
    span: 8,
  },
  {
    field: 'subnet_id',
    label: '子网',
    type: 'select',
    placeholder: '全部子网',
    options: [],
    span: 8,
  },
  {
    field: 'change_type',
    label: '变更类型',
    type: 'select',
    placeholder: '全部类型',
    options: [
      { label: '分配', value: 'allocate' },
      { label: '释放', value: 'release' },
      { label: '修改', value: 'modify' },
      { label: '状态变更', value: 'status_change' },
    ],
    span: 8,
  },
]

export const anomalySearchForm: FormItem[] = [
  {
    field: 'keyword',
    label: '关键词',
    type: 'input',
    placeholder: '请输入IP地址',
    span: 6,
  },
  {
    field: 'subnet_id',
    label: '子网',
    type: 'select',
    placeholder: '全部子网',
    options: [],
    span: 6,
  },
  {
    field: 'anomaly_type',
    label: '异常类型',
    type: 'select',
    placeholder: '全部类型',
    options: [
      { label: 'IP扫描异常', value: 'scan_anomaly' },
      { label: 'MAC地址变更', value: 'mac_change' },
      { label: '未知设备', value: 'unknown_device' },
      { label: 'IP地址泄漏', value: 'ip_leak' },
    ],
    span: 6,
  },
  {
    field: 'status',
    label: '状态',
    type: 'select',
    placeholder: '全部状态',
    options: [
      { label: '待处理', value: 'pending' },
      { label: '已处理', value: 'resolved' },
    ],
    span: 6,
  },
]
