Detail.vue 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. <template>
  2. <detail
  3. :onManager="onManager"
  4. :data="data"
  5. :base-info="baseInfo"
  6. :extra-info="extraInfo"
  7. status-module="webapp"
  8. resource="webapps" />
  9. </template>
  10. <script>
  11. import {
  12. getBrandTableColumn,
  13. getCopyWithContentTableColumn,
  14. } from '@/utils/common/tableColumn'
  15. import {
  16. getUserTagColumn,
  17. } from '@/utils/common/detailColumn'
  18. import {
  19. getTechStackTableColumn,
  20. } from '../utils/columns'
  21. export default {
  22. name: 'WebAppDetail',
  23. props: {
  24. data: {
  25. type: Object,
  26. required: true,
  27. },
  28. onManager: {
  29. type: Function,
  30. required: true,
  31. },
  32. },
  33. data () {
  34. return {
  35. baseInfo: [
  36. getUserTagColumn({ onManager: this.onManager, resource: 'webapp', columns: () => this.columns, tipName: this.$t('compute.webapp') }),
  37. getBrandTableColumn(),
  38. getTechStackTableColumn(),
  39. ],
  40. }
  41. },
  42. computed: {
  43. extraInfo () {
  44. return [
  45. {
  46. title: this.$t('network.wire.networks'),
  47. items: [
  48. getCopyWithContentTableColumn({
  49. field: 'ip_addr',
  50. title: this.$t('compute.webapp.ip_addr'),
  51. hideField: true,
  52. message: (row) => {
  53. return row.ip_addr || ''
  54. },
  55. slotCallback: (row) => {
  56. return row.ip_addr || '-'
  57. },
  58. }),
  59. getCopyWithContentTableColumn({
  60. field: 'vpc',
  61. title: 'VPC',
  62. message: (row) => {
  63. return row.vpc || '-'
  64. },
  65. }),
  66. getCopyWithContentTableColumn({
  67. field: 'network',
  68. title: this.$t('cloudenv.text_181'),
  69. message: (row) => {
  70. return row.network || '-'
  71. },
  72. }),
  73. ],
  74. },
  75. ]
  76. },
  77. },
  78. }
  79. </script>