columns.js 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. import {
  2. getNameDescriptionTableColumn,
  3. getCopyWithContentTableColumn,
  4. getTimeTableColumn,
  5. getPublicScopeTableColumn,
  6. } from '@/utils/common/tableColumn'
  7. import i18n from '@/locales'
  8. export default {
  9. created () {
  10. this.columns = [
  11. getNameDescriptionTableColumn({
  12. resource: this.list.resource,
  13. onManager: this.onManager,
  14. hideField: true,
  15. slotCallback: row => {
  16. return (
  17. <side-page-trigger onTrigger={ () => this.handleOpenSidepage(row) }>{ row.name }</side-page-trigger>
  18. )
  19. },
  20. }),
  21. getPublicScopeTableColumn({
  22. vm: this,
  23. resource: 'keypairs',
  24. }),
  25. getCopyWithContentTableColumn({ field: 'public_key', title: i18n.t('compute.text_725') }),
  26. getCopyWithContentTableColumn({ field: 'fingerprint', title: i18n.t('compute.text_726') }),
  27. {
  28. field: 'scheme',
  29. title: i18n.t('compute.text_175'),
  30. },
  31. {
  32. field: 'linked_guest_count',
  33. title: this.$t('compute.text_699', [this.$t('dictionary.server')]),
  34. width: 120,
  35. slots: {
  36. default: ({ row }, h) => {
  37. if (this.isPreLoad && row.linked_guest_count === undefined) return [<data-loading />]
  38. return `${row.linked_guest_count}`
  39. },
  40. },
  41. },
  42. getTimeTableColumn(),
  43. ]
  44. },
  45. }