<script lang="ts" setup>
import { getOnlineClientList } from '@/api/subscription/consumer'
import { BasicTable, useTable } from '@/components/Table'

const props = defineProps<{
  consumerToken: string
}>()

const [register] = useTable({
  api: () => getOnlineClientList(props.consumerToken),
  columns: [
    {
      title: '客户端 ID',
      dataIndex: 'uuid',
    },
    {
      title: '客户端 IP',
      dataIndex: 'address',
    },
    {
      title: '最后上线时间',
      dataIndex: 'onlineDate',
    },
  ],
  bordered: true,
  inset: true,
  canResize: false,
  pagination: false,
})
</script>

<template>
  <BasicTable @register="register" />
</template>
