export const subnetColumns = [
  {
    dataIndex: 'cidr',
    title: '子网',
    width: 140,
  },
  {
    dataIndex: 'name',
    title: '名称',
    width: 120,
  },
  {
    dataIndex: 'vlan',
    title: 'VLAN',
    width: 100,
  },
  {
    dataIndex: 'gateway',
    title: '网关',
    width: 120,
  },
  {
    dataIndex: 'total',
    title: '总数',
    width: 80,
    align: 'center' as const,
  },
  {
    dataIndex: 'used',
    title: '已用',
    width: 80,
    align: 'center' as const,
  },
  {
    dataIndex: 'available',
    title: '可用',
    width: 80,
    align: 'center' as const,
  },
  {
    dataIndex: 'usage',
    title: '使用率',
    width: 160,
    slotName: 'usage',
  },
  {
    dataIndex: 'status',
    title: '状态',
    width: 100,
    align: 'center' as const,
    slotName: 'status',
  },
  {
    dataIndex: 'actions',
    title: '操作',
    width: 120,
    fixed: 'right' as const,
    slotName: 'actions',
  },
]

export const ipAllocationColumns = [
  {
    dataIndex: 'ip_address',
    title: 'IP地址',
    width: 150,
  },
  {
    dataIndex: 'hostname',
    title: '主机名',
    width: 200,
  },
  {
    dataIndex: 'mac_address',
    title: 'MAC地址',
    width: 180,
  },
  {
    dataIndex: 'allocation_status',
    title: '分配状态',
    width: 100,
    align: 'center' as const,
    slotName: 'allocation_status',
  },
  {
    dataIndex: 'status',
    title: '运行状态',
    width: 100,
    align: 'center' as const,
    slotName: 'status',
  },
  {
    dataIndex: 'usage_status',
    title: '使用状态',
    width: 120,
    align: 'center' as const,
    slotName: 'usage_status',
  },
  {
    dataIndex: 'source_type',
    title: '来源',
    width: 80,
    align: 'center' as const,
    slotName: 'source_type',
  },
  {
    dataIndex: 'last_used_at',
    title: '最后使用',
    width: 180,
    slotName: 'last_used_at',
  },
  {
    dataIndex: 'remark',
    title: '备注',
    width: 150,
  },
  {
    dataIndex: 'actions',
    title: '操作',
    width: 100,
    fixed: 'right' as const,
    slotName: 'actions',
  },
]

export const dhcpLeaseColumns = [
  {
    dataIndex: 'ip_address',
    title: 'IP地址',
    width: 150,
  },
  {
    dataIndex: 'mac_address',
    title: 'MAC地址',
    width: 180,
  },
  {
    dataIndex: 'hostname',
    title: '主机名',
    width: 200,
  },
  {
    dataIndex: 'subnet_name',
    title: '所属子网',
    width: 150,
  },
  {
    dataIndex: 'dhcp_server',
    title: 'DHCP服务器',
    width: 150,
  },
  {
    dataIndex: 'lease_start',
    title: '租约开始',
    width: 180,
    slotName: 'lease_start',
  },
  {
    dataIndex: 'lease_end',
    title: '租约结束',
    width: 180,
    slotName: 'lease_end',
  },
  {
    dataIndex: 'status',
    title: '状态',
    width: 100,
    align: 'center' as const,
    slotName: 'status',
  },
  {
    dataIndex: 'actions',
    title: '操作',
    width: 80,
    fixed: 'right' as const,
    slotName: 'actions',
  },
]

export const conflictColumns = [
  {
    dataIndex: 'ip_address',
    title: 'IP地址',
    width: 150,
  },
  {
    dataIndex: 'mac_address_1',
    title: 'MAC地址1',
    width: 180,
  },
  {
    dataIndex: 'hostname_1',
    title: '主机名1',
    width: 150,
  },
  {
    dataIndex: 'mac_address_2',
    title: 'MAC地址2',
    width: 180,
  },
  {
    dataIndex: 'hostname_2',
    title: '主机名2',
    width: 150,
  },
  {
    dataIndex: 'subnet_name',
    title: '所属子网',
    width: 150,
  },
  {
    dataIndex: 'detected_at',
    title: '发现时间',
    width: 180,
    slotName: 'detected_at',
  },
  {
    dataIndex: 'resolved_at',
    title: '解决时间',
    width: 180,
    slotName: 'resolved_at',
  },
  {
    dataIndex: 'status',
    title: '状态',
    width: 100,
    align: 'center' as const,
    slotName: 'status',
  },
  {
    dataIndex: 'actions',
    title: '操作',
    width: 80,
    fixed: 'right' as const,
    slotName: 'actions',
  },
]

export const changeColumns = [
  {
    dataIndex: 'ip_address',
    title: 'IP地址',
    width: 150,
  },
  {
    dataIndex: 'change_type',
    title: '变更类型',
    width: 120,
    align: 'center' as const,
    slotName: 'change_type',
  },
  {
    dataIndex: 'subnet_name',
    title: '所属子网',
    width: 150,
  },
  {
    dataIndex: 'changed_by',
    title: '变更人',
    width: 120,
  },
  {
    dataIndex: 'changed_at',
    title: '变更时间',
    width: 180,
    slotName: 'changed_at',
  },
  {
    dataIndex: 'remark',
    title: '备注',
    width: 200,
  },
  {
    dataIndex: 'actions',
    title: '操作',
    width: 80,
    fixed: 'right' as const,
    slotName: 'actions',
  },
]

export const anomalyColumns = [
  {
    dataIndex: 'ip_address',
    title: 'IP地址',
    width: 150,
  },
  {
    dataIndex: 'anomaly_type',
    title: '异常类型',
    width: 120,
    align: 'center' as const,
    slotName: 'anomaly_type',
  },
  {
    dataIndex: 'subnet_name',
    title: '所属子网',
    width: 150,
  },
  {
    dataIndex: 'detected_at',
    title: '发现时间',
    width: 180,
    slotName: 'detected_at',
  },
  {
    dataIndex: 'status',
    title: '状态',
    width: 100,
    align: 'center' as const,
    slotName: 'status',
  },
  {
    dataIndex: 'remark',
    title: '备注',
    width: 200,
  },
  {
    dataIndex: 'actions',
    title: '操作',
    width: 80,
    fixed: 'right' as const,
    slotName: 'actions',
  },
]
