Detail.vue 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. <template>
  2. <detail
  3. :showDesc="false"
  4. :showName="false"
  5. :hiddenKeys="['project_domain', 'tenant', 'created_at', 'updated_at']"
  6. :onManager="onManager"
  7. :data="data"
  8. :base-info="baseInfo"
  9. :extra-info="extraInfo" />
  10. </template>
  11. <script>
  12. import DataView from '@K8S/sections/DataView'
  13. import { k8sStatusColumn } from '@K8S/utils/tableColumns'
  14. export default {
  15. name: 'K8sConfigmapDetail',
  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('k8s.text_41'),
  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. k8sStatusColumn(),
  43. {
  44. field: 'cluster',
  45. title: this.$t('k8s.text_19'),
  46. },
  47. {
  48. field: 'namespace',
  49. title: this.$t('k8s.text_23'),
  50. },
  51. {
  52. field: 'creationTimestamp',
  53. title: this.$t('k8s.text_74'),
  54. formatter: ({ row }) => {
  55. return (row.creationTimestamp && this.$moment(row.creationTimestamp).format()) || '-'
  56. },
  57. },
  58. ],
  59. extraInfo: [
  60. {
  61. title: this.$t('k8s.text_216'),
  62. field: 'data',
  63. slots: {
  64. default: ({ row }, h) => {
  65. return h(DataView, {
  66. props: {
  67. onManager: this.onManager,
  68. data: row,
  69. },
  70. })
  71. },
  72. },
  73. },
  74. ],
  75. }
  76. },
  77. }
  78. </script>