Detail.vue 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. <template>
  2. <detail
  3. :showDesc="false"
  4. :showName="false"
  5. :hiddenKeys="['project_domain', 'tenant', 'status', 'updated_at']"
  6. :onManager="onManager"
  7. :data="data"
  8. :base-info="baseInfo" />
  9. </template>
  10. <script>
  11. import { isPublicTableColumn } from '@/utils/common/tableColumn'
  12. import WindowsMixin from '@/mixins/windows'
  13. export default {
  14. name: 'K8sRepoDetail',
  15. mixins: [WindowsMixin],
  16. props: {
  17. data: {
  18. type: Object,
  19. required: true,
  20. },
  21. onManager: {
  22. type: Function,
  23. required: true,
  24. },
  25. },
  26. data () {
  27. return {
  28. baseInfo: [
  29. {
  30. field: 'name',
  31. title: this.$t('helm.text_16'),
  32. slots: {
  33. default: ({ row }) => {
  34. return [
  35. <div class='text-truncate'>
  36. <list-body-cell-wrap copy row={ this.data } onManager={ this.onManager } field='name' title={ row.name } />
  37. </div>,
  38. ]
  39. },
  40. },
  41. },
  42. {
  43. field: 'type',
  44. title: this.$t('helm.text_92'),
  45. minWidth: 80,
  46. formatter: ({ row }) => {
  47. if (row.type === 'internal') return this.$t('helm.text_14')
  48. if (row.type === 'external') return this.$t('helm.text_15')
  49. return '-'
  50. },
  51. },
  52. {
  53. field: 'release_count',
  54. title: this.$t('helm.text_102'),
  55. formatter: ({ row }) => row.release_count || '0',
  56. },
  57. {
  58. field: 'url',
  59. title: this.$t('helm.text_96'),
  60. },
  61. isPublicTableColumn(),
  62. ],
  63. }
  64. },
  65. }
  66. </script>