import { DEVICE_CATEGORY_MAP } from '@/api/ops/room-device'

export const columns = [
  {
    dataIndex: 'id',
    title: 'ID',
    width: 80,
    slotName: 'id',
  },
  {
    dataIndex: 'name',
    title: '服务名称',
    width: 150,
  },
  {
    dataIndex: 'room_id',
    title: '机房ID',
    width: 120,
  },
  {
    dataIndex: 'device_category',
    title: '设备分类',
    width: 100,
    render: ({ record }: any) => {
      return DEVICE_CATEGORY_MAP[record.device_category] || record.device_category
    },
  },
  {
    dataIndex: 'agent_config',
    title: '采集地址',
    width: 200,
    ellipsis: true,
    tooltip: true,
  },
  {
    dataIndex: 'enabled',
    title: '启用状态',
    width: 100,
    slotName: 'enabled',
  },
  {
    dataIndex: 'collect_on',
    title: '数据采集',
    width: 100,
    slotName: 'data_collection',
  },
  {
    dataIndex: 'collect_interval',
    title: '采集间隔(秒)',
    width: 120,
  },
  {
    dataIndex: 'collect_last_result',
    title: '采集结果',
    width: 150,
    ellipsis: true,
    tooltip: true,
  },
  {
    dataIndex: 'actions',
    title: '操作',
    width: 180,
    fixed: 'right' as const,
    slotName: 'actions',
  },
]
