Detail.vue 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. <template>
  2. <detail
  3. statusModule="rdsDatabase"
  4. :base-info="baseInfo"
  5. :data="data"
  6. :on-manager="onManager"
  7. :is-edit-name="false" />
  8. </template>
  9. <script>
  10. import { RDS_ACCOUNT_PRIVILEGES } from '@DB/constants'
  11. export default {
  12. name: 'RDSDetail',
  13. props: {
  14. data: {
  15. type: Object,
  16. required: true,
  17. },
  18. onManager: {
  19. type: Function,
  20. required: true,
  21. },
  22. },
  23. data () {
  24. return {
  25. baseInfo: [
  26. {
  27. field: 'dbinstanceprivileges',
  28. title: this.$t('db.text_235'),
  29. slots: {
  30. default: ({ row }) => {
  31. if (row.dbinstanceprivileges && row.dbinstanceprivileges.length > 0) {
  32. return row.dbinstanceprivileges.map(({ account, privileges }) => {
  33. return <div>{account} <span style="color:#666;margin:0 0 0 3px">({RDS_ACCOUNT_PRIVILEGES[privileges]})</span></div>
  34. })
  35. }
  36. return '-'
  37. },
  38. },
  39. },
  40. ],
  41. }
  42. },
  43. }
  44. </script>