index.vue 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. <template>
  2. <base-side-page
  3. @cancel="cancelSidePage"
  4. :title="$t('dictionary.mongodb')"
  5. icon="mongodb"
  6. :res-name="detailData.name"
  7. :tabs="detailTabs"
  8. :current-tab="params.windowData.currentTab"
  9. :loaded="loaded"
  10. @tab-change="handleTabChange">
  11. <template v-slot:actions v-if="showActions">
  12. <actions :options="singleActions" :row="detailData" button-type="link" button-size="small" />
  13. </template>
  14. <component
  15. :is="params.windowData.currentTab"
  16. :data="detailData"
  17. :on-manager="onManager"
  18. :params="getParams"
  19. :getParams="getParams"
  20. :res-id="data.id"
  21. :id="listId"
  22. :columns="columns"
  23. taskResource="compute-tasks" />
  24. </base-side-page>
  25. </template>
  26. <script>
  27. import SidePageMixin from '@/mixins/sidePage'
  28. import WindowsMixin from '@/mixins/windows'
  29. import Actions from '@/components/PageList/Actions'
  30. import SingleActionsMixin from '../mixins/singleActions'
  31. import ColumnsMixin from '../mixins/columns'
  32. import MongodbDetail from './Detail'
  33. import MongodbBackupList from './BackupList.vue'
  34. export default {
  35. name: 'MongoDBSidePage',
  36. components: {
  37. Actions,
  38. MongodbDetail,
  39. MongodbBackupList,
  40. },
  41. mixins: [SidePageMixin, WindowsMixin, ColumnsMixin, SingleActionsMixin],
  42. data () {
  43. return {}
  44. },
  45. computed: {
  46. detailTabs () {
  47. const ret = [
  48. { label: this.$t('db.text_187'), key: 'mongodb-detail' },
  49. { label: this.$t('db.text_332'), key: 'mongodb-backup-list' },
  50. { label: this.$t('table.title.task'), key: 'task-drawer' },
  51. { label: this.$t('db.text_192'), key: 'event-drawer' },
  52. ]
  53. return ret
  54. },
  55. showActions () {
  56. return !this.$isScopedPolicyMenuHidden('mongodb_hidden_columns.perform_action')
  57. },
  58. getParams () {
  59. return {
  60. details: true,
  61. }
  62. },
  63. listId () {
  64. switch (this.params.windowData.currentTab) {
  65. case 'event-drawer':
  66. return 'EventListForRedisSidePage'
  67. case 'secgroup-list':
  68. return 'SecgroupListForRedisSidePage'
  69. default:
  70. return ''
  71. }
  72. },
  73. },
  74. }
  75. </script>