columns.js 966 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. import i18n from '@/locales'
  2. import { BAND_WIDTH_OPTION } from '../../../constants'
  3. export const getBandwidthTableColumn = () => {
  4. return {
  5. field: 'bandwidth',
  6. title: i18n.t('network.text_195'),
  7. minWidth: 100,
  8. sortable: true,
  9. showOverflow: 'ellipsis',
  10. formatter: ({ row }) => {
  11. const item = BAND_WIDTH_OPTION.find(val => val.value === `${row.bandwidth}`)
  12. return item ? item.label : row.bandwidth
  13. },
  14. }
  15. }
  16. export const getMTUTableColumn = () => {
  17. return {
  18. field: 'mtu',
  19. title: 'MTU',
  20. minWidth: 50,
  21. sortable: true,
  22. showOverflow: 'ellipsis',
  23. formatter: ({ row }) => {
  24. return row.mtu || '-'
  25. },
  26. }
  27. }
  28. export const getHostsTableColumn = () => {
  29. return {
  30. field: 'hosts',
  31. title: i18n.t('network.wire.hosts'),
  32. type: 'expand',
  33. width: 100,
  34. slots: {
  35. default: ({ row }, h) => {
  36. return row.host_count || 0
  37. },
  38. content: ({ row }, h) => {},
  39. },
  40. }
  41. }