columns.js 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. import {
  2. getNameDescriptionTableColumn,
  3. getBrandTableColumn,
  4. getStatusTableColumn,
  5. getCopyWithContentTableColumn,
  6. getEnabledTableColumn,
  7. getAccountTableColumn,
  8. } from '@/utils/common/tableColumn'
  9. import PasswordFetcher from '@Compute/sections/PasswordFetcher'
  10. export default {
  11. created () {
  12. this.columns = [
  13. getNameDescriptionTableColumn({
  14. onManager: this.onManager,
  15. hideField: true,
  16. title: this.$t('cloudenv.clouduser_list_t1'),
  17. edit: false,
  18. slotCallback: row => {
  19. return (
  20. <side-page-trigger
  21. permission='clouduser_get'
  22. name='ClouduserSidePage'
  23. id={row.id}
  24. list={this.list}
  25. vm={this}>{ row.name }</side-page-trigger>
  26. )
  27. },
  28. }),
  29. getEnabledTableColumn({
  30. field: 'is_console_login',
  31. title: this.$t('cloudenv.clouduser_list_t5'),
  32. minWidth: 100,
  33. }),
  34. getStatusTableColumn({ statusModule: 'clouduser' }),
  35. {
  36. field: 'password',
  37. title: this.$t('cloudenv.clouduser_list_t2'),
  38. width: 50,
  39. slots: {
  40. default: ({ row }) => {
  41. return [<PasswordFetcher serverId={ row.id } resourceType='cloudusers' />]
  42. },
  43. },
  44. },
  45. {
  46. field: 'iam_login_url',
  47. title: this.$t('cloudenv.clouduser_list_t3'),
  48. minWidth: 120,
  49. showOverflow: 'title',
  50. slots: {
  51. default: ({ row }) => {
  52. if (!row.iam_login_url) return '-'
  53. return [<help-link href={ row.iam_login_url } />]
  54. },
  55. },
  56. },
  57. getCopyWithContentTableColumn({
  58. field: 'owner_name',
  59. title: this.$t('cloudenv.clouduser_list_t4'),
  60. }),
  61. getBrandTableColumn({ field: 'provider' }),
  62. getAccountTableColumn({ field: 'cloudaccount', title: this.$t('common.text00108') }),
  63. ]
  64. },
  65. }